Rhino is initialized - and therefore the lib necessary - even if Nashorn is available
sdoeringNew opened this issue · 3 comments
In a static initialization block in RegexECMA262Helper.java
the available JavaScript engines are initialized. Javas Nashorn engine is pretty straight forward and can be used easily. That's the primary script engine which is always used if Java 8 - 14 is used.
However the backup engine Rhino is also initialized thus making it impossible to remove the Rhino lib from every application that uses the json-schema-core although it is unused during the whole runtime. 😞
Why not just initialize Rhino if Nashorn is not available?
Happy to take a PR. Seems like it should be a pretty simple change to lazily init the Rhino objects.
Yeah, sure. I'm familiar with the source code.
The only difficulty will be this awful code style - no offense ☮️. It gives me shivers.
@huggsboson are you still planning to release a version with #94 included?