Bug 370159

Summary: FieldSignatureImpl.getField returns null
Product: [Tools] AspectJ Reporter: Jean-Pierre Bergamin <james>
Component: RuntimeAssignee: aspectj inbox <aspectj-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 1.6.12   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Jean-Pierre Bergamin CLA 2012-01-30 15:03:02 EST
FieldSignatureImpl.getField returns null in some cases.
I set a breakpoint in line 58 of FieldSignatureImpl.java that states:
  field = getDeclaringType().getDeclaredField(getName());

I can see in the debugger, that the "name" member of FieldSignatureImpl is set correctly to the name of the field I'm requesting. When I now step into the getDeclaredField() method, the passed string that is returned from getName() is null *or* sometimes set to the name of the class of the FieldSignatureImpl.declaredType member.

A sample application that shows this can be found here: https://github.com/ractive/sdn-aspect

The addFriend() test in PersonTests.java fails with a NullPointerException, because the returned field is null.