ammachado commented on code in PR #24122:
URL: https://github.com/apache/camel/pull/24122#discussion_r3447770296
##########
core/camel-core-languages/src/main/java/org/apache/camel/language/simple/ast/SimpleFunctionExpression.java:
##########
@@ -97,6 +98,11 @@ private Expression createSimpleExpression(CamelContext
camelContext, String func
return exp;
}
+ // Prefix that separates function-level cache entries from the top-level
expression cache entries
+ // written by SimpleLanguage (which uses "@SIMPLE@" + fullExpression). The
two keyspaces share the
+ // same LRUCache instance, so distinct prefixes are needed to prevent
accidental collisions.
+ private static final String FUNCTION_CACHE_KEY_PREFIX = "@FUNC@";
Review Comment:
Confirmed. Expression-level keys are always written with the `@SIMPLE@`
prefix (`SimpleLanguage` lines 117/179/203, since CAMEL-17073) and
function-level keys are raw, so the two keyspaces in the shared cache are
already disjoint. A raw function name can never equal `@SIMPLE@${...}`, so the
`@FUNC@` prefix is redundant. Closing the PR.
_Claude Code on behalf of Adriano Machado_
--
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]