Skip to content

Commit 90af11e

Browse files
authored
Replace Nashorn with Rhino as JavaScript engine fallback (#85)
1 parent 1fa079e commit 90af11e

3 files changed

Lines changed: 17 additions & 17 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build
22

33
on:
44
push:
5-
branches: [ 'sustaining/1.8.x','master' ]
5+
branches: [ 'sustaining/1.8.x','master', 'issues/**', 'features/**' ]
66
pull_request:
77
jobs:
88
build-maven:

OpenICF-java-framework/connector-framework-internal/pom.xml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
with the fields enclosed by brackets [] replaced by
2222
your own identifying information:
2323
"Portions Copyrighted [year] [name of copyright owner]"
24+
25+
Portions Copyrighted 2024-2026 3A Systems LLC.
2426
-->
2527
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2628
<modelVersion>4.0.0</modelVersion>
@@ -36,22 +38,6 @@
3638
The IdentityConnectors framework provides a container to separate the Connector bundle from the application.
3739
The framework provides many common features that developers would otherwise need to implement on their own.
3840
</description>
39-
<profiles>
40-
<profile>
41-
<id>jdk17.options</id>
42-
<activation>
43-
<jdk>[17,)</jdk>
44-
</activation>
45-
<dependencies>
46-
<dependency>
47-
<groupId>org.openjdk.nashorn</groupId>
48-
<artifactId>nashorn-core</artifactId>
49-
<version>15.4</version>
50-
<optional>true</optional>
51-
</dependency>
52-
</dependencies>
53-
</profile>
54-
</profiles>
5541

5642
<dependencies>
5743
<dependency>
@@ -76,6 +62,14 @@
7662
<!-- @see: org/identityconnectors/framework/impl/test/TestHelpersImpl.java -->
7763
</dependency>
7864

65+
<!--Optional dependencies-->
66+
<dependency>
67+
<groupId>org.apache.servicemix.bundles</groupId>
68+
<artifactId>org.apache.servicemix.bundles.rhino</artifactId>
69+
<version>1.7.15_1</version>
70+
<optional>true</optional>
71+
</dependency>
72+
7973
<!-- Test Dependencies -->
8074
<dependency>
8175
<groupId>org.testng</groupId>

OpenICF-java-framework/connector-framework-internal/src/main/java/org/identityconnectors/common/script/javascript/JavaScriptExecutorFactory.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
* with the fields enclosed by brackets [] replaced by
2121
* your own identifying information:
2222
* "Portions Copyrighted [year] [name of copyright owner]"
23+
*
24+
* Portions Copyrighted 2024-2026 3A Systems LLC.
2325
*/
2426

2527
package org.identityconnectors.common.script.javascript;
@@ -55,6 +57,10 @@ public class JavaScriptExecutorFactory extends ScriptExecutorFactory {
5557
*/
5658
public JavaScriptExecutorFactory() {
5759
ScriptEngine engine = manager.getEngineByName(JAVA_SCRIPT);
60+
if(engine == null) {
61+
manager.registerEngineName(JAVA_SCRIPT, new org.mozilla.javascript.engine.RhinoScriptEngineFactory());
62+
engine = manager.getEngineByName(JAVA_SCRIPT);
63+
}
5864
if (null == engine) {
5965
throw new IllegalStateException("JavaScript Engine is not found");
6066
}

0 commit comments

Comments
 (0)