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 194a5750ce29..3adfc6181f54 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/QuickFixAction.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/QuickFixAction.java @@ -28,6 +28,7 @@ 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.internal.ReviseWhenPortedToJDK; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.actionSystem.ex.CustomComponentAction; import com.intellij.openapi.application.ApplicationManager; @@ -121,7 +122,8 @@ public class QuickFixAction extends AnAction implements CustomComponentAction { try { Ref descriptors = Ref.create(); Set readOnlyFiles = new THashSet<>(); - if (!ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> ReadAction.run(() -> { + //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(() -> { final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator(); indicator.setText("Checking problem descriptors..."); descriptors.set(tree.getSelectedDescriptors(true, readOnlyFiles, false, false)); diff --git a/platform/lang-impl/src/com/intellij/internal/ReviseWhenPortedToJDK.java b/platform/lang-impl/src/com/intellij/internal/ReviseWhenPortedToJDK.java new file mode 100644 index 000000000000..b411c87d5bfb --- /dev/null +++ b/platform/lang-impl/src/com/intellij/internal/ReviseWhenPortedToJDK.java @@ -0,0 +1,30 @@ +/* + * Copyright 2000-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.internal; + +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(); +}