Skip to content

Commit

Permalink
JEXL: winter cleaning;
Browse files Browse the repository at this point in the history
- restoring CI build
  • Loading branch information
henrib committed Dec 22, 2021
1 parent bbcb06e commit eb41da0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
8 changes: 4 additions & 4 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ Its goal is to expose scripting features usable by technical operatives or consu
https://commons.apache.org/jexl/

========================================================================================================================
Release 3.2.2
Release 3.3
========================================================================================================================

Version 3.2.2 is a maintenance release.
Version 3.3 is a minor release.

Compatibility with previous releases
====================================
Version 3.2.2 is source and binary compatible with 3.2.
Version 3.3 is source and binary compatible with 3.2.

Bugs Fixed in 3.2.1:
Bugs Fixed in 3.3:
==================
* JEXL-354: #pragma does not handle negative integer or real literals
* JEXL-353: Documentation error for not-in/not-match operator
Expand Down
5 changes: 4 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
</dependencies>

<build>
<defaultGoal>clean package apache-rat:check spotbugs:check japicmp:check checkstyle:check javadoc:javadoc</defaultGoal>
<defaultGoal>clean package apache-rat:check spotbugs:check japicmp:cmp checkstyle:check javadoc:javadoc </defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -243,6 +243,9 @@
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${commons.spotbugs.version}</version>
<configuration>
<effort>Max</effort>
<threshold>High</threshold>
<xmlOutput>true</xmlOutput>
<excludeFilterFile>${basedir}/src/main/config/findbugs-exclude-filter.xml</excludeFilterFile>
</configuration>
</plugin>
Expand Down
2 changes: 1 addition & 1 deletion src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<author email="dev@commons.apache.org">Commons Developers</author>
</properties>
<body>
<release version="3.2.1">
<release version="3.2.1" date="2021-06-25">
<action dev="henrib" type="fix" issue="JEXL-352" due-to="Øyvind Horneland">
Possible memory leak regarding parser jjtree nodes in JEXL 3.2
</action>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ public JexlPropertyGet getPropertyGet(final Object obj, final Object identifier)
return getPropertyGet(null, obj, identifier);
}

/**
* Identity equality.
* <p>Spotbugs just <em>hates</em> string identity...</p>
* @param lhs left hand side
* @param rhs right hand side
* @return true if left is identical to right
*/
private static boolean eq(Object lhs, Object rhs) {
return lhs == rhs;
}

@Override
public JexlPropertyGet getPropertyGet(final List<PropertyResolver> resolvers,
final Object obj,
Expand All @@ -113,7 +124,7 @@ public JexlPropertyGet getPropertyGet(final List<PropertyResolver> resolvers,
final String actual = sandbox.read(obj.getClass(), property);
if (actual != null) {
// no transformation, strict equality: use identifier before string conversion
final Object pty = actual == property ? identifier : actual;
final Object pty = eq(actual, property) ? identifier : actual;
return uberspect.getPropertyGet(resolvers, obj, pty);
}
} else {
Expand Down Expand Up @@ -142,7 +153,7 @@ public JexlPropertySet getPropertySet(final List<PropertyResolver> resolvers,
final String actual = sandbox.write(obj.getClass(), property);
if (actual != null) {
// no transformation, strict equality: use identifier before string conversion
final Object pty = actual == property ? identifier : actual;
final Object pty = eq(actual, property) ? identifier : actual;
return uberspect.getPropertySet(resolvers, obj, pty, arg);
}
} else {
Expand Down

0 comments on commit eb41da0

Please sign in to comment.