mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 15:06:56 +07:00
(no message)
This commit is contained in:
@@ -35,11 +35,11 @@ public class ErrorRethrownInspection extends StatementInspection {
|
||||
|
||||
public void visitTryStatement(PsiTryStatement statement) {
|
||||
super.visitTryStatement(statement);
|
||||
final PsiParameter[] parameters = statement.getCatchBlockParameters();
|
||||
final PsiCodeBlock[] catchBlocks = statement.getCatchBlocks();
|
||||
for (int i = 0; i < catchBlocks.length; i++) {
|
||||
final PsiParameter parameter = parameters[i];
|
||||
final PsiCodeBlock catchBlock = catchBlocks[i];
|
||||
PsiCatchSection[] catchSections = statement.getCatchSections();
|
||||
for (int i = 0; i < catchSections.length; i++) {
|
||||
final PsiParameter parameter = catchSections[i].getParameter();
|
||||
final PsiCodeBlock catchBlock = catchSections[i].getCatchBlock();
|
||||
if (parameter == null || catchBlock == null) continue;
|
||||
checkCatchBlock(parameter, catchBlock);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,11 +33,11 @@ public class ThreadDeathRethrownInspection extends StatementInspection {
|
||||
|
||||
public void visitTryStatement(PsiTryStatement statement) {
|
||||
super.visitTryStatement(statement);
|
||||
final PsiParameter[] parameters = statement.getCatchBlockParameters();
|
||||
final PsiCodeBlock[] catchBlocks = statement.getCatchBlocks();
|
||||
for (int i = 0; i < catchBlocks.length; i++) {
|
||||
final PsiParameter parameter = parameters[i];
|
||||
final PsiCodeBlock catchBlock = catchBlocks[i];
|
||||
PsiCatchSection[] catchSections = statement.getCatchSections();
|
||||
for (int i = 0; i < catchSections.length; i++) {
|
||||
final PsiParameter parameter = catchSections[i].getParameter();
|
||||
final PsiCodeBlock catchBlock = catchSections[i].getCatchBlock();
|
||||
if (parameter == null || catchBlock == null) continue;
|
||||
checkCatchBlock(parameter, catchBlock);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,11 +79,11 @@ public class UnusedCatchParameterInspection extends StatementInspection {
|
||||
}
|
||||
}
|
||||
|
||||
final PsiCodeBlock[] catchBlocks = statement.getCatchBlocks();
|
||||
final PsiParameter[] params = statement.getCatchBlockParameters();
|
||||
for (int i = 0; i < catchBlocks.length; i++) {
|
||||
final PsiCodeBlock block = catchBlocks[i];
|
||||
final PsiParameter param = params[i];
|
||||
PsiCatchSection[] catchSections = statement.getCatchSections();
|
||||
for (int i = 0; i < catchSections.length; i++) {
|
||||
final PsiParameter param = catchSections[i].getParameter();
|
||||
final PsiCodeBlock block = catchSections[i].getCatchBlock();
|
||||
if (param == null || block == null) continue;
|
||||
if (m_ignoreCatchBlocksWithComments) {
|
||||
final PsiElement[] children = block.getChildren();
|
||||
for (int j = 0; j < children.length; j++) {
|
||||
@@ -93,14 +93,12 @@ public class UnusedCatchParameterInspection extends StatementInspection {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (block != null && param != null) {
|
||||
final CatchParameterUsedVisitor visitor =
|
||||
new CatchParameterUsedVisitor(param);
|
||||
block.accept(visitor);
|
||||
final CatchParameterUsedVisitor visitor =
|
||||
new CatchParameterUsedVisitor(param);
|
||||
block.accept(visitor);
|
||||
|
||||
if (!visitor.isUsed()) {
|
||||
registerVariableError(param);
|
||||
}
|
||||
if (!visitor.isUsed()) {
|
||||
registerVariableError(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,12 +70,11 @@ public class UnnecessaryFinalOnLocalVariableInspection extends MethodInspection
|
||||
|
||||
public void visitTryStatement(PsiTryStatement statement) {
|
||||
super.visitTryStatement(statement);
|
||||
final PsiParameter[] catchBlockParameters =
|
||||
statement.getCatchBlockParameters();
|
||||
final PsiCodeBlock[] catchBlocks = statement.getCatchBlocks();
|
||||
for (int i = 0; i < catchBlocks.length; i++) {
|
||||
final PsiCodeBlock catchBlock = catchBlocks[i];
|
||||
final PsiParameter parameter = catchBlockParameters[i];
|
||||
PsiCatchSection[] catchSections = statement.getCatchSections();
|
||||
for (int i = 0; i < catchSections.length; i++) {
|
||||
final PsiParameter parameter = catchSections[i].getParameter();
|
||||
final PsiCodeBlock catchBlock = catchSections[i].getCatchBlock();
|
||||
if (parameter == null || catchBlock == null) continue;
|
||||
if (parameter.hasModifierProperty(PsiModifier.FINAL) &&
|
||||
!variableIsUsedInInnerClass(catchBlock, parameter)) {
|
||||
registerModifierError(PsiModifier.FINAL, parameter);
|
||||
|
||||
Reference in New Issue
Block a user