mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use super where possible
This commit is contained in:
+1
-2
@@ -24,7 +24,6 @@ import com.intellij.codeInsight.lookup.LookupElementBuilder;
|
||||
import com.intellij.codeInsight.lookup.LookupManager;
|
||||
import com.intellij.codeInspection.*;
|
||||
import com.intellij.codeInspection.ex.BaseLocalInspectionTool;
|
||||
import com.intellij.codeInspection.ex.ProblemDescriptorImpl;
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.ide.util.FQNameCellRenderer;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
@@ -307,7 +306,7 @@ public class JavaDocReferenceInspection extends BaseLocalInspectionTool {
|
||||
public void run(DataContext dataContext) {
|
||||
final Editor editor = PlatformDataKeys.EDITOR.getData(dataContext);
|
||||
assert editor != null;
|
||||
final TextRange textRange = ((ProblemDescriptorImpl)descriptor).getTextRange();
|
||||
final TextRange textRange = ((ProblemDescriptorBase)descriptor).getTextRange();
|
||||
editor.getSelectionModel().setSelection(textRange.getStartOffset(), textRange.getEndOffset());
|
||||
|
||||
final String word = editor.getSelectionModel().getSelectedText();
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.intellij.codeInsight.ExceptionUtil;
|
||||
import com.intellij.codeInsight.FileModificationService;
|
||||
import com.intellij.codeInsight.daemon.GroupNames;
|
||||
import com.intellij.codeInspection.*;
|
||||
import com.intellij.codeInspection.ex.ProblemDescriptorImpl;
|
||||
import com.intellij.codeInspection.reference.*;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -106,7 +105,7 @@ public class RedundantThrows extends GlobalJavaInspectionTool {
|
||||
}
|
||||
|
||||
if (problems != null) {
|
||||
return problems.toArray(new ProblemDescriptorImpl[problems.size()]);
|
||||
return problems.toArray(new ProblemDescriptorBase[problems.size()]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -662,7 +662,7 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
|
||||
}
|
||||
}
|
||||
}
|
||||
HintAction hintAction = ((ProblemDescriptorImpl)descriptor).getHintAction();
|
||||
HintAction hintAction = descriptor instanceof ProblemDescriptorImpl ? ((ProblemDescriptorImpl)descriptor).getHintAction() : null;
|
||||
if (hintAction != null) {
|
||||
QuickFixAction.registerQuickFixAction(highlightInfo, hintAction, key);
|
||||
needEmptyAction = false;
|
||||
|
||||
+2
-3
@@ -24,7 +24,6 @@ import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.codeInspection.*;
|
||||
import com.intellij.codeInspection.ex.InspectionToolWrapper;
|
||||
import com.intellij.codeInspection.ex.LocalInspectionToolWrapper;
|
||||
import com.intellij.codeInspection.ex.ProblemDescriptorImpl;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.progress.EmptyProgressIndicator;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
@@ -80,8 +79,8 @@ public class CleanupInspectionIntention implements IntentionAction, HighPriority
|
||||
Collections.sort(descriptions, new Comparator<CommonProblemDescriptor>() {
|
||||
@Override
|
||||
public int compare(final CommonProblemDescriptor o1, final CommonProblemDescriptor o2) {
|
||||
final ProblemDescriptorImpl d1 = (ProblemDescriptorImpl)o1;
|
||||
final ProblemDescriptorImpl d2 = (ProblemDescriptorImpl)o2;
|
||||
final ProblemDescriptorBase d1 = (ProblemDescriptorBase)o1;
|
||||
final ProblemDescriptorBase d2 = (ProblemDescriptorBase)o2;
|
||||
return d2.getTextRange().getStartOffset() - d1.getTextRange().getStartOffset();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -211,7 +211,7 @@ class Browser extends JPanel {
|
||||
if (psiElement == null) return;
|
||||
VirtualFile vFile = psiElement.getContainingFile().getVirtualFile();
|
||||
if (vFile != null) {
|
||||
TextRange range = ((ProblemDescriptorImpl)myCurrentDescriptor).getTextRange();
|
||||
TextRange range = ((ProblemDescriptorBase)myCurrentDescriptor).getTextRange();
|
||||
fireClickEvent(vFile, range.getStartOffset(), range.getEndOffset());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -663,8 +663,8 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren
|
||||
|
||||
@Nullable
|
||||
private Navigatable getSelectedNavigatable(final CommonProblemDescriptor descriptor, final PsiElement psiElement) {
|
||||
if (descriptor instanceof ProblemDescriptorImpl) {
|
||||
Navigatable navigatable = ((ProblemDescriptorImpl) descriptor).getNavigatable();
|
||||
if (descriptor instanceof ProblemDescriptorBase) {
|
||||
Navigatable navigatable = ((ProblemDescriptorBase) descriptor).getNavigatable();
|
||||
if (navigatable != null) {
|
||||
return navigatable;
|
||||
}
|
||||
@@ -675,8 +675,8 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren
|
||||
|
||||
if (virtualFile != null) {
|
||||
int startOffset = psiElement.getTextOffset();
|
||||
if (descriptor instanceof ProblemDescriptorImpl) {
|
||||
final TextRange textRange = ((ProblemDescriptorImpl)descriptor).getTextRangeForNavigation();
|
||||
if (descriptor instanceof ProblemDescriptorBase) {
|
||||
final TextRange textRange = ((ProblemDescriptorBase)descriptor).getTextRangeForNavigation();
|
||||
if (textRange != null) {
|
||||
if (virtualFile instanceof VirtualFileWindow) {
|
||||
virtualFile = ((VirtualFileWindow)virtualFile).getDelegate();
|
||||
|
||||
+3
-7
@@ -15,11 +15,7 @@
|
||||
*/
|
||||
package com.intellij.uiDesigner.inspections;
|
||||
|
||||
import com.intellij.codeInspection.InspectionManager;
|
||||
import com.intellij.codeInspection.LocalQuickFix;
|
||||
import com.intellij.codeInspection.ProblemDescriptor;
|
||||
import com.intellij.codeInspection.ProblemHighlightType;
|
||||
import com.intellij.codeInspection.ex.ProblemDescriptorImpl;
|
||||
import com.intellij.codeInspection.*;
|
||||
import com.intellij.openapi.util.JDOMUtil;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.uiDesigner.lw.IComponent;
|
||||
@@ -52,10 +48,10 @@ public class FormFileErrorCollector extends FormErrorCollector {
|
||||
final ProblemDescriptor problemDescriptor = myManager.createProblemDescriptor(myFile, JDOMUtil.escapeText(errorMessage),
|
||||
(LocalQuickFix)null,
|
||||
ProblemHighlightType.GENERIC_ERROR_OR_WARNING, myOnTheFly);
|
||||
if (problemDescriptor instanceof ProblemDescriptorImpl && component != null) {
|
||||
if (problemDescriptor instanceof ProblemDescriptorBase && component != null) {
|
||||
FormElementNavigatable navigatable = new FormElementNavigatable(myFile.getProject(), myFile.getVirtualFile(),
|
||||
component.getId());
|
||||
((ProblemDescriptorImpl) problemDescriptor).setNavigatable(navigatable);
|
||||
((ProblemDescriptorBase) problemDescriptor).setNavigatable(navigatable);
|
||||
}
|
||||
myProblems.add(problemDescriptor);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.intellij.codeInsight.lookup.LookupElement;
|
||||
import com.intellij.codeInsight.lookup.LookupElementBuilder;
|
||||
import com.intellij.codeInsight.lookup.LookupManager;
|
||||
import com.intellij.codeInspection.ProblemDescriptor;
|
||||
import com.intellij.codeInspection.ex.ProblemDescriptorImpl;
|
||||
import com.intellij.codeInspection.ProblemDescriptorBase;
|
||||
import com.intellij.openapi.actionSystem.Anchor;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -65,7 +65,7 @@ public class ChangeTo extends ShowSuggestions implements SpellCheckerQuickFix {
|
||||
return;
|
||||
}
|
||||
|
||||
TextRange textRange = ((ProblemDescriptorImpl)descriptor).getTextRange();
|
||||
TextRange textRange = ((ProblemDescriptorBase)descriptor).getTextRange();
|
||||
editor.getSelectionModel().setSelection(textRange.getStartOffset(), textRange.getEndOffset());
|
||||
|
||||
String word = editor.getSelectionModel().getSelectedText();
|
||||
|
||||
Reference in New Issue
Block a user