update of Scanner to handle longs with up to 53 bits only #186
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
restrictions on BitSet and Scanner
Because of the issue of long being only 53 bits, any time a method returns a long value, considerations must
be made as to whether this will work in JavaScript. In particular, BitSet and Scanner have issues.
In SwingJS, java.util.BitSet has been implemented as a 32-bit integer-based bitset. This was no problem in
Java 6, but starting with Java 7, a method was added to BitSet that allows for the extraction of the
underlying long[] word data. This is not work in JavaScript. Instead, SwingJS java.util.Bitset.toLongArray() will deliver
32-bit int[] data.
SwingJS Scanner has hasNextLong() and nextLong(), and although it will scan through long numbers,
Scanner will choke on long numbers greater than the JavaScript 53-bit limit. hasNextLong() will
return false, and nextLong() will throw an InputMismatchException triggered by the NumberFormatException
thrown by Long.parseLong().