mirror of
https://github.com/jlengrand/error-prone-support.git
synced 2026-03-10 08:11:25 +00:00
Fix build-time Refaster template loading (#121)
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.
This commit is contained in:
committed by
GitHub
parent
c500516bb4
commit
bf5199ea3d
@@ -195,7 +195,7 @@ public final class RefasterCheck extends BugChecker implements CompilationUnitTr
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user