diff options
author | Reinier Zwitserloot <reinier@tipit.to> | 2009-06-12 08:38:24 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@tipit.to> | 2009-06-12 08:38:24 +0200 |
commit | 40e35d6f79f456fb868c95d764f5d0c9869ea6e4 (patch) | |
tree | 760a3ccafd532eb341c59efdea81a1f6d1d8b66a /src_eclipseagent/java/lombok | |
parent | 7d24f9c9a52861ced99f419edb07533f9b99a7ed (diff) | |
download | lombok-40e35d6f79f456fb868c95d764f5d0c9869ea6e4.tar.gz lombok-40e35d6f79f456fb868c95d764f5d0c9869ea6e4.tar.bz2 lombok-40e35d6f79f456fb868c95d764f5d0c9869ea6e4.zip |
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.
Diffstat (limited to 'src_eclipseagent/java/lombok')
-rw-r--r-- | src_eclipseagent/java/lombok/ClassLoaderWorkaround.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src_eclipseagent/java/lombok/ClassLoaderWorkaround.java b/src_eclipseagent/java/lombok/ClassLoaderWorkaround.java index a3fc1521..4c851a0e 100644 --- a/src_eclipseagent/java/lombok/ClassLoaderWorkaround.java +++ b/src_eclipseagent/java/lombok/ClassLoaderWorkaround.java @@ -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 ) {} |