@@ -45,7 +45,7 @@ class MyJavaFileManager implements JavaFileManager {
4545 private static final long OVERRIDE_OFFSET ;
4646
4747 static {
48- long offset = 0 ;
48+ long offset ;
4949 try {
5050 Field theUnsafe = Unsafe .class .getDeclaredField ("theUnsafe" );
5151 theUnsafe .setAccessible (true );
@@ -83,7 +83,7 @@ public ClassLoader getClassLoader(Location location) {
8383 return fileManager .getClassLoader (location );
8484 }
8585
86- public Iterable <JavaFileObject > list (Location location , String packageName , Set <Kind > kinds , boolean recurse ) throws IOException {
86+ public synchronized Iterable <JavaFileObject > list (Location location , String packageName , Set <Kind > kinds , boolean recurse ) throws IOException {
8787 return fileManager .list (location , packageName , kinds , recurse );
8888 }
8989
@@ -106,7 +106,7 @@ public boolean hasLocation(Location location) {
106106 public JavaFileObject getJavaFileForInput (Location location , String className , Kind kind ) throws IOException {
107107
108108 if (location == StandardLocation .CLASS_OUTPUT ) {
109- boolean success = false ;
109+ boolean success ;
110110 final byte [] bytes ;
111111 synchronized (buffers ) {
112112 success = buffers .containsKey (className ) && kind == Kind .CLASS ;
@@ -212,7 +212,7 @@ private <T> T invokeNamedMethodIfAvailable(final Location location, final String
212212 unsafe .putBoolean (method , OVERRIDE_OFFSET , true );
213213 return (T ) method .invoke (fileManager , location );
214214 } catch (IllegalAccessException | InvocationTargetException e ) {
215- throw new UnsupportedOperationException ("Unable to invoke method " + name );
215+ throw new UnsupportedOperationException ("Unable to invoke method " + name , e );
216216 }
217217 }
218218 }
0 commit comments