Remove dead code from ElseHandler in Indentation check. #1270
This commit is contained in:
parent
e1d06c0a92
commit
79694f0d50
2
pom.xml
2
pom.xml
|
|
@ -1148,8 +1148,6 @@
|
|||
|
||||
|
||||
<regex><pattern>.*.checks.imports.CustomImportOrderCheck</pattern><branchRate>98</branchRate><lineRate>100</lineRate></regex>
|
||||
|
||||
<regex><pattern>.*.checks.indentation.ElseHandler</pattern><branchRate>75</branchRate><lineRate>100</lineRate></regex>
|
||||
<regex><pattern>.*.checks.indentation.AbstractExpressionHandler</pattern><branchRate>91</branchRate><lineRate>97</lineRate></regex>
|
||||
<regex><pattern>.*.checks.indentation.MethodCallLineWrapHandler</pattern><branchRate>0</branchRate><lineRate>0</lineRate></regex>
|
||||
<regex><pattern>.*.checks.indentation.ObjectBlockHandler</pattern><branchRate>75</branchRate><lineRate>100</lineRate></regex>
|
||||
|
|
|
|||
|
|
@ -48,15 +48,12 @@ public class ElseHandler extends BlockParentHandler {
|
|||
// } else ...
|
||||
|
||||
final DetailAST ifAST = getMainAst().getParent();
|
||||
if (ifAST != null) {
|
||||
final DetailAST slist = ifAST.findFirstToken(TokenTypes.SLIST);
|
||||
if (slist != null) {
|
||||
final DetailAST lcurly = slist.getLastChild();
|
||||
if (lcurly != null
|
||||
&& lcurly.getLineNo() == getMainAst().getLineNo()) {
|
||||
// indentation checked as part of LITERAL IF check
|
||||
return;
|
||||
}
|
||||
final DetailAST slist = ifAST.findFirstToken(TokenTypes.SLIST);
|
||||
if (slist != null) {
|
||||
final DetailAST lcurly = slist.getLastChild();
|
||||
if (lcurly.getLineNo() == getMainAst().getLineNo()) {
|
||||
// indentation checked as part of LITERAL IF check
|
||||
return;
|
||||
}
|
||||
}
|
||||
super.checkToplevelToken();
|
||||
|
|
|
|||
Loading…
Reference in New Issue