You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "henrib (via GitHub)" <gi...@apache.org> on 2026/02/13 11:48:46 UTC
[PR] JEXL-456: fixing side effects from parsing errors [commons-jexl]
henrib opened a new pull request, #398:
URL: https://github.com/apache/commons-jexl/pull/398
perform cleanup in parent parser if child parser emits a parsing exception;
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] JEXL-456: fixing side effects from parsing errors [commons-jexl]
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #398:
URL: https://github.com/apache/commons-jexl/pull/398#issuecomment-3897140935
The Jira ticket is https://issues.apache.org/jira/browse/JEXL-456
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] JEXL-456: fixing side effects from parsing errors [commons-jexl]
Posted by "henrib (via GitHub)" <gi...@apache.org>.
henrib commented on code in PR #398:
URL: https://github.com/apache/commons-jexl/pull/398#discussion_r2807779022
##########
src/main/java/org/apache/commons/jexl3/parser/Parser.jjt:
##########
@@ -288,27 +297,36 @@ TOKEN_MGR_DECLS : {
{
< IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>|<ESCAPE>)* >
{
- matchedToken.image = StringParser.unescapeIdentifier(matchedToken.image);
- final int length = matchedToken.image.length();
- if (comparatorNames && length == 2) {
- switch (matchedToken.image) {
- case "ne" : matchedToken.kind = NE; break;
- case "eq" : matchedToken.kind = EQ; break;
- case "lt" : matchedToken.kind = LT; break;
- case "le" : matchedToken.kind = LE; break;
- case "gt" : matchedToken.kind = GT; break;
- case "ge" : matchedToken.kind = GE; break;
- }
- } else if (jexl331 && length >= 3 && length <= 10) {
- switch (matchedToken.image) {
- case "try" : matchedToken.kind = TRY; break;
- case "catch" : matchedToken.kind = CATCH; break;
- case "finally" : matchedToken.kind = FINALLY; break;
- case "throw" : matchedToken.kind = THROW; break;
- case "instanceof": matchedToken.kind = ISA; break;
- case "!instanceof": matchedToken.kind = NISA; break;
- }
- }
+ matchedToken.image = StringParser.unescapeIdentifier(matchedToken.image);
+ final int length = matchedToken.image.length();
+ if (ignoredTokens.contains(matchedToken.image)) {
+ // ignore by getting next token instead
+ Token n = getNextToken();
+ matchedToken.kind = n.kind;
+ matchedToken.image = n.image;
+ matchedToken.beginLine = n.beginLine;
+ matchedToken.endLine = n.endLine;
+ matchedToken.beginColumn = n.beginColumn;
+ matchedToken.endColumn = n.endColumn;
Review Comment:
The feature is already a 'Hail Mary' ; it is meant to ease migration for templates that exploited a bug where the template prefix is on a new line (eventually after whitespaces). Its robustness is not the primary concern.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] JEXL-456: fixing side effects from parsing errors [commons-jexl]
Posted by "henrib (via GitHub)" <gi...@apache.org>.
henrib commented on code in PR #398:
URL: https://github.com/apache/commons-jexl/pull/398#discussion_r2807893801
##########
src/main/java/org/apache/commons/jexl3/parser/JexlParser.java:
##########
@@ -144,6 +144,23 @@ protected static Token errorToken(final Token... tokens) {
return null;
}
+ static Token assignToken(Token src, Token dest) {
+ if (dest == null) {
+ return src;
+ }
+ if (src != null) {
+ dest.beginLine = src.beginLine;
+ dest.beginColumn = src.beginColumn;
+ dest.endLine = src.endLine;
+ dest.endColumn = src.endColumn;
+ dest.image = src.image;
+ dest.kind = src.kind;
+ dest.next = src.next;
+ dest.specialToken = src.specialToken;
+ }
+ return dest;
+ }
Review Comment:
Will do.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] JEXL-456: fixing side effects from parsing errors [commons-jexl]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #398:
URL: https://github.com/apache/commons-jexl/pull/398#discussion_r2807733955
##########
src/main/java/org/apache/commons/jexl3/internal/TemplateInfo.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.jexl3.internal;
+
+import java.util.Set;
+
+import org.apache.commons.jexl3.JexlInfo;
+
+/**
+ * A JexlInfo that also carries the set of tokens that should be ignored during parsing,
+ * most notably the prefix for templates.
+ */
+public class TemplateInfo extends JexlInfo {
+ private final Set<String> ignoredTokens;
+
+ public TemplateInfo(JexlInfo info, Set<String> ignoredTokens) {
+ super(info);
+ this.ignoredTokens = ignoredTokens;
+ }
Review Comment:
Consider adding a null check or Objects.requireNonNull for the ignoredTokens parameter to prevent potential NullPointerExceptions and document the contract clearly. While the current usage with Collections.singleton ensures it's never null in practice, defensive programming would make the API more robust against future misuse.
##########
src/main/java/org/apache/commons/jexl3/internal/TemplateInfo.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.jexl3.internal;
+
+import java.util.Set;
+
+import org.apache.commons.jexl3.JexlInfo;
+
+/**
+ * A JexlInfo that also carries the set of tokens that should be ignored during parsing,
+ * most notably the prefix for templates.
+ */
+public class TemplateInfo extends JexlInfo {
+ private final Set<String> ignoredTokens;
+
+ public TemplateInfo(JexlInfo info, Set<String> ignoredTokens) {
+ super(info);
+ this.ignoredTokens = ignoredTokens;
+ }
+
+ public Set<String> getIgnoredTokens() {
+ return ignoredTokens;
+ }
Review Comment:
The TemplateInfo class should override the `at(int l, int c)` method to return a TemplateInfo instance instead of a JexlInfo instance. Without this override, calling `at()` on a TemplateInfo will return a plain JexlInfo, losing the ignoredTokens information. This could cause the token ignoring feature to fail when creating new info instances with different line/column numbers.
```suggestion
}
@Override
public TemplateInfo at(final int l, final int c) {
JexlInfo info = super.at(l, c);
return new TemplateInfo(info, ignoredTokens);
}
```
##########
src/main/java/org/apache/commons/jexl3/parser/Parser.jjt:
##########
@@ -288,27 +297,36 @@ TOKEN_MGR_DECLS : {
{
< IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>|<ESCAPE>)* >
{
- matchedToken.image = StringParser.unescapeIdentifier(matchedToken.image);
- final int length = matchedToken.image.length();
- if (comparatorNames && length == 2) {
- switch (matchedToken.image) {
- case "ne" : matchedToken.kind = NE; break;
- case "eq" : matchedToken.kind = EQ; break;
- case "lt" : matchedToken.kind = LT; break;
- case "le" : matchedToken.kind = LE; break;
- case "gt" : matchedToken.kind = GT; break;
- case "ge" : matchedToken.kind = GE; break;
- }
- } else if (jexl331 && length >= 3 && length <= 10) {
- switch (matchedToken.image) {
- case "try" : matchedToken.kind = TRY; break;
- case "catch" : matchedToken.kind = CATCH; break;
- case "finally" : matchedToken.kind = FINALLY; break;
- case "throw" : matchedToken.kind = THROW; break;
- case "instanceof": matchedToken.kind = ISA; break;
- case "!instanceof": matchedToken.kind = NISA; break;
- }
- }
+ matchedToken.image = StringParser.unescapeIdentifier(matchedToken.image);
+ final int length = matchedToken.image.length();
+ if (ignoredTokens.contains(matchedToken.image)) {
+ // ignore by getting next token instead
+ Token n = getNextToken();
+ matchedToken.kind = n.kind;
+ matchedToken.image = n.image;
+ matchedToken.beginLine = n.beginLine;
+ matchedToken.endLine = n.endLine;
+ matchedToken.beginColumn = n.beginColumn;
+ matchedToken.endColumn = n.endColumn;
Review Comment:
The token ignoring mechanism appears fragile: calling getNextToken() within a token action and copying fields to matchedToken works for the current use case but could cause issues in edge cases. Specifically: (1) If consecutive ignored tokens appear, only the first would be skipped. (2) The token 'next' field is not updated, which might affect lookahead operations. (3) This approach is tightly coupled to the specific token stream state. Consider documenting these limitations, or refactoring to use a more robust token filtering mechanism that handles these edge cases explicitly.
```suggestion
// ignore by getting next non-ignored token instead
Token n = getNextToken();
// Skip consecutive ignored identifier tokens
while (n.kind == IDENTIFIER) {
final String unescaped = StringParser.unescapeIdentifier(n.image);
if (!ignoredTokens.contains(unescaped)) {
break;
}
n = getNextToken();
}
matchedToken.kind = n.kind;
matchedToken.image = n.image;
matchedToken.beginLine = n.beginLine;
matchedToken.endLine = n.endLine;
matchedToken.beginColumn = n.beginColumn;
matchedToken.endColumn = n.endColumn;
matchedToken.next = n.next;
```
##########
src/main/java/org/apache/commons/jexl3/JexlFeatures.java:
##########
@@ -496,11 +499,32 @@ public Set<String> getReservedNames() {
@Override
public int hashCode() { //CSOFF: MagicNumber
int hash = 3;
- hash = 53 * hash + (int) (this.flags ^ this.flags >>> 32);
+ hash = 53 * hash + Long.hashCode(this.flags);
hash = 53 * hash + (this.reservedNames != null ? this.reservedNames.hashCode() : 0);
return hash;
}
+ /**
+ * Sets whether to ignore template prefixes in template expressions.
+ * <p>Note that this precludes using a variable whose name is the template prefix (ie default $$)</p>
Review Comment:
The documentation for the ignoreTemplatePrefix feature mentions that it "precludes using a variable whose name is the template prefix (ie default $$)", but this should clarify that it only precludes variables with exactly that name. For instance, if the prefix is "$$", then variables like "$", "$a", or "$$$" would still be usable - only the exact prefix "$$" would be ignored.
```suggestion
* <p>Note that this only precludes using a variable whose name is exactly the template prefix
* (for example, with the default prefix "$$", a variable named "$$" is ignored, but "$", "$a", or "$$$"
* are still valid variable names).</p>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] JEXL-456: fixing side effects from parsing errors [commons-jexl]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #398:
URL: https://github.com/apache/commons-jexl/pull/398#discussion_r2807785814
##########
src/main/java/org/apache/commons/jexl3/parser/JexlParser.java:
##########
@@ -144,6 +144,23 @@ protected static Token errorToken(final Token... tokens) {
return null;
}
+ static Token assignToken(Token src, Token dest) {
+ if (dest == null) {
+ return src;
+ }
+ if (src != null) {
+ dest.beginLine = src.beginLine;
+ dest.beginColumn = src.beginColumn;
+ dest.endLine = src.endLine;
+ dest.endColumn = src.endColumn;
+ dest.image = src.image;
+ dest.kind = src.kind;
+ dest.next = src.next;
+ dest.specialToken = src.specialToken;
+ }
+ return dest;
+ }
Review Comment:
`assignToken` is newly introduced and is used by the generated token manager, but it doesn't follow the prevailing style in this class (most parameters are declared `final`). Consider making the parameters `final` (and optionally adding a brief javadoc) to keep the helper consistent with the rest of `JexlParser` utilities.
##########
src/main/java/org/apache/commons/jexl3/JexlFeatures.java:
##########
@@ -157,6 +157,9 @@ public final class JexlFeatures {
/** Ambiguous or strict statement allowed. */
public static final int AMBIGUOUS_STATEMENT = 25;
+ /** Ignore template prefix. */
+ public static final int IGNORE_TEMPLATE_PREFIX = 26;
+
Review Comment:
`JexlFeatures` adds the `IGNORE_TEMPLATE_PREFIX` feature (ordinal 26) but `F_NAMES` is not extended accordingly. As a result, `JexlFeatures.stringify(IGNORE_TEMPLATE_PREFIX)` (and any error/reporting paths that rely on it) will return "unsupported feature" instead of a meaningful name. Add a new entry to `F_NAMES` at index 26 to keep feature metadata consistent.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] JEXL-456: fixing side effects from parsing errors [commons-jexl]
Posted by "henrib (via GitHub)" <gi...@apache.org>.
henrib commented on code in PR #398:
URL: https://github.com/apache/commons-jexl/pull/398#discussion_r2807774638
##########
src/main/java/org/apache/commons/jexl3/internal/TemplateInfo.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.jexl3.internal;
+
+import java.util.Set;
+
+import org.apache.commons.jexl3.JexlInfo;
+
+/**
+ * A JexlInfo that also carries the set of tokens that should be ignored during parsing,
+ * most notably the prefix for templates.
+ */
+public class TemplateInfo extends JexlInfo {
+ private final Set<String> ignoredTokens;
+
+ public TemplateInfo(JexlInfo info, Set<String> ignoredTokens) {
+ super(info);
+ this.ignoredTokens = ignoredTokens;
+ }
+
+ public Set<String> getIgnoredTokens() {
+ return ignoredTokens;
+ }
Review Comment:
We dont need TemplateInfo after we got access to the ignored tokens; it is really meant as a transient way to pass parameters to parsing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] JEXL-456: fixing side effects from parsing errors [commons-jexl]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #398:
URL: https://github.com/apache/commons-jexl/pull/398#discussion_r2807907948
##########
src/main/java/org/apache/commons/jexl3/internal/TemplateInfo.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.jexl3.internal;
+
+import java.util.Set;
+
+import org.apache.commons.jexl3.JexlInfo;
+
+/**
+ * A JexlInfo that also carries the set of tokens that should be ignored during parsing,
+ * most notably the prefix for templates.
+ */
+public class TemplateInfo extends JexlInfo {
+ private final Set<String> ignoredTokens;
+
+ public TemplateInfo(JexlInfo info, Set<String> ignoredTokens) {
Review Comment:
Constructor parameters should be declared as `final` to be consistent with the codebase convention. For example, JexlInfo constructor at line 120 uses `final String source`, and Scope constructor at internal/Scope.java:95 uses `final Scope scope`. The parameters `info` and `ignoredTokens` should be declared as `final JexlInfo info` and `final Set<String> ignoredTokens`.
```suggestion
public TemplateInfo(final JexlInfo info, final Set<String> ignoredTokens) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] JEXL-456: fixing side effects from parsing errors [commons-jexl]
Posted by "henrib (via GitHub)" <gi...@apache.org>.
henrib commented on code in PR #398:
URL: https://github.com/apache/commons-jexl/pull/398#discussion_r2807893477
##########
src/main/java/org/apache/commons/jexl3/JexlFeatures.java:
##########
@@ -157,6 +157,9 @@ public final class JexlFeatures {
/** Ambiguous or strict statement allowed. */
public static final int AMBIGUOUS_STATEMENT = 25;
+ /** Ignore template prefix. */
+ public static final int IGNORE_TEMPLATE_PREFIX = 26;
+
Review Comment:
Will do.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] JEXL-456: fixing side effects from parsing errors [commons-jexl]
Posted by "henrib (via GitHub)" <gi...@apache.org>.
henrib commented on code in PR #398:
URL: https://github.com/apache/commons-jexl/pull/398#discussion_r2807781095
##########
src/main/java/org/apache/commons/jexl3/internal/TemplateInfo.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.jexl3.internal;
+
+import java.util.Set;
+
+import org.apache.commons.jexl3.JexlInfo;
+
+/**
+ * A JexlInfo that also carries the set of tokens that should be ignored during parsing,
+ * most notably the prefix for templates.
+ */
+public class TemplateInfo extends JexlInfo {
+ private final Set<String> ignoredTokens;
+
+ public TemplateInfo(JexlInfo info, Set<String> ignoredTokens) {
+ super(info);
+ this.ignoredTokens = ignoredTokens;
+ }
Review Comment:
Just a parameter kind of class; the robustness is in its consumer that shall take appropriate actions if present a null set.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] JEXL-456: fixing side effects from parsing errors [commons-jexl]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #398:
URL: https://github.com/apache/commons-jexl/pull/398#discussion_r2803834968
##########
src/test/java/org/apache/commons/jexl3/Issues400Test.java:
##########
@@ -1067,5 +1067,80 @@ void testIssue455h() {
Assertions.assertEquals("World Hello World ! ~", writer.toString());
}
+ @Test
+ void testIssue350_456_strict() {
+ final JexlEngine jexl = new JexlBuilder().strict(true).create();
+ final JxltEngine jxlt = jexl.createJxltEngine();
+ // creation/parse is OK
+ final JxltEngine.Template template = jxlt.createTemplate("$$ var foo = 'foo';\n$$ var bar = 'bar';\n${foo + bar}");
+ final StringWriter writer = new StringWriter();
+ template.evaluate(null, writer);
+ Assertions.assertEquals("foobar", writer.toString());
Review Comment:
Inconsistent indentation detected. Lines 1077-1078 should be indented at the same level as line 1076 (the previous line with StringWriter declaration). The current extra indentation appears to be unintentional.
```suggestion
template.evaluate(null, writer);
Assertions.assertEquals("foobar", writer.toString());
```
##########
src/main/java/org/apache/commons/jexl3/parser/JexlParser.java:
##########
@@ -961,7 +961,13 @@ protected void jjtreeCloseNodeScope(final JexlNode node) {
*/
@Override
public ASTJexlScript jxltParse(final JexlInfo info, final JexlFeatures features, final String src, final Scope scope) {
- return new Parser(this).parse(info, features, src, scope);
+ JexlFeatures previous = getFeatures();
+ try {
+ return new Parser(this).parse(info, features, src, scope);
+ } catch (JexlException.Parsing ex) {
Review Comment:
The catch block only catches JexlException.Parsing, but the child parser can also throw JexlException.Tokenization (from TokenMgrException) or other JexlException subtypes. Consider catching JexlException (the parent class) instead to ensure cleanup happens for all parsing-related exceptions, not just parsing syntax errors. This would make the error handling more robust and consistent with the finally block in Parser.parse which cleans up regardless of exception type.
```suggestion
} catch (JexlException ex) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] JEXL-456: fixing side effects from parsing errors [commons-jexl]
Posted by "henrib (via GitHub)" <gi...@apache.org>.
henrib merged PR #398:
URL: https://github.com/apache/commons-jexl/pull/398
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org