-
Notifications
You must be signed in to change notification settings - Fork 383
Add emulation for Java 9 additions to Objects class #10107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zbynek
wants to merge
5
commits into
gwtproject:main
Choose a base branch
from
zbynek:java11-emul
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cfd11b6
Add emulation for Java 9 additions to Objects class
zbynek 4ce70ae
Apply suggestions from code review
zbynek 5c1cdfc
Add tests and comment
zbynek b1acf4f
Merge branch 'main' of https://github.com/gwtproject/gwt into java11-…
zbynek 9d6de8e
Throw the right exception
zbynek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure about this exception message. Can't remember if it'll be pruned in production builds (in which case this is OK) or not (in which case we should just throw the exception without message)
Alternatively, we could emulate the IndexOufOfBoundsException(int) constructor and use it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we are exposing user methods to call, we should leave it up to them to prune or not - GWT might prune null checks inside of collections and such if directed, but we wouldn't want to actually rewrite
if (foo == null)
etc, and likewise shouldn't optimize these out?EDIT: you're specifically talking about the error message being pruned, while I'm speaking more broadly, the runtime error at all, and the expected error message (which the developer explicitly wants).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The information should be transported to the user. Some months ago I came across an IOOBE in GWT which did not provide any information and it was annoying.
GWT already has a bunch of different exception messages for IOOBE so I am fine with the text.
I guess we would save more if GWT would provide some internal ctors or factory methods in IOOBE each providing a fixed, short error message and then use these ctors everywhere to get rid of all the different messages.