mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 23:31:05 +07:00
[java-inspection] IDEA-376232 JEP 512: 'safe delete' for 'args' in main method in the compact source file at the first place in the list of suggested quick-fixes
- return ordered quick-fixes unused inspections (cherry picked from commit b4abe529ad318430466b3e3e9d39dd2d12916a3e) GitOrigin-RevId: 58d37e7cf5fac5425e4b15aa27cd7c5a6a69e175
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d1a5734347
commit
7b4509504b
@@ -10,6 +10,7 @@ import com.intellij.codeInsight.daemon.impl.analysis.JavaHighlightUtil;
|
||||
import com.intellij.codeInsight.daemon.impl.analysis.LocalRefUseInfo;
|
||||
import com.intellij.codeInsight.daemon.impl.quickfix.ReplaceWithUnnamedPatternFix;
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.codeInsight.intention.PriorityAction;
|
||||
import com.intellij.codeInsight.intention.QuickFixFactory;
|
||||
import com.intellij.codeInsight.intention.impl.PriorityIntentionActionWrapper;
|
||||
import com.intellij.codeInspection.*;
|
||||
@@ -409,10 +410,24 @@ public final class UnusedSymbolLocalInspection extends AbstractBaseJavaLocalInsp
|
||||
|
||||
private static @NotNull LocalQuickFix toLocalQuickFix(IntentionAction fix) {
|
||||
ModCommandAction action = fix.asModCommandAction();
|
||||
return action == null ? new LocalQuickFixBackedByIntentionAction(fix) :
|
||||
return action == null ? new OrderedLocalQuickFixBackedByIntentionAction(fix) :
|
||||
LocalQuickFix.from(action);
|
||||
}
|
||||
|
||||
private static class OrderedLocalQuickFixBackedByIntentionAction extends LocalQuickFixBackedByIntentionAction implements PriorityAction {
|
||||
private final @NotNull Priority myPriority;
|
||||
|
||||
private OrderedLocalQuickFixBackedByIntentionAction(@NotNull IntentionAction action) {
|
||||
super(action);
|
||||
myPriority = action instanceof PriorityAction priorityAction ? priorityAction.getPriority() : Priority.HIGH;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Priority getPriority() {
|
||||
return myPriority;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull OptPane getOptionsPane() {
|
||||
return pane(
|
||||
|
||||
Reference in New Issue
Block a user