Skip to content

Commit

Permalink
fix OpenFeign#853 - repair classloader for spring
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkrzywanski authored and velo committed Feb 7, 2025
1 parent 3934d0e commit c2c3c0b
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.*;
import javax.tools.JavaCompiler;
import javax.tools.SimpleJavaFileObject;
import javax.tools.StandardLocation;
Expand Down Expand Up @@ -50,7 +47,8 @@ public JDKEvaluatorFactory(ClassLoader parent, JavaCompiler compiler) {
this.fileManager =
new MemFileManager(parent, compiler.getStandardFileManager(null, null, null));
this.compiler = compiler;
this.classpath = SimpleCompiler.getClassPath(parent);
this.classpath = Optional.of(SimpleCompiler.getClassPath(parent)).filter(s -> !s.isEmpty())
.orElseGet(() -> SimpleCompiler.getClassPath(compiler.getClass().getClassLoader()));
this.loader = fileManager.getClassLoader(StandardLocation.CLASS_OUTPUT);
this.compilationOptions = Arrays.asList("-classpath", classpath, "-g:none");
}
Expand Down

0 comments on commit c2c3c0b

Please sign in to comment.