com.intellij.psi.util.PsiTreeUtil



API Populatity

3 Client projects

Project: com.intellij

Package: com.intellij.psi

Project JetBrains/intellij-community in file ...s.src.com.siyeh.ig.psiutils.WeakestTypeFinder.java (2008-09-01)
@@ -15,18 +15,18 @@
  */
 package com.siyeh.ig.psiutils;
 
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import com.intellij.openapi.project.Project;
 import com.intellij.psi.*;
-import com.intellij.psi.tree.IElementType;
-import com.intellij.psi.util.*;
-import com.intellij.psi.util.InheritanceUtil;
 import com.intellij.psi.search.GlobalSearchScope;
-import com.intellij.psi.search.searches.ReferencesSearch;
 import com.intellij.psi.search.searches.DirectClassInheritorsSearch;
-import com.intellij.openapi.project.Project;
+import com.intellij.psi.search.searches.ReferencesSearch;
+import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.util.InheritanceUtil;
+import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.util.Query;
 import com.siyeh.HardcodedMethodConstants;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 import java.util.*;
 public class WeakestTypeFinder {
Project JetBrains/intellij-community in file ...ch.impl.matcher.compiler.JavaCompilingVisitor.java (2014-12-26)
@@ -8,6 +8,7 @@ import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.psi.search.PsiShortNamesCache;
 import com.intellij.psi.search.SearchScope;
 import com.intellij.psi.search.searches.ClassInheritorsSearch;
+import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.structuralsearch.*;
 import com.intellij.structuralsearch.impl.matcher.CompiledPattern;
 import com.intellij.structuralsearch.impl.matcher.JavaCompiledPattern;
@@ -211,7 +212,7 @@ public class JavaCompilingVisitor extends JavaRecursiveElementWalkingVisitor {
           }
           currentReference = (PsiReferenceExpression)qualifier;
         }
-        if (!hasNoNestedSubstitutionHandlers) {
+        if (!hasNoNestedSubstitutionHandlers && PsiTreeUtil.getChildOfType(reference, PsiAnnotation.class) == null) {
           createAndSetSubstitutionHandlerFromReference(
             reference,
             resolve != null ? ((PsiClass)resolve).getQualifiedName() : reference.getText(),
Project JetBrains/intellij-community in file ...g.extractSuperclass.ExtractSuperBaseProcessor.java (2007-11-29)
@@ -8,6 +8,7 @@ import com.intellij.psi.codeStyle.CodeStyleManager;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.psi.util.InheritanceUtil;
 import com.intellij.psi.util.MethodSignatureUtil;
+import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.refactoring.RefactoringBundle;
 import com.intellij.refactoring.turnRefsToSuper.TurnRefsToSuperProcessorBase;
 import com.intellij.refactoring.util.JavaDocPolicy;
@@ -93,7 +94,7 @@ public abstract class ExtractSuperBaseProcessor extends TurnRefsToSuperProcessor
     }
     for (final PsiReference ref : refs) {
       final PsiElement element = ref.getElement();
-      if (!canTurnToSuper(element)) {
+      if (!canTurnToSuper(element) && PsiTreeUtil.getParentOfType(element, PsiImportStatement.class) == null) {
         result.add(new BindToOldUsageInfo(element, ref, myClass));
       }
     }