davsclaus commented on code in PR #26678:
URL: https://github.com/apache/camel/pull/26678#discussion_r4064138621


##########
components/camel-groovy/src/main/java/org/apache/camel/language/groovy/DefaultGroovyScriptCompiler.java:
##########
@@ -303,9 +309,12 @@ private Set<String> doPreloadClasses(Map<String, byte[]> 
classes) {
             try {
                 Class<?> clazz = groovyPreCompiledClassLoader.findClass(name);
                 classLoader.addClass(clazz.getName(), clazz);
+                postCompile(clazz, entry.getValue());
                 answer.add(name);
             } catch (ClassNotFoundException e) {
                 LOG.debug("Error loading pre-compiled class: {}. This 
exception is ignored.", name, e);
+            } catch (Exception e) {
+                throw RuntimeCamelException.wrapRuntimeException(e);

Review Comment:
   Minor: this rethrow leaves the loop before 
`IOHelper.close(groovyPreCompiledClassLoader)` below, so a post-processor 
failure on a pre-compiled class leaks the classloader. A `try/finally` around 
the loop (or closing before rethrowing) keeps the close on the error path. Low 
impact since startup fails anyway.



-- 
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]

Reply via email to