unused declaration: MoveEntriesToSuspicious always shows "remove from user defined...
authorDmitry Batkovich <dmitry.batkovich@jetbrains.com>
Thu, 25 Aug 2016 13:49:44 +0000 (16:49 +0300)
committerDmitry Batkovich <dmitry.batkovich@jetbrains.com>
Thu, 25 Aug 2016 13:50:20 +0000 (16:50 +0300)
java/java-impl/src/com/intellij/codeInspection/deadCode/DummyEntryPointsPresentation.java

index 47cb40f2f3e8a6487929f5c1493ed2b54ca1be98..c53f363a470bf892c0855146bd7544a82686d2d9 100644 (file)
@@ -57,7 +57,7 @@ public class DummyEntryPointsPresentation extends UnusedDeclarationPresentation
 
   private class MoveEntriesToSuspicious extends QuickFixAction {
     private MoveEntriesToSuspicious(@NotNull InspectionToolWrapper toolWrapper) {
-      super(InspectionsBundle.message("inspection.dead.code.remove.from.entry.point.quickfix"), null, null, toolWrapper);
+      super(InspectionsBundle.message("inspection.dead.code.remove.user.defined.entry.point.quickfix"), null, null, toolWrapper);
     }
 
     @Override
@@ -66,22 +66,16 @@ public class DummyEntryPointsPresentation extends UnusedDeclarationPresentation
       if (e.getPresentation().isEnabled()) {
         final InspectionResultsView view = getInvoker(e);
         boolean permanentFound = false;
-        boolean nonPermanentFound = false;
         for (RefEntity point : view.getTree().getSelectedElements()) {
           if (point instanceof RefJavaElement && ((RefJavaElement)point).isEntry()) {
             if (((RefJavaElement)point).isPermanentEntry()) {
               permanentFound = true;
-            }
-            else {
-              nonPermanentFound = true;
+              break;
             }
           }
         }
 
-        if (permanentFound && nonPermanentFound) {
-          e.getPresentation().setText(InspectionsBundle.message("inspection.dead.code.remove.user.defined.entry.point.quickfix"));
-        }
-        else if (nonPermanentFound || !permanentFound) {
+        if (!permanentFound) {
           e.getPresentation().setEnabled(false);
         }
       }