Skip to content

Commit

Permalink
Fix build-time Refaster template loading (#121)
Browse files Browse the repository at this point in the history
When using the system classloader, `RefasterCheckTest` is able to
successfully load the Refaster templates from the classpath, causing the
tests to pass. However, when during a build the Java compiler loads
`RefasterCheck`, the templates on the annotation processor classpath are
_not_ exposed through the system classloader.
  • Loading branch information
Stephan202 authored Jun 30, 2022
1 parent c500516 commit bf5199e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private static ImmutableListMultimap<String, CodeTransformer> loadAllCodeTransfo

private static ImmutableSet<ResourceInfo> getClassPathResources() {
try {
return ClassPath.from(ClassLoader.getSystemClassLoader()).getResources();
return ClassPath.from(RefasterCheck.class.getClassLoader()).getResources();
} catch (IOException e) {
throw new UncheckedIOException("Failed to scan classpath for resources", e);
}
Expand Down

0 comments on commit bf5199e

Please sign in to comment.