Skip to content

Commit

Permalink
Revive some code fixing old bug 154923
Browse files Browse the repository at this point in the history
  • Loading branch information
kriegaex committed Feb 12, 2024
1 parent 7b4a172 commit 848c8c2
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,12 +432,19 @@ public void setAnnotations(AnnotationBinding[] annotations, boolean forceStore)
}
public FieldDeclaration sourceField() {
SourceTypeBinding sourceType;
// AspectJ Extension
if (declaringClass instanceof BinaryTypeBinding) return null;
// End AspectJ Extension
try {
sourceType = (SourceTypeBinding) this.declaringClass;
} catch (ClassCastException e) {
return null;
}

// AspectJ Extension
// guard due to pr154923 - an npe occurs that is probably disguising an underlying problem that will be reported properly
if (sourceType.scope==null || sourceType.scope.referenceContext==null || sourceType.scope.referenceContext.methods==null) return null;
// End AspectJ Extension
FieldDeclaration[] fields = sourceType.scope.referenceContext.fields;
if (fields != null) {
for (int i = fields.length; --i >= 0;)
Expand Down

0 comments on commit 848c8c2

Please sign in to comment.