Skip to content
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

Remove useless dependency to rhino #50

Merged
merged 1 commit into from
Jul 21, 2021
Merged

Remove useless dependency to rhino #50

merged 1 commit into from
Jul 21, 2021

Conversation

qmetzler-luna
Copy link
Contributor

Describe the improvement

The project is dependent on the Rhino lib but it doesn't seem to be used

Expected behaviour

The lib should import as little lib as possible

Content of this PR

Remove the Rhino dependency

How did you test?

Clone repo
Open in Android Studio
Run unit tests ✅

@qmetzler-luna qmetzler-luna requested a review from a team as a code owner July 20, 2021 14:38
@oleksandrsarapulovgl oleksandrsarapulovgl merged commit 2201a8a into eu-digital-green-certificates:main Jul 21, 2021
@qmetzler-luna qmetzler-luna deleted the feat/uselessDependency branch July 21, 2021 14:23
@FDuhen
Copy link

FDuhen commented Sep 1, 2021

The rhino dependency was allowing the json-schema-validator library to use the ScriptEngineManager it one of it's classes.
I should spend more time testing to understand what is happening here with those two libraries, but removing the rhino implementation causes a ClassNotFoundException in some cases (my use case was to use a new JsonSchema with more inputs)

EDIT :
I played a little bit more with the project.
If you update the JSON_SCHEMA_V1 val and add a pattern entry like in the following example

...
  "  \"properties\": {\n" +
        "    \"ver\": {\n" +
        "      \"title\": \"Schema version\",\n" +
        "      \"description\": \"Version of the schema, according to Semantic versioning (ISO, https://semver.org/ version 2.0.0 or newer)\",\n" +
        "      \"type\": \"string\",\n" +
        "      \"pattern\":\"^\\\\d+.\\\\d+.\\\\d+.*\\\\w*\$\",\n" +
...

the json validator will crash if the Rhino dependency isn't added.

The crash will look like the following :
com.google.common.util.concurrent.ExecutionError: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: org/mozilla/javascript/Scriptable

@daniel-eder
Copy link
Member

@oleksandrsarapulovgl can you take a look at this?

@oleksandrsarapulovgl
Copy link
Contributor

@FDuhen seems, it's required for you specific case

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.

4 participants