Bug 357920 - NPE in org.aspectj.weaver.ResolvedType.lookupResolvedMember when saving a modified class
Summary: NPE in org.aspectj.weaver.ResolvedType.lookupResolvedMember when saving a mod...
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-16 06:26 EDT by Andy Wilkinson CLA
Modified: 2013-06-24 11:02 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Wilkinson CLA 2011-09-16 06:26:02 EDT
I'm using AJDT 2.1.3.e37x-20110628-1900 in STS 2.7.0.RELEASE and this morning I've started seeing multiple error dialogs popup reporting an internal AspectJ compiler error. There will often be tens of dialogs stacked one on top of the other. I think I've noticed two different exceptions being reported: a NullPointerExeption and an IllegalStateException. I've captured the NPE here. If I see the ISE again I'll open a separate bug.

The exception from the details view is:

java.lang.NullPointerException
at org.aspectj.weaver.ResolvedType.lookupResolvedMember(ResolvedType.java:619)
at org.aspectj.weaver.JoinPointSignatureIterator.findSignaturesFromSupertypes(JoinPointSignatureIterator.java:192)
at org.aspectj.weaver.JoinPointSignatureIterator.hasNext(JoinPointSignatureIterator.java:68)
at org.aspectj.weaver.patterns.SignaturePattern.matches(SignaturePattern.java:317)
at org.aspectj.weaver.patterns.KindedPointcu ... nceDoesNotExistException

This problem has only started to occur today. I haven't made any changes to my STS installation since yesterday so I'm not sure what the cause is. I am making a lot of changes to type signatures at the moment, typically adding generics so it could be related to that. That said, I was doing similar work yesterday and wasn't experiencing this problem.
Comment 1 Andy Wilkinson CLA 2011-09-16 06:28:57 EDT
Here's another NPE with a slightly different stack trace:

java.lang.NullPointerException
at org.aspectj.weaver.ResolvedType.lookupMethod(ResolvedType.java:542)
at org.aspectj.weaver.World.resolve(World.java:634)
at org.aspectj.weaver.MemberImpl.resolve(MemberImpl.java:95)
at org.aspectj.weaver.JoinPointSignatureIterator.addSignaturesUpToFirstDefiningMember(JoinPointSignatureIterator.java:112)
at org.aspectj.weaver.JoinPointSignatureIterator.<init>(JoinPointSignatureIterator.java:49)
at org.aspectj. ... quest(java.util.Map, String)
Comment 2 Andrew Clement CLA 2011-09-16 16:04:30 EDT
Andy - can I possibly get a copy of your workspace?  (or point me at a git repo containing the offending code?) I need to poke about it in a bit.  I imagine your comment on generics is the trigger (we are likely looking something up in generic form when we should have erased it) but I need to be sure.
Comment 3 Christien Lomax CLA 2012-03-04 18:57:45 EST
Has there been any progress on this?  We are seeing the same issue.

We are using GWT and Spring with AspecJ, and we get an NPE on every Locator/GWT Adapter every time we save something that effects them (about 29 errors on a clean build).

Does not seem to effect the end application, but it IS a real PITA.
Comment 4 Andrew Clement CLA 2012-03-07 11:38:59 EST
I didn't get a copy of the workspace from Andy - so haven't progressed this bug.  However I did fix an awful generics issue quite recently that may play into this area.  It is probably worth you trying a dev build to see if that helps.  You can access the weaver jar here:

http://www.eclipse.org/downloads/download.php?file=/tools/aspectj/dev/aspectjweaver-20120307083000.jar

If you need the full AspectJ, it is here:

http://www.eclipse.org/downloads/download.php?file=/tools/aspectj/dev/aspectj-DEVELOPMENT-20120307083000.jar

If that doesn't help, I'd be happy to work with you on fixing this if you can share with me a setup that shows the problem?
Comment 5 Andrew Clement CLA 2013-06-24 11:02:18 EDT
unsetting the target field which is currently set for something already released