PsiModifierListImpl.hasExplicitModifier to use stubs
authorpeter <peter@jetbrains.com>
Fri, 10 Jun 2016 15:45:44 +0000 (17:45 +0200)
committerpeter <peter@jetbrains.com>
Fri, 10 Jun 2016 15:50:29 +0000 (17:50 +0200)
java/java-psi-impl/src/com/intellij/psi/impl/source/PsiModifierListImpl.java

index 9e67d8932827f2ab46c2ae067e2b63636d2a38c7..096785413adbd9f001173e2eb9bbc24d5fc3274e 100644 (file)
@@ -194,6 +194,11 @@ public class PsiModifierListImpl extends JavaStubPsiElement<PsiModifierListStub>
 
   @Override
   public boolean hasExplicitModifier(@NotNull String name) {
+    PsiModifierListStub stub = getStub();
+    if (stub != null) {
+      return BitUtil.isSet(stub.getModifiersMask(), ModifierFlags.NAME_TO_MODIFIER_FLAG_MAP.get(name));
+    }
+
     final CompositeElement tree = (CompositeElement)getNode();
     final IElementType type = NAME_TO_KEYWORD_TYPE_MAP.get(name);
     return tree.findChildByType(type) != null;