Skip to content

Keep the NumberFormatException message from Integer, Long and Short parsing - #647

Open
anishmehta24 wants to merge 1 commit into
javapathfinder:masterfrom
anishmehta24:fix-parse-number-messages
Open

anishmehta24 wants to merge 1 commit into
javapathfinder:masterfrom
anishmehta24:fix-parse-number-messages

Conversation

@anishmehta24

Copy link
Copy Markdown

The parseInt/parseLong/parseShort peers catch the host NumberFormatException and throw a new one in the program without its message, so getMessage() is null under JPF:

try {
  Integer.parseInt("abc");
} catch (NumberFormatException x) {
  System.out.println(x.getMessage()); // JVM: For input string: "abc"   JPF: null
}

They now pass the message on (Byte already gets it, since it is not a peer).

Added IntegerTest.testParseErrorKeepsMessage, which fails on master. It only checks that the message mentions the input, because the exact wording comes from the host JDK. Tested on Windows 11 with Temurin 11.0.32: parallelTest passes (1033), and singleThreadTest has only the two URLClassLoaderTest failures that also happen on Windows on master (#427, fixed in #644).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant