Skip to content

Remove Rhino engine (Java < 8) support#389

Merged
walterhiggins merged 11 commits intowalterhiggins:developmentfrom
ut7:drop-rhino
Aug 17, 2018
Merged

Remove Rhino engine (Java < 8) support#389
walterhiggins merged 11 commits intowalterhiggins:developmentfrom
ut7:drop-rhino

Conversation

@jonathanperret
Copy link
Copy Markdown
Contributor

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!

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.
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.
@walterhiggins walterhiggins merged commit a3768f6 into walterhiggins:development Aug 17, 2018
@jonathanperret jonathanperret deleted the drop-rhino branch August 18, 2018 06:55
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.

2 participants