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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]