FULL PRODUCT VERSION :
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
Unlike java.math.BigDecimal, java.math.BigInteger misses the methods
byteValueExact()
shortValueExact()
intValueExact()
longValueExact()
This makes it extremely difficult to implement efficient cast methods that are aware of integer overflows. Such cast are required, e.g. to implement other languages for the Java VM efficiently.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Look at the source code of java.lang.BigInteger. There are no xxxValueExact() methods. The xxxValue() methods do not throw an ArithmeticException in case of overflows.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Have dedicated methods that throw ArithmeticExceptions.
ACTUAL -
There are no dedicated methods that throw ArithmeticExceptions.
REPRODUCIBILITY :
This bug can be reproduced always.
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
Unlike java.math.BigDecimal, java.math.BigInteger misses the methods
byteValueExact()
shortValueExact()
intValueExact()
longValueExact()
This makes it extremely difficult to implement efficient cast methods that are aware of integer overflows. Such cast are required, e.g. to implement other languages for the Java VM efficiently.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Look at the source code of java.lang.BigInteger. There are no xxxValueExact() methods. The xxxValue() methods do not throw an ArithmeticException in case of overflows.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Have dedicated methods that throw ArithmeticExceptions.
ACTUAL -
There are no dedicated methods that throw ArithmeticExceptions.
REPRODUCIBILITY :
This bug can be reproduced always.