Community
Participate
Working Groups
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
sort out for 1.5.3 - possibly a real error was hiding behind this NPE - a guard may be sufficient.
Hi Ron, I've not been able to reproduce this....are you able to provide a minimal testcase which shows the NPE? Thanks, Helen
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.
Just as a note...the latest upgrade of the compiler within ajdt was taken on the 20th October.
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.
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.
*** Bug 193440 has been marked as a duplicate of this bug. ***
*** Bug 198879 has been marked as a duplicate of this bug. ***
multiple bugs point to this one - going to put the guard in at least.
guard is in - will be in dev build shortly.