Search in sources :

Example 21 with RefClass

use of com.intellij.codeInspection.reference.RefClass in project intellij-community by JetBrains.

the class InitializationDependencyUtils method tabulateTransitiveInitializationDependencyClasses.

private static void tabulateTransitiveInitializationDependencyClasses(RefClass refClass, Set<RefClass> newDependencies) {
    final LinkedList<RefClass> pendingClasses = new LinkedList<>();
    final Set<RefClass> processedClasses = new HashSet<>();
    pendingClasses.addLast(refClass);
    while (!pendingClasses.isEmpty()) {
        final RefClass classToProcess = pendingClasses.removeFirst();
        newDependencies.add(classToProcess);
        processedClasses.add(classToProcess);
        final Set<RefClass> dependencies = calculateInitializationDependenciesForClass(classToProcess);
        for (RefClass dependency : dependencies) {
            if (!pendingClasses.contains(dependency) && !processedClasses.contains(dependency)) {
                pendingClasses.addLast(dependency);
            }
        }
    }
    newDependencies.remove(refClass);
}
Also used : RefClass(com.intellij.codeInspection.reference.RefClass)

Aggregations

RefClass (com.intellij.codeInspection.reference.RefClass)21 Nullable (org.jetbrains.annotations.Nullable)14 CommonProblemDescriptor (com.intellij.codeInspection.CommonProblemDescriptor)13 RefEntity (com.intellij.codeInspection.reference.RefEntity)11 PsiClass (com.intellij.psi.PsiClass)8 RefPackage (com.intellij.codeInspection.reference.RefPackage)7 HashSet (java.util.HashSet)6 RefModule (com.intellij.codeInspection.reference.RefModule)4 Set (java.util.Set)3 RefElement (com.intellij.codeInspection.reference.RefElement)2 RefJavaUtil (com.intellij.codeInspection.reference.RefJavaUtil)2 Project (com.intellij.openapi.project.Project)2 PsiIdentifier (com.intellij.psi.PsiIdentifier)2 RefJavaVisitor (com.intellij.codeInspection.reference.RefJavaVisitor)1 RefManager (com.intellij.codeInspection.reference.RefManager)1 Module (com.intellij.openapi.module.Module)1 PsiElement (com.intellij.psi.PsiElement)1 ArrayList (java.util.ArrayList)1