Skip to content

Commit

Permalink
[JENKINS-60619] Java 11 compatibility (#31)
Browse files Browse the repository at this point in the history
* update .gitignore for eclipse

* Use net.sf.json parser and remove Boon

* functional version on JDK11
  • Loading branch information
mat1e authored Feb 22, 2020
1 parent 7dc6105 commit 1b0d737
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.settings/*
.idea/*
*.iml
/target/
/work/
/.classpath
/.project
5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@
<artifactId>script-security</artifactId>
<version>1.19</version>
</dependency>
<dependency>
<groupId>io.fastjson</groupId>
<artifactId>boon</artifactId>
<version>0.34</version>
</dependency>
</dependencies>

<repositories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,6 @@ private String executeGroovyScriptAndProcessGroovyValue(String groovyScript, Str

private Object executeGroovyScript(String groovyScript, String bindings, String groovyClasspath) throws URISyntaxException, IOException {
Object groovyValue = null;

if(checkScriptApproval(groovyScript, groovyClasspath, false)) {
GroovyShell groovyShell = getGroovyShell(groovyClasspath);
GroovyCodeSource codeSource = new GroovyCodeSource(groovyScript, computeMD5Hash(groovyScript), "/groovy/shell");
Expand Down Expand Up @@ -1459,7 +1458,7 @@ else if(!StringUtils.isBlank(javascriptFile)) {
}

public Object getJSONEditorOptions() {
Object result = null;
Object result = null;
try {
String script = null;
if(!StringUtils.isBlank(groovyScript)) {
Expand All @@ -1468,7 +1467,6 @@ public Object getJSONEditorOptions() {
else {
script = Util.loadFile(new File(expandVariables(groovyScriptFile)));
}

result = executeGroovyScript(script, bindings, groovyClasspath);
}
catch(IOException | URISyntaxException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<j:set var="theme" value="${jsonEditorOptions.get('theme')}"/>
<j:set var="iconlib" value="${jsonEditorOptions.get('iconlib')}"/>

<j:invokeStatic var="jsonEditorOptionsJSON" className="org.boon.Boon" method="toJson">
<j:invokeStatic var="jsonEditorOptionsJSON" className="groovy.json.JsonOutput" method="toJson">
<j:arg value="${jsonEditorOptions}" type="java.lang.Object" />
</j:invokeStatic>

<j:set var="jsonEditorScript" value="${it.getJSONEditorScript()}"/>

<script>
Expand Down Expand Up @@ -60,7 +60,7 @@
</j:if>

<j:if test="${not empty jsonEditorScript}">
(function(editor, valueInput) {
(function(editor, valueInput) {
<j:out value="${jsonEditorScript}"/>
})(editor_${normalizedParameterName}, document.getElementById("editor_${it.name}_value"));
</j:if>
Expand Down

0 comments on commit 1b0d737

Please sign in to comment.