Community
Participate
Working Groups
When compiling a class like public class X { private test(){} } the following NPE gets thrown: java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AsmHierarchyBuilder.visit (AsmHierarchyBuilder.java:326) at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.traverse (MethodDeclaration.java:144) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse (TypeDeclaration.java:1034) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.traverse (CompilationUnitDeclaration.java:305) at org.aspectj.ajdt.internal.core.builder.AsmHierarchyBuilder.internalBuild (AsmHierarchyBuilder.java:122) at org.aspectj.ajdt.internal.core.builder.AsmHierarchyBuilder.build (AsmHierarchyBuilder.java:46) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.finishedCompilationUni t(EclipseFactory.java:308) at org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.afterProcessing (AjCompilerAdapter.java:134) at org.eclipse.jdt.internal.compiler.Compiler.compile (Compiler.java:372) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation (AjBuildManager.java:717) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild (AjBuildManager.java:170) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild (AjBuildManager.java:100) at org.aspectj.ajde.internal.CompilerAdapter.compile (CompilerAdapter.java:108) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run (AspectJBuildManager.java:169) I guess a simple null check will fix this bug.
Luzius: as you indicate this fix will be straight forward. But for any bug of this sort we should make sure to add at lease a unit test. I'll fix this in my round of ASM updates and am reassigning to me.
I've just fixed this in my branch of AspectJ on which 1.1.11 is based. It was due to the new support we have in 1.1.11 that gets the icons right for intertype declarations (i.e. which are public/private/etc). I will, when this book dies down, integrate my changes back into the AJ base (with tests).
OK, assigning back to you then. I didn't realize that AspectJ had been branched--how many changes are there in that branch? This worries me since I'm making some ASM updates, including to the class affected by this report, and want to avoid merge problems.
fixed in ajde - merges back into aspectj due soon.