Description
The member methods multiply(int) / divide(int) in the class org.apache.commons.math3.fraction.Fraction do not have overflow checks.
return new Fraction(numerator * i, denominator);
should be
return new Fraction(ArithmeticUtils.mulAndCheck(numerator, i), denominator);
or, considering the case gcd(i, denominator) > 1,
return multiply(new Fraction(i));