Skip to content

Commit

Permalink
update hashorn dependency imports
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrenn committed Jun 17, 2024
1 parent 8ba9844 commit 2a4517d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import javax.script.ScriptEngine;
import javax.script.ScriptException;

import org.openjdk.nashorn.api.scripting.JSObject;
import org.phoenixctms.ctsms.util.CommonUtil;
import org.phoenixctms.ctsms.util.CoreUtil;
import org.phoenixctms.ctsms.util.DefaultSettings;
Expand All @@ -31,8 +32,6 @@
import org.phoenixctms.ctsms.vo.VisitScheduleItemOutVO;
import org.springframework.core.io.ClassPathResource;

import jdk.nashorn.api.scripting.JSObject;

@SuppressWarnings("restriction")
public class FieldCalculation {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.Map;
import java.util.Set;

import jdk.nashorn.api.scripting.AbstractJSObject;
import org.openjdk.nashorn.api.scripting.AbstractJSObject;

//http://stackoverflow.com/questions/7519399/how-to-convert-java-map-to-a-basic-javascript-object
@SuppressWarnings("restriction")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.phoenixctms.ctsms.js;

import jdk.nashorn.api.scripting.JSObject;
import org.openjdk.nashorn.api.scripting.JSObject;

@SuppressWarnings("restriction")
public class ValidationError {
Expand Down
10 changes: 6 additions & 4 deletions core/src/main/java/org/phoenixctms/ctsms/util/CoreUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
import javax.imageio.ImageReader;
import javax.imageio.stream.ImageInputStream;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;

import org.apache.commons.codec.binary.Base64;
import org.openjdk.nashorn.api.scripting.NashornScriptEngineFactory;
import org.phoenixctms.ctsms.PrincipalStore;
import org.phoenixctms.ctsms.UserContext;
import org.phoenixctms.ctsms.compare.AlphanumStringComparator;
Expand Down Expand Up @@ -81,7 +81,7 @@ public final class CoreUtil implements ApplicationContextAware {

public final static String OBFUSCATED_STRING = "********";
public final static String RANDOM_ALGORITHM = "SHA1PRNG";
private final static String JAVASCRIPT_ENGINE_NAME = "JavaScript";
//private final static String JAVASCRIPT_ENGINE_NAME = "JavaScript";
public static final String PDF_FILENAME_EXTENSION = "pdf";
public static final String PDF_MIMETYPE_STRING = "application/pdf"; // public for demodataprovider
public static final String EXCEL_FILENAME_EXTENSION = "xls";
Expand Down Expand Up @@ -665,8 +665,10 @@ public static String getInVOClassNameFromEntityName(String entityName) {
}

public static ScriptEngine getJsEngine() {
ScriptEngineManager manager = new ScriptEngineManager();
return manager.getEngineByName(JAVASCRIPT_ENGINE_NAME);
//ScriptEngineManager manager = new ScriptEngineManager();
//return manager.getEngineByName(JAVASCRIPT_ENGINE_NAME);
NashornScriptEngineFactory factory = new NashornScriptEngineFactory();
return factory.getScriptEngine();
}

public static Password getLastPassword() {
Expand Down

0 comments on commit 2a4517d

Please sign in to comment.