Bug 62624

Summary: MethodBinding.java:488 NPE in 1.2rc2
Product: [Tools] AspectJ Reporter: attila lendvai <101>
Component: CompilerAssignee: Adrian Colyer <adrian.colyer>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 1.2   
Target Milestone: 1.2.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description attila lendvai CLA 2004-05-18 07:38:13 EDT
[iajc] can't find: <missing>
   [iajc] can't find: <missing>
   [iajc] can't find: <missing>
   [iajc] D:
\work\granite\workspace\metadata-view\src\java\com\netvisor\metadata_view\Entity
ListScreen.java error Internal compiler
   [iajc] java.lang.NullPointerException
   [iajc]     at org.eclipse.jdt.internal.compiler.lookup.MethodBinding.
signature(MethodBinding.java:488)
   [iajc]     at org.eclipse.jdt.internal.compiler.codegen.ConstantPool.
literalIndex(ConstantPool.java:996)
   [iajc]     at org.eclipse.jdt.internal.compiler.codegen.CodeStream.
invokestatic(CodeStream.java:3191)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.MessageSend.
generateCode(MessageSend.java:98)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.SingleNameReference.
generateAssignment(SingleNameReference.java:220)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.Assignment.
generateCode(Assignment.java:74)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.Expression.
generateCode(Expression.java:224)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.Block.generateCode(Block.
java:58)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.IfStatement.
generateCode(IfStatement.java:197)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.
AbstractMethodDeclaration.generateCode(AbstractMethodDeclaration.java:218)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.
AbstractMethodDeclaration.generateCode(AbstractMethodDeclaration.java:164)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.
generateCode(TypeDeclaration.java:555)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.
generateCode(TypeDeclaration.java:619)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.
CompilationUnitDeclaration.generateCode(CompilationUnitDeclaration.java:176)
   [iajc]     at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.
java:557)
   [iajc]     at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.
java:358)
   [iajc]     at org.aspectj.ajdt.internal.core.builder.AjBuildManager.
performCompilation(AjBuildManager.java:601)
   [iajc]     at org.aspectj.ajdt.internal.core.builder.AjBuildManager.
doBuild(AjBuildManager.java:160)
   [iajc]     at org.aspectj.ajdt.internal.core.builder.AjBuildManager.
batchBuild(AjBuildManager.java:94)
   [iajc]     at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:
102)
   [iajc]     at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:
53)
   [iajc]     at org.aspectj.tools.ajc.Main.run(Main.java:280)
   [iajc]     at org.aspectj.tools.ajc.Main.runMain(Main.java:217)
   [iajc]     at org.aspectj.tools.ajc.Main.main(Main.java:79)

   [iajc] (no source information available)
   [iajc] ABORT
   [iajc]
   [iajc] Exception thrown from AspectJ 1.2rc2

   [iajc] This might be logged as a bug already -- find current bugs at
   [iajc]   http://bugs.eclipse.org/bugs/buglist.cgi?
product=AspectJ&component=Compiler

   [iajc] Bugs for exceptions thrown have titles File:line from the top stack,
   [iajc] e.g., "SomeFile.java:243"

   [iajc] If you don't find the exception below in a bug, please add a new bug
   [iajc] at http://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ
   [iajc] To make the bug a priority, please include a test program
   [iajc] that can reproduce this exception.
   [iajc] null
   [iajc] java.lang.NullPointerException
   [iajc]     at org.eclipse.jdt.internal.compiler.lookup.MethodBinding.
signature(MethodBinding.java:488)
   [iajc]     at org.eclipse.jdt.internal.compiler.codegen.ConstantPool.
literalIndex(ConstantPool.java:996)
   [iajc]     at org.eclipse.jdt.internal.compiler.codegen.CodeStream.
invokestatic(CodeStream.java:3191)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.MessageSend.
generateCode(MessageSend.java:98)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.SingleNameReference.
generateAssignment(SingleNameReference.java:220)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.Assignment.
generateCode(Assignment.java:74)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.Expression.
generateCode(Expression.java:224)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.Block.generateCode(Block.
java:58)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.IfStatement.
generateCode(IfStatement.java:197)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.
AbstractMethodDeclaration.generateCode(AbstractMethodDeclaration.java:218)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.
AbstractMethodDeclaration.generateCode(AbstractMethodDeclaration.java:164)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.
generateCode(TypeDeclaration.java:555)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.
generateCode(TypeDeclaration.java:619)
   [iajc]     at org.eclipse.jdt.internal.compiler.ast.
CompilationUnitDeclaration.generateCode(CompilationUnitDeclaration.java:176)
   [iajc]     at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.
java:557)
   [iajc]     at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.
java:358)
   [iajc]     at org.aspectj.ajdt.internal.core.builder.AjBuildManager.
performCompilation(AjBuildManager.java:601)
   [iajc]     at org.aspectj.ajdt.internal.core.builder.AjBuildManager.
doBuild(AjBuildManager.java:160)
   [iajc]     at org.aspectj.ajdt.internal.core.builder.AjBuildManager.
batchBuild(AjBuildManager.java:94)
   [iajc]     at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:
102)
   [iajc]     at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:
53)
   [iajc]     at org.aspectj.tools.ajc.Main.run(Main.java:280)
   [iajc]     at org.aspectj.tools.ajc.Main.runMain(Main.java:217)
   [iajc]     at org.aspectj.tools.ajc.Main.main(Main.java:79)


   [iajc] 1 fail|abort, 1 error


   [iajc] java.lang.reflect.InvocationTargetException
   [iajc]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   [iajc]     at sun.reflect.NativeMethodAccessorImpl.
invoke(NativeMethodAccessorImpl.java:39)
   [iajc]     at sun.reflect.DelegatingMethodAccessorImpl.
invoke(DelegatingMethodAccessorImpl.java:25)
   [iajc]     at java.lang.reflect.Method.invoke(Method.java:324)
   [iajc]     at org.apache.tools.ant.taskdefs.ProcessDestroyer.
removeShutdownHook(ProcessDestroyer.java:116)
   [iajc]     at org.apache.tools.ant.taskdefs.ProcessDestroyer.
remove(ProcessDestroyer.java:186)
   [iajc]     at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495)
   [iajc]     at org.aspectj.tools.ant.taskdefs.AjcTask.execInOtherVM(AjcTask.
java:1325)
   [iajc]     at org.aspectj.tools.ant.taskdefs.AjcTask.
executeInOtherVM(AjcTask.java:1289)
   [iajc]     at org.aspectj.tools.ant.taskdefs.AjcTask.execute(AjcTask.java:
956)
   [iajc]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.
java:269)
   [iajc]     at org.apache.tools.ant.Task.perform(Task.java:364)
   [iajc]     at org.apache.tools.ant.Target.execute(Target.java:301)
   [iajc]     at org.apache.tools.ant.Target.performTasks(Target.java:328)
   [iajc]     at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
   [iajc]     at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:383)
   [iajc]     at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.
java:107)
   [iajc]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.
java:269)
   [iajc]     at org.apache.tools.ant.Task.perform(Task.java:364)
   [iajc]     at org.apache.tools.ant.Target.execute(Target.java:301)
   [iajc]     at org.apache.tools.ant.Target.performTasks(Target.java:328)
   [iajc]     at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
   [iajc]     at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
   [iajc]     at org.apache.tools.ant.Main.runBuild(Main.java:632)
   [iajc]     at org.apache.tools.ant.Main.startAnt(Main.java:183)
   [iajc]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
   [iajc]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
   [iajc] Caused by: java.lang.IllegalStateException: Shutdown in progress
   [iajc]     at java.lang.Shutdown.remove(Shutdown.java:102)
   [iajc]     at java.lang.Runtime.removeShutdownHook(Runtime.java:218)
   [iajc]     ... 27 more
Comment 1 attila lendvai CLA 2004-05-18 07:45:56 EDT
scenario:

- i have a chain of aspects with Intertype Method Declarations.
- one of them defines an inner interface with a method (no implementation)
- a later aspect in the inheritance defines an implementation for the above 
method but the return type of the method is not included
Comment 2 Andrew Clement CLA 2004-05-18 08:45:52 EDT
I'm trying to build a pair of files that simulate this scenario, but I can't 
get it to fail.  Here's my attempt:

abstract aspect A {
  interface Andy {
     public String getString(String s);
     public void getString(int i);
  }
}

And my subaspect:

aspect B extends A {
  public String A.Andy.getString(String s) {
    return "";
  }
}

That compiles fine.  I'm not sure what you mean by "but the return type of the 
method is not included".  If I remove the 'String' return type declaration from 
aspect B above then it doesn't compile and gives me a valid error message.  Can 
you cast an eye over my two aspects above and tell me if theres anything you 
are obviously doing differently?
Comment 3 Andrew Clement CLA 2004-08-09 10:17:59 EDT
We have just moved AspectJ to the Eclipse 3.0 final version of the JDT compiler
rather than the Eclipse 3.0 M6 version.  Please can you try a more recent
version of version of AspectJ to see if it fixes your problem?  Also, all the
stack entries have 'moved' with the compiler upgrade - so if you could attach a
more recent version of the stack trace, that would be great.  This more recent
version also includes several fixes for ITD handling that may fix it too.

You can get the most recent fully tested version of AspectJ from:
http://download.eclipse.org/technology/ajdt/dev/aspectj-DEVELOPMENT.jar
Comment 4 Andrew Clement CLA 2004-08-27 08:42:33 EDT
I'm closing this bug.  We are unable to recreate it and I believe you have moved
on from this problem (not to mention that we have replaced the compiler since it
was raised) - if you do find it still exists, please reopen this bug.  We have
recently fixed a problem with array types that could have led to them appearing
to be '<missing>' in certain situations which could be related.  (And we have
fixed several problems relating to complex intertype declaration interactions).

And we now have dump support so that when things go wrong like described in this
bug report we should produce an 'ajcore.***' file in the directory in which the
compiler was executing.  This ajcore file captures all the state from the
compiler at the time of the crash - please include it in the bug report if you
get a future failure.

sorry we didnt have the 'cycles' to fully investigate it when you first raised it.

thanks,
Andy.
Comment 5 Adrian Colyer CLA 2004-10-21 04:32:42 EDT
Fix released as part of AspectJ 1.2.1