Remove dead code from NewHandler in Indentation check. #1270
This commit is contained in:
parent
48cdb1feb4
commit
d4a862ea09
1
pom.xml
1
pom.xml
|
|
@ -1160,7 +1160,6 @@
|
|||
<regex><pattern>.*.checks.indentation.LineWrappingHandler</pattern><branchRate>87</branchRate><lineRate>95</lineRate></regex>
|
||||
<regex><pattern>.*.checks.indentation.MethodCallLineWrapHandler</pattern><branchRate>0</branchRate><lineRate>0</lineRate></regex>
|
||||
<regex><pattern>.*.checks.indentation.MethodDefHandler</pattern><branchRate>87</branchRate><lineRate>100</lineRate></regex>
|
||||
<regex><pattern>.*.checks.indentation.NewHandler</pattern><branchRate>83</branchRate><lineRate>77</lineRate></regex>
|
||||
<regex><pattern>.*.checks.indentation.ObjectBlockHandler</pattern><branchRate>75</branchRate><lineRate>100</lineRate></regex>
|
||||
<regex><pattern>.*.checks.indentation.SynchronizedHandler</pattern><branchRate>100</branchRate><lineRate>100</lineRate></regex>
|
||||
|
||||
|
|
|
|||
|
|
@ -50,34 +50,7 @@ public class NewHandler extends AbstractExpressionHandler {
|
|||
}
|
||||
|
||||
final DetailAST lparen = getMainAst().findFirstToken(TokenTypes.LPAREN);
|
||||
final DetailAST rparen = getMainAst().findFirstToken(TokenTypes.RPAREN);
|
||||
checkLParen(lparen);
|
||||
|
||||
if (rparen == null || lparen == null
|
||||
|| rparen.getLineNo() == lparen.getLineNo()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (getMainAst().getType() != TokenTypes.OBJBLOCK) {
|
||||
return;
|
||||
}
|
||||
|
||||
// if this method name is on the same line as a containing
|
||||
// method, don't indent, this allows expressions like:
|
||||
// method("my str" + method2(
|
||||
// "my str2"));
|
||||
// as well as
|
||||
// method("my str" +
|
||||
// method2(
|
||||
// "my str2"));
|
||||
//
|
||||
|
||||
checkExpressionSubtree(
|
||||
getMainAst().findFirstToken(TokenTypes.ELIST),
|
||||
new IndentLevel(getLevel(), getBasicOffset()),
|
||||
false, true);
|
||||
|
||||
checkRParen(lparen, rparen);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue