Skip to content

Emulation for static methods in System, Objects, Double, Float, Integer#10224

Open
zbynek wants to merge 3 commits intogwtproject:mainfrom
zbynek:emul-numbers
Open

Emulation for static methods in System, Objects, Double, Float, Integer#10224
zbynek wants to merge 3 commits intogwtproject:mainfrom
zbynek:emul-numbers

Conversation

@zbynek
Copy link
Copy Markdown
Collaborator

@zbynek zbynek commented Dec 14, 2025

Adds emulation for

  • Float#toHexString(float)
  • Double#toHexString(double)
  • Integer#parseInt(CharSequence, int, int, int) (since Java 9)
  • Objects#checkIndex(long, long), Objects#checkFromIndexSize(long, long, long), Objects#checkFromToIndex(long, long, long) (added in Java 16)
  • System#lineSeparator() (since Java 7)

Partial fix for #10221

@zbynek zbynek changed the title Emulation for static methods in System, Objects, Double, Float Emulation for static methods in System, Objects, Double, Float, Integer Dec 14, 2025
Comment thread user/super/com/google/gwt/emul/java/util/Objects.java Outdated
@zbynek zbynek force-pushed the emul-numbers branch 4 times, most recently from 9a71d90 to 8491b9f Compare December 14, 2025 14:46
@zbynek zbynek added the ready This PR has been reviewed by a maintainer and is ready for a CI run. label Dec 14, 2025
Comment thread user/test/com/google/gwt/emultest/java/lang/DoubleTest.java
}
}

public void testToHexString() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Float.html#toHexString(float) for the other tests, but floats can get a little dicey in GWT (since we emulate them with JS number, which is basically just Double already)

zbynek and others added 2 commits April 27, 2026 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Category-JRE ready This PR has been reviewed by a maintainer and is ready for a CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants