Skip to content

Commit

Permalink
clear the AccAbstract and the AccInterface bits
Browse files Browse the repository at this point in the history
  • Loading branch information
subyssurendran666 committed Jan 6, 2025
1 parent 0e950f4 commit 4b39e64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ public final class X implements A {}
ITypeBinding aBinding = a.resolveBinding();
assertTrue(Modifier.isSealed(aBinding.getModifiers()));
assertTrue(Modifier.isPublic(aBinding.getModifiers()));
assertFalse(Modifier.isNonSealed(aBinding.getModifiers()));
}

//public non-sealed interface
Expand Down Expand Up @@ -494,6 +495,7 @@ public final class X implements A {}
ITypeBinding aBinding = a.resolveBinding();
assertTrue(Modifier.isNonSealed(aBinding.getModifiers()));
assertTrue(Modifier.isPublic(aBinding.getModifiers()));
assertFalse(Modifier.isSealed(aBinding.getModifiers()));
}

//public strictfp interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,9 @@ public int getModifiers() {
return accessFlags & ~(ClassFileConstants.AccAbstract | ClassFileConstants.AccInterface | ClassFileConstants.AccAnnotation);
} else if (isInterface()) {
ReferenceBinding referenceBinding = (ReferenceBinding) this.binding;
final int accessFlags = referenceBinding.getAccessFlags() & VALID_MODIFIERS;
int accessFlags = referenceBinding.getAccessFlags() & VALID_MODIFIERS;
// clear the AccAbstract and the AccInterface bits
accessFlags = accessFlags & ~(ClassFileConstants.AccAbstract | ClassFileConstants.AccInterface);

if (referenceBinding.isSealed()) {
return accessFlags | Modifier.SEALED;
Expand All @@ -616,7 +618,7 @@ public int getModifiers() {
return accessFlags | Modifier.NON_SEALED;
}
// clear the AccAbstract and the AccInterface bits
return accessFlags & ~(ClassFileConstants.AccAbstract | ClassFileConstants.AccInterface);
return accessFlags;
} else if (isEnum()) {
ReferenceBinding referenceBinding = (ReferenceBinding) this.binding;
final int accessFlags = referenceBinding.getAccessFlags() & VALID_MODIFIERS;
Expand Down

0 comments on commit 4b39e64

Please sign in to comment.