mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 20:15:09 +00:00
After spending 3 hours chasing down a NullPointerException inside the native method that handles method.invoke...
figured out that I accidentally added a second transform() method and that one was being found, and that somehow causes the problem. The locating of the right transform method now also checks params. A 'method not found' is faaaaaaaaaaaaaaar easier to debug than picking the wrong one out of the lineup.
This commit is contained in:
1 parent
7d24f9c9a5
commit
40e35d6f79
1 file changed
+5
@@ -86,7 +86,12 @@ public class ClassLoaderWorkaround {
|
||||
Class<?> c = loader.loadClass("lombok.eclipse.TransformEclipseAST");
|
||||
for ( Method m : c.getMethods() ) {
|
||||
if ( m.getName().equals("transform") ) {
|
||||
Class<?>[] types = m.getParameterTypes();
|
||||
if ( types.length != 2 ) continue;
|
||||
if ( !types[0].getName().equals("org.eclipse.jdt.internal.compiler.parser.Parser") ) continue;
|
||||
if ( !types[1].getName().equals("org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration") ) continue;
|
||||
transform = m;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch ( ClassNotFoundException ignore ) {}
|
||||
|
||||
Reference in new issue
Block a user