ISPN-5089 Store divisors in a temporary variable to avoid java.lang.ArithmeticException: / by zero

https://issues.jboss.org/browse/ISPN-5089