-
Notifications
You must be signed in to change notification settings - Fork 57
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
Rhino is initialized - and therefore the lib necessary - even if Nashorn is available #93
Comments
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. |
sdoeringNew
added a commit
to sdoeringNew/json-schema-core
that referenced
this issue
Sep 19, 2020
Additionally the Regex class was refactored now following the strategy pattern to prevent if / else on every method call. That refactoring also helped solving the issue. Also add coverage to the class as the Rhino engine has not been unit-tested before if the build has been done with Java 8 - 14.
huggsboson
pushed a commit
that referenced
this issue
Sep 21, 2020
Additionally the Regex class was refactored now following the strategy pattern to prevent if / else on every method call. That refactoring also helped solving the issue. Also add coverage to the class as the Rhino engine has not been unit-tested before if the build has been done with Java 8 - 14.
@huggsboson are you still planning to release a version with #94 included? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
The text was updated successfully, but these errors were encountered: