Skip to content

Commit

Permalink
Upgrade to jexl 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
chbloemer committed Oct 11, 2023
1 parent 8ddf3a9 commit 45074f0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-jexl3</artifactId>
<version>3.2.1</version>
<version>3.3</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import de.neuland.pug4j.exceptions.ExpressionException;
import de.neuland.pug4j.model.PugModel;
import org.apache.commons.jexl3.introspection.JexlPermissions;
import org.apache.commons.jexl3.introspection.JexlUberspect;
import org.apache.commons.logging.LogFactory;

Expand Down Expand Up @@ -34,7 +35,8 @@ public class JexlExpressionHandler extends AbstractExpressionHandler {
} else {
return op == null && obj instanceof Map ? JexlUberspect.MAP : JexlUberspect.POJO;
}
}
},
JexlPermissions.UNRESTRICTED
);

private final PugJexlArithmetic pugJexlArithmetic = new PugJexlArithmetic(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
package de.neuland.pug4j.jexl3.internal.introspection;

import org.apache.commons.jexl3.internal.introspection.Uberspect;
import org.apache.commons.jexl3.introspection.JexlPermissions;
import org.apache.commons.logging.Log;


public class PugUberspect extends Uberspect {
public PugUberspect(Log runtimeLogger, ResolverStrategy sty) {
super(runtimeLogger, sty);
}

public PugUberspect(final Log runtimeLogger, final ResolverStrategy sty, final JexlPermissions perms) {
super(runtimeLogger, sty, perms);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void testReturn() throws ExpressionException {

@Test
public void testInt() throws ExpressionException {
jexlExpressionHandler.evaluateExpression("var count = 5", pugModel);
jexlExpressionHandler.evaluateExpression("var count = 5; var count2 = 6;", pugModel);
int count = (int) pugModel.get("count");
assertEquals(5,count);

Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/compiler/exceptions/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
</head>
<body>
<h1>Pug Compiler Exception</h1>
<p id="detail">unable to evaluate [non.existing.query()] - JexlException de.neuland.pug4j.expression.JexlExpressionHandler.evaluateExpression@149 JEXL error : attempting to call method on null</p>
<p id="detail">unable to evaluate [non.existing.query()] - JexlException de.neuland.pug4j.expression.JexlExpressionHandler.evaluateExpression@153:1 JEXL error : attempting to call method on null</p>
<h2>In error.jade at line 9, column 0.</h2>
<div>
<pre><span class="line">5</span><span class="code"> body {</span></pre>
Expand Down

0 comments on commit 45074f0

Please sign in to comment.