Remove dead code from ObjectBlockHandler in Indentation check. #1270

This commit is contained in:
Michal Kordas 2015-07-20 23:26:12 +02:00 committed by Roman Ivanov
parent 9988d4d007
commit 81d67e4777
2 changed files with 2 additions and 10 deletions

View File

@ -1149,7 +1149,7 @@
<regex><pattern>.*.checks.imports.CustomImportOrderCheck</pattern><branchRate>98</branchRate><lineRate>100</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>
<regex><pattern>.*.checks.indentation.MethodDefHandler</pattern><branchRate>87</branchRate><lineRate>100</lineRate></regex>
<regex><pattern>.*.checks.indentation.SynchronizedHandler</pattern><branchRate>100</branchRate><lineRate>100</lineRate></regex>
<regex><pattern>.*.checks.javadoc.AbstractJavadocCheck</pattern><branchRate>90</branchRate><lineRate>93</lineRate></regex>

View File

@ -88,22 +88,14 @@ public class ObjectBlockHandler extends BlockParentHandler {
super.checkIndentation();
}
@Override
protected boolean rcurlyMustStart() {
return false;
}
@Override
protected void checkRCurly() {
final DetailAST lcurly = getLCurly();
final DetailAST rcurly = getRCurly();
final int rcurlyPos = expandedTabsColumnNo(rcurly);
final IndentLevel level = curlyLevel();
level.addAcceptedIndent(level.getFirstIndentLevel() + getLineWrappingIndent());
if (!level.accept(rcurlyPos)
&& (rcurlyMustStart() || startsLine(rcurly))
&& !areOnSameLine(rcurly, lcurly)) {
if (!level.accept(rcurlyPos) && startsLine(rcurly)) {
logError(rcurly, "rcurly", rcurlyPos, curlyLevel());
}
}