Merge remote-tracking branch 'origin/master' into develar/is
[idea/community.git] / java / java-analysis-impl / src / com / intellij / codeInspection / ex / EntryPointsManagerBase.java
index 28768a4e9afffb683599f92bffac2b4cdf2f8ddd..692761d7d9dab06c0de971e2cdc20fd0eeafd6e1 100644 (file)
@@ -84,7 +84,7 @@ public abstract class EntryPointsManagerBase extends EntryPointsManager implemen
   protected final Project myProject;
   private long myLastModificationCount = -1;
 
-  public EntryPointsManagerBase(final Project project) {
+  public EntryPointsManagerBase(@NotNull Project project) {
     myProject = project;
     myTemporaryEntryPoints = new HashSet<RefElement>();
     myPersistentEntryPoints = new LinkedHashMap<String, SmartRefElementPointer>(); // To keep the order between readExternal to writeExternal
@@ -100,11 +100,13 @@ public abstract class EntryPointsManagerBase extends EntryPointsManager implemen
         if (ADDITIONAL_ANNOS != null) {
           ADDITIONAL_ANNOS = null;
           UIUtil.invokeLaterIfNeeded(() -> {
-            if (ApplicationManager.getApplication().isDisposed()) return;
-            InspectionProfileManager.getInstance().fireProfileChanged(null);
+            if (!ApplicationManager.getApplication().isDisposed()) {
+              InspectionProfileManager.getInstance().fireProfileChanged(null);
+            }
           });
         }
-        DaemonCodeAnalyzer.getInstance(project).restart(); // annotations changed
+        // annotations changed
+        DaemonCodeAnalyzer.getInstance(myProject).restart();
       }
     }, false, this);
   }
@@ -246,8 +248,8 @@ public abstract class EntryPointsManagerBase extends EntryPointsManager implemen
       }
       else if (refConstructors.size() > 1) {
         // Many constructors here. Need to ask user which ones are used
-        for (int i = 0; i < refConstructors.size(); i++) {
-          addEntryPoint(refConstructors.get(i), isPersistent);
+        for (RefMethod refConstructor : refConstructors) {
+          addEntryPoint(refConstructor, isPersistent);
         }
       }
     }