diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter_23Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter_23Test.java index 75a3c8bf763..22b28a02d5f 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter_23Test.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter_23Test.java @@ -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 @@ -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 diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java index deefed19206..68eca8b40bc 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java @@ -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; @@ -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;