Bug 154923 - NPE during incremental compilation after fixing compiler error
Summary: NPE during incremental compilation after fixing compiler error
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.4   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 193440 198879 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-08-23 15:40 EDT by Ron Bodkin CLA
Modified: 2007-11-07 05:00 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Bodkin CLA 2006-08-23 15:40:41 EDT
I received this error when invoking build all. I was trying to clear a spurious error about missing an implementation that an ITD would fix from a previous incremental compilation. A clean and rebuild fixed this...

java.lang.NullPointerException
at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceMethod(MethodBinding.java:748)
at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding.sourceStart(MethodBinding.java:755)
at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.fillDeclaredMembers(EclipseSourceType.java:211)
at org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType.getDeclaredMethods(EclipseSourceType.java:263)
at org.aspectj.weaver.ReferenceType.getDeclaredMethods(ReferenceType.java:512)
at org.aspectj.weaver.ResolvedType.addAndRecurse(ResolvedType.java:263)
at org.aspectj.weaver.ResolvedType.getMethodsWithoutIterator(ResolvedType.java:258)
at org.aspectj.weaver.ResolvedType.lookupResolvedMember(ResolvedType.java:379)
at org.aspectj.weaver.JoinPointSignatureIterator.findSignaturesFromSupertypes(JoinPointSignatureIterator.java:178)
at org.aspectj.weaver.JoinPointSignatureIterator.hasNext(JoinPointSignatureIterator.java:69)
at org.aspectj.weaver.patterns.SignaturePattern.matches(SignaturePattern.java:287)
at org.aspectj.weaver.patterns.WithincodePointcut.matchInternal(WithincodePointcut.java:72)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:146)
at org.aspectj.weaver.patterns.NotPointcut.matchInternal(NotPointcut.java:52)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:146)
at org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPointcut.java:51)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:146)
at org.aspectj.weaver.ShadowMunger.match(ShadowMunger.java:75)
at org.aspectj.weaver.Checker.match(Checker.java:70)
at org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeaver.java:2806)
at org.aspectj.weaver.bcel.BcelClassWeaver.matchInvokeInstruction(BcelClassWeaver.java:2768)
at org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeaver.java:2506)
at org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeaver.java:2332)
at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeaver.java:494)
at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeaver.java:119)
at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1606)
at org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDump(BcelWeaver.java:1557)
at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver.java:1335)
at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1155)
at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter.weaveQueuedEntries(AjPipeliningCompilerAdapter.java:455)
at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter.queueForWeaving(AjPipeliningCompilerAdapter.java:392)
at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter.afterProcessing(AjPipeliningCompilerAdapter.java:380)
at org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$after$org_aspectj_ajdt_internal_compiler_CompilerAdapter$5$6b855184(CompilerAdapter.aj:98)
at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:533)
at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:329)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:892)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:273)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.incrementalBuild(AjBuildManager.java:172)
at org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAdapter.java:117)
at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191)

trouble in: 
 class glassbox.track.api.UIStatisticsType extends glassbox.track.api.UofwStatisticsType:
  private static transient glassbox.util.logging.api.LogManagement ajc$glassbox_util_logging_api_LogManagement$ptwAspectInstance [Synthetic]
  public void <init>()    org.aspectj.weaver.MethodDeclarationLineNumber: 130:4443
:
                    ALOAD_0     // Lglassbox/track/api/UIStatisticsType; this   (line 130)
                    ICONST_0
                    INVOKESPECIAL glassbox.track.api.UofwStatisticsType.<init> (I)V
    constructor-execution(void glassbox.track.api.UIStatisticsType.<init>())
    |               RETURN
    constructor-execution(void glassbox.track.api.UIStatisticsType.<init>())
  end public void <init>()

  public glassbox.track.api.CallDescription getCall(glassbox.track.api.PerfStats)    org.aspectj.weaver.MethodDeclarationLineNumber: 131:4516
:
    method-execution(glassbox.track.api.CallDescription glassbox.track.api.UIStatisticsType.getCall(glassbox.track.api.PerfStats))
    |               ALOAD_1     // Lglassbox/track/api/PerfStats; stats   (line 132)
    | method-call(java.io.Serializable glassbox.track.api.PerfStats.getKey())
    | |             INVOKEINTERFACE glassbox.track.api.PerfStats.getKey ()Ljava/io/Serializable;
    | method-call(java.io.Serializable glassbox.track.api.PerfStats.getKey())
    |               CHECKCAST glassbox.track.api.OperationDescription
    |               ARETURN
    method-execution(glassbox.track.api.CallDescription glassbox.track.api.UIStatisticsType.getCall(glassbox.track.api.PerfStats))
  end public glassbox.track.api.CallDescription getCall(glassbox.track.api.PerfStats)

  public String getLayer()    org.aspectj.weaver.MethodDeclarationLineNumber: 134:4623
:
                    LDC "ui"   (line 135)
                    ARETURN
  end public String getLayer()

  public static glassbox.util.logging.api.LogManagement ajc$glassbox_util_logging_api_LogManagement$localAspectOf():
                    GETSTATIC glassbox.track.api.UIStatisticsType.ajc$glassbox_util_logging_api_LogManagement$ptwAspectInstance Lglassbox/util/logging/api/LogManagement;
                    ARETURN
  end public static glassbox.util.logging.api.LogManagement ajc$glassbox_util_logging_api_LogManagement$localAspectOf()

end  class glassbox.track.api.UIStatisticsType

when weaving type glassbox.track.api.UIStatisticsType
when weaving classes 
when weaving 
when incrementally building BuildConfig[C:\devel\glassbox\.metadata\.plugins\org.eclipse.ajdt.core\glassboxAgent.generated.lst] #Files=204
Comment 1 Andrew Clement CLA 2006-09-25 08:40:18 EDT
sort out for 1.5.3 - possibly a real error was hiding behind this NPE - a guard may be sufficient.
Comment 2 Helen Beeken CLA 2006-10-09 06:11:07 EDT
Hi Ron,

I've not been able to reproduce this....are you able to provide a minimal testcase which shows the NPE?

Thanks, Helen
Comment 3 Andrew Clement CLA 2006-10-17 08:31:32 EDT
Under a separate bug I've made a bit of a radical change to support for ITDs in incremental compilation.  That change may affect this.  The fix hasn't yet reached AJDT - should be soon.
Comment 4 Helen Beeken CLA 2006-10-26 04:23:23 EDT
Just as a note...the latest upgrade of the compiler within ajdt was taken on the 20th October.
Comment 5 Helen Beeken CLA 2006-11-09 04:08:21 EST
I've just seen this same NPE whilst doing some refactoring work with aspectj build 1.5.3.200610201049. I'm still trying to reproduce this with a simplified testcase but as yet have had no luck. The aspects involved do not have ITD's, just deow statements.
Comment 6 Helen Beeken CLA 2006-11-10 03:12:41 EST
I've still been unable to reproduce this with a simplified testcase, although in my development workspace it happens fairly frequently. The NPE occurs when I remove a method from an interface that causes a compiler error in another class. When I try to fix the compiler error the NPE occurs. This is similar to Ron's initial description.
Comment 7 Andrew Clement CLA 2007-10-25 04:58:49 EDT
*** Bug 193440 has been marked as a duplicate of this bug. ***
Comment 8 Andrew Clement CLA 2007-10-25 04:59:23 EDT
*** Bug 198879 has been marked as a duplicate of this bug. ***
Comment 9 Andrew Clement CLA 2007-10-25 05:00:21 EDT
multiple bugs point to this one - going to put the guard in at least.
Comment 10 Andrew Clement CLA 2007-11-07 05:00:01 EST
guard is in - will be in dev build shortly.