Community
Participate
Working Groups
I just updated my AJDT/AspectJ installation to the latest today to the 1.3.0.20051128065742 version. When I openend some sample projects and then headed for the "Problems" view, I got the following NullPointerException error. After cleaning my AspectJ projects, I got the same error while building them again. Currently the error appears on some other big project that has been included via a linked folder. Error 2005-11-28 17:03:19.531 NullPointerException thrown: null java.lang.NullPointerException at org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemReporter.missingDeprecatedAnnotationForMethod(ProblemReporter.java:3933) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesFor(SourceTypeBinding.java:1271) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.methods(SourceTypeBinding.java:1081) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.getMethodsBase(SourceTypeBinding.java:912) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.getMethods(SourceTypeBinding.java:900) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod(Scope.java:1060) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:333) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:829) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.Block.resolveUsing(Block.java:115) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.TryStatement.resolve(TryStatement.java:504) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.Block.resolve(Block.java:101) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.IfStatement.resolve(IfStatement.java:225) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:422) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:178) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:400) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1088) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1137) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:305) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:514) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:329) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:809) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:230) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:156) at org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAdapter.java:122) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191) eclipse.buildId=I20050627-1435 java.version=1.5.0_04 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=fr_FR Command-line arguments: -os win32 -ws win32 -arch x86
I got exactly the same problem when trying to directly build the big project itself with the AspectJ nature (that is, with the AspectJ compiler instead of the Java compiler). I believe the problem is related to some OutOfMemoryError about the Java heap space. Currently the project compiles without any error if Eclipse is launched with a *really* big Java heap space: 500MB heap space isn't enough, I succeeded to compile the project with more than 700MB heap space. Notice that the error still happen if I try to build the big project as a linked folder; when the error is thrown the Java heap space is used at about 150MB/170MB with still the 700MB maximum heap space.
It is crashing trying to report a problem. I don't think it's related to running out of memory in this case. The error is not one I've encountered before: "missingDeprecatedAnnotationForMethod" and we crash here MethodBinding binding = method.binding; presumably as the method passed in is null. The message means a deprecated method has been found without the @Deprecated annotation on it... looking at the code that makes the call to report the deprecation problem, and the code a little further down that method - I wonder if its a compiler bug. The code a little further down allows for a null method but the call to the error reporting code does not.
In the latest version of the compiler and AJDT, I have put in a guard that prevents this NPE from occurring. It *may* just cause a different manifestation of the problem though, later in the compilers processing - can you give it a try? You need an AJDT from yesterday afternoon or today (basically the latest)
(In reply to comment #3) > In the latest version of the compiler and AJDT, I have put in a guard that > prevents this NPE from occurring. It *may* just cause a different > manifestation of the problem though, later in the compilers processing - can > you give it a try? You need an AJDT from yesterday afternoon or today > (basically the latest) I gave it a try and no problem occured. Furthermore deprecation markers appears and works flawlessly. The bug seems to be fixed, notive however that I hadn't tried extensively. JP
ok ... thanks for trying it out so swiftly! I'll close this for now - please reopen if you see a similar manifestation..