Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] FieldSignatureImpl.getField returns null

Hello

I'm facing a strange issue. FieldSignatureImpl.getField returns null - and I don't know why.
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. This is quite strange, isn't it?

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.
Is this a bug in AspectJ or an error in my aspect declaration. Any ideas?


Best regards,
James

Back to the top