Bug 370159 - FieldSignatureImpl.getField returns null
Summary: FieldSignatureImpl.getField returns null
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Runtime (show other bugs)
Version: 1.6.12   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-30 15:03 EST by Jean-Pierre Bergamin CLA
Modified: 2012-01-30 15:03 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.