Remove Rhino engine (Java < 8) support#389
Merged
walterhiggins merged 11 commits intowalterhiggins:developmentfrom Aug 17, 2018
Merged
Remove Rhino engine (Java < 8) support#389walterhiggins merged 11 commits intowalterhiggins:developmentfrom
walterhiggins merged 11 commits intowalterhiggins:developmentfrom
Conversation
Since Nashorn-created implementations of the org.bukkit.event.Listener interface correctly implement Object.equals() (which was not the case with Rhino), we can go back to instantiating a different Listener instance per event handler and let the Bukkit API worry about the details of RegisteredListeners. Also, Nashorn automatically implements "functional interfaces" so there is no need to explicitly create an EventExecutor.
https://bugs.openjdk.java.net/browse/JDK-8034055 is reported fixed in 8u20 which is ancient.
I confirmed this works from Java 8u45.
I couldn't reproduce a case of Nashorn returning null for a non-existent property, of either a Java object or a JavaScript object, even going back to Java 8u20. But the test makes sense in any case, so I just removed the mention of Nashorn.
Untested, but a very straightforward change.
…isterAll is unambiguous
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This removes a bunch of code that is only here to support running under a pre-8 JVM, allowing some simplifications and to take advantage of Nashorn-specific features. Note that as of Minecraft 1.12, Java 8 is a requirement to run Minecraft.
As Nashorn itself is about to be deprecated, and as I was trying to make ScriptCraft work with GraalJS which is the likeliest replacement so far, I realized it was maybe time to get rid of cruft supporting an ancient JavaScript engine.
I hope this can be useful. Cheers!