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:
Reinier Zwitserloot committed 2009-06-12 08:38:24 +02:00
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 ) {}