diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/QuickFixAction.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/QuickFixAction.java index 19608f346ea0..a658223cc08e 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/QuickFixAction.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/QuickFixAction.java @@ -16,6 +16,7 @@ package com.intellij.codeInspection.ex; +import com.intellij.ReviseWhenPortedToJDK; import com.intellij.codeInsight.FileModificationService; import com.intellij.codeInspection.CommonProblemDescriptor; import com.intellij.codeInspection.InspectionManager; @@ -28,7 +29,6 @@ import com.intellij.codeInspection.ui.InspectionResultsView; import com.intellij.codeInspection.ui.InspectionTree; import com.intellij.icons.AllIcons; import com.intellij.ide.DataManager; -import com.intellij.ReviseWhenPortedToJDK; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.actionSystem.ex.CustomComponentAction; import com.intellij.openapi.application.ApplicationManager; @@ -116,6 +116,7 @@ public class QuickFixAction extends AnAction implements CustomComponentAction { } @Override + @ReviseWhenPortedToJDK("9") public void actionPerformed(final AnActionEvent e) { final InspectionResultsView view = getInvoker(e); final InspectionTree tree = view.getTree(); @@ -123,7 +124,7 @@ public class QuickFixAction extends AnAction implements CustomComponentAction { Ref descriptors = Ref.create(); Set readOnlyFiles = new THashSet<>(); //TODO revise when jdk9 arrives. Until then this redundant cast is a workaround to compile under jdk9 b169 - if (!ProgressManager.getInstance().runProcessWithProgressSynchronously((@ReviseWhenPortedToJDK("9") Runnable)() -> ReadAction.run(() -> { + if (!ProgressManager.getInstance().runProcessWithProgressSynchronously((Runnable)() -> ReadAction.run(() -> { final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator(); indicator.setText("Checking problem descriptors..."); descriptors.set(tree.getSelectedDescriptors(true, readOnlyFiles, false, false)); diff --git a/platform/util/src/com/intellij/ReviseWhenPortedToJDK.java b/platform/util/src/com/intellij/ReviseWhenPortedToJDK.java index 7ed160dd5cd1..c2ccf6c06a6c 100644 --- a/platform/util/src/com/intellij/ReviseWhenPortedToJDK.java +++ b/platform/util/src/com/intellij/ReviseWhenPortedToJDK.java @@ -15,15 +15,12 @@ */ package com.intellij; -import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; /** * Use to mark places in code which are hacks or workarounds which are supposed to be fixed or reworked in the new shiny JDK of the specified version */ -@Target({ElementType.METHOD,ElementType.TYPE,ElementType.TYPE_USE,ElementType.ANNOTATION_TYPE,ElementType.CONSTRUCTOR,ElementType.FIELD,ElementType.PARAMETER,ElementType.LOCAL_VARIABLE,ElementType.PACKAGE,ElementType.TYPE_PARAMETER}) @Retention(RetentionPolicy.SOURCE) public @interface ReviseWhenPortedToJDK { String value(); // JDK major version