Request for review (XXS): JDK-8004066: TEST_BUG: test/java/lang/Math/DivModTests.java assumes ArithmeticException message

Alan Bateman Alan.Bateman at oracle.com
Sat Dec 1 15:54:32 UTC 2012


On 30/11/2012 18:48, Krystal Mo wrote:
> Hi all,
>
> Could I get a couple of review for this small change, please?
> And could someone from the JDK side sponsor this change?
>
> Bug: https://jbs.oracle.com/bugs/browse/JDK-8004066
> Webrev: http://cr.openjdk.java.net/~kmo/8004066/webrev.00/
>
> The DivModTest introduced in JDK-6282196 [1] checks the contents of 
> the exception message, but that message isn't specified in JavaDoc and 
> thus may vary between VM implementations (or even in the same VM).
It looks okay to me, I assume testIntFloorDivMod() could also be changed 
to create the ArithmeticException with the no-arg constructor as the 
exception message will no longer be tested.

Just a general point, the tests in the jdk repository are not 
conformance tests and so it is okay (and normal) for these tests to 
exercise highly implementation-specific behavior. They are expected to 
be updated and always in sync with the JDK code. Clearly checking 
exception messages will a bit fragile, more so in this this case as the 
exception messages are coming from the VM.

-Alan.





More information about the core-libs-dev mailing list