davsclaus commented on code in PR #26753:
URL: https://github.com/apache/camel/pull/26753#discussion_r4076573298
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/ExpressionEvaluator.java:
##########
@@ -113,16 +119,54 @@ private static void evaluateInProcess(
}
private static void evaluateLocally(
- String lang, String expression, String body, boolean predicate,
JsonObject result) {
+ ToolContext ctx, String lang, String expression, String body,
boolean predicate, JsonObject result) {
+ ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+ try {
+ String gav = languageArtifact(ctx, lang);
+ // the languages of this process (simple, constant, header, ...)
need no class loader of their own
+ ClassLoader known = gav != null ? DOWNLOADED.get(gav) : null;
+ if (evaluateWith(known, lang, expression, body, predicate,
result)) {
+ syntaxCheck(ctx, known, lang, expression, predicate, result);
+ return;
Review Comment:
Fixed as suggested: the cached path reports `downloaded` too, so two
identical evaluations answer the same.
--
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]