mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
Cleanup (formatting)
This commit is contained in:
+6
-5
@@ -1183,8 +1183,9 @@ public class HighlightUtil extends HighlightUtilBase {
|
||||
|
||||
|
||||
@Nullable
|
||||
static Collection<HighlightInfo> checkWithImprovedCatchAnalysis(@NotNull final PsiParameter parameter,
|
||||
@NotNull final Collection<PsiClassType> thrownInTryStatement,@NotNull PsiFile containingFile) {
|
||||
static Collection<HighlightInfo> checkWithImprovedCatchAnalysis(@NotNull PsiParameter parameter,
|
||||
@NotNull Collection<PsiClassType> thrownInTryStatement,
|
||||
@NotNull PsiFile containingFile) {
|
||||
final PsiElement scope = parameter.getDeclarationScope();
|
||||
if (!(scope instanceof PsiCatchSection)) return null;
|
||||
|
||||
@@ -1194,8 +1195,8 @@ public class HighlightUtil extends HighlightUtilBase {
|
||||
if (idx <= 0) return null;
|
||||
|
||||
final Collection<PsiClassType> thrownTypes = ContainerUtil.newHashSet(thrownInTryStatement);
|
||||
PsiManager manager = containingFile.getManager();
|
||||
GlobalSearchScope parameterResolveScope = parameter.getResolveScope();
|
||||
final PsiManager manager = containingFile.getManager();
|
||||
final GlobalSearchScope parameterResolveScope = parameter.getResolveScope();
|
||||
thrownTypes.add(PsiType.getJavaLangError(manager, parameterResolveScope));
|
||||
thrownTypes.add(PsiType.getJavaLangRuntimeException(manager, parameterResolveScope));
|
||||
final Collection<HighlightInfo> result = ContainerUtil.newArrayList();
|
||||
@@ -2600,7 +2601,7 @@ public class HighlightUtil extends HighlightUtilBase {
|
||||
QuickFixAction.registerQuickFixAction(highlightInfo, action);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
public static List<IntentionAction> getChangeVariableTypeFixes(@NotNull PsiVariable parameter, PsiType itemType) {
|
||||
if (itemType instanceof PsiMethodReferenceType) return Collections.emptyList();
|
||||
|
||||
+1
-3
@@ -16,7 +16,6 @@
|
||||
package com.intellij.codeInsight.daemon.impl.analysis;
|
||||
|
||||
import com.intellij.codeHighlighting.Pass;
|
||||
import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx;
|
||||
import com.intellij.codeInsight.daemon.JavaErrorMessages;
|
||||
import com.intellij.codeInsight.daemon.impl.*;
|
||||
import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixAction;
|
||||
@@ -38,7 +37,6 @@ import com.intellij.psi.*;
|
||||
import com.intellij.psi.controlFlow.ControlFlowUtil;
|
||||
import com.intellij.psi.impl.source.javadoc.PsiDocMethodOrFieldRef;
|
||||
import com.intellij.psi.impl.source.resolve.JavaResolveUtil;
|
||||
import com.intellij.psi.impl.source.resolve.graphInference.FunctionalInterfaceParameterizationUtil;
|
||||
import com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl;
|
||||
import com.intellij.psi.javadoc.PsiDocComment;
|
||||
import com.intellij.psi.javadoc.PsiDocTagValue;
|
||||
@@ -1301,7 +1299,7 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
|
||||
added = myHolder.addAll(HighlightUtil.checkExceptionThrownInTry(parameter, thrownTypes));
|
||||
}
|
||||
if (!added) {
|
||||
myHolder.addAll(HighlightUtil.checkWithImprovedCatchAnalysis(parameter, thrownTypes,myFile));
|
||||
myHolder.addAll(HighlightUtil.checkWithImprovedCatchAnalysis(parameter, thrownTypes, myFile));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -398,10 +398,10 @@ public class ExceptionUtil {
|
||||
@NotNull
|
||||
public static List<PsiClassType> getUnhandledExceptions(@NotNull final PsiCallExpression methodCall,
|
||||
@Nullable final PsiElement topElement,
|
||||
boolean includeSelfCalls) {
|
||||
final boolean includeSelfCalls) {
|
||||
final JavaResolveResult result = methodCall.resolveMethodGenerics();
|
||||
final PsiMethod method = (PsiMethod)result.getElement();
|
||||
PsiMethod containingMethod = PsiTreeUtil.getParentOfType(methodCall, PsiMethod.class);
|
||||
final PsiMethod containingMethod = PsiTreeUtil.getParentOfType(methodCall, PsiMethod.class);
|
||||
if (!includeSelfCalls && method == containingMethod) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
@@ -410,7 +410,7 @@ public class ExceptionUtil {
|
||||
if (method != null && !isArrayClone(method, methodCall) && methodCall instanceof PsiMethodCallExpression) {
|
||||
final PsiClassType[] thrownExceptions = method.getThrowsList().getReferencedTypes();
|
||||
if (thrownExceptions.length > 0) {
|
||||
PsiFile containingFile = (containingMethod == null ? methodCall : containingMethod).getContainingFile();
|
||||
final PsiFile containingFile = (containingMethod == null ? methodCall : containingMethod).getContainingFile();
|
||||
final MethodResolverProcessor processor = new MethodResolverProcessor((PsiMethodCallExpression)methodCall, containingFile);
|
||||
try {
|
||||
PsiScopesUtil.setupAndRunProcessor(processor, methodCall, false);
|
||||
|
||||
Reference in New Issue
Block a user