Remove dead code from ArrayInitHandler in Indentation check. #1270

This commit is contained in:
Michal Kordas 2015-07-17 21:38:31 +02:00 committed by Roman Ivanov
parent 4c078ba710
commit e59080b695
2 changed files with 3 additions and 5 deletions

View File

@ -1161,7 +1161,7 @@
<regex><pattern>.*.checks.imports.CustomImportOrderCheck</pattern><branchRate>98</branchRate><lineRate>100</lineRate></regex>
<regex><pattern>.*.checks.indentation.ArrayInitHandler</pattern><branchRate>83</branchRate><lineRate>97</lineRate></regex>
<regex><pattern>.*.checks.indentation.ArrayInitHandler</pattern><branchRate>87</branchRate><lineRate>100</lineRate></regex>
<regex><pattern>.*.checks.indentation.BlockParentHandler</pattern><branchRate>86</branchRate><lineRate>98</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>

View File

@ -49,11 +49,9 @@ public class ArrayInitHandler extends BlockParentHandler {
// note: assumes new or assignment is line to align with
return new IndentLevel(getLineStart(parentAST));
}
else if (getParent() instanceof ArrayInitHandler) {
return ((ArrayInitHandler) getParent()).getChildrenExpectedLevel();
}
else {
return getParent().getLevel();
// at this point getParent() is instance of ArrayInitHandler
return ((ArrayInitHandler) getParent()).getChildrenExpectedLevel();
}
}