Bug 118249 - NullPointerException internal compiler error while reporting deprecation problem
Summary: NullPointerException internal compiler error while reporting deprecation problem
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.5.0RC1   Edit
Assignee: Andrew Clement CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-28 11:32 EST by Jean-Pierre Lambert CLA
Modified: 2005-12-07 06:42 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Pierre Lambert CLA 2005-11-28 11:32:59 EST
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
Comment 1 Jean-Pierre Lambert CLA 2005-11-29 10:51:03 EST
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.
Comment 2 Andrew Clement CLA 2005-11-29 12:39:18 EST
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.
Comment 3 Andrew Clement CLA 2005-12-07 05:21:02 EST
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)
Comment 4 Jean-Pierre Lambert CLA 2005-12-07 05:48:14 EST
(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
Comment 5 Andrew Clement CLA 2005-12-07 06:42:27 EST
ok ... thanks for trying it out so swiftly!  I'll close this for now - please reopen if you see a similar manifestation..