Detect continuation indent only if last opened brace is "("

This commit is contained in:
Yaroslav Lepenkin
2015-04-10 19:47:00 +03:00
parent 315c2f8228
commit 0011519715
2 changed files with 4 additions and 4 deletions
@@ -60,10 +60,10 @@ class ContinuationIndentDetector {
}
public boolean isContinuationIndent() {
if (myIncorrectBracketsOrder) {
if (myIncorrectBracketsOrder || myOpenedBrackets.isEmpty()) {
return false;
}
return myOpenedBrackets.contains(Bracket.LPARENTH);
return myOpenedBrackets.peek() == Bracket.LPARENTH;
}
@@ -101,7 +101,7 @@ public class ContinuationIndentDetectorTest extends TestCase {
" }\n" +
"}"
);
doCheckLinesWithContinuationIndents(7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
doCheckLinesWithContinuationIndents(11, 16);
}
public void testClosingBracesAtLineStart() {
@@ -127,7 +127,7 @@ public class ContinuationIndentDetectorTest extends TestCase {
" )}\n" +
")\n" +
"class T {}");
doCheckLinesWithContinuationIndents(1, 2, 3, 4, 5, 6);
doCheckLinesWithContinuationIndents(1, 2, 4, 5, 6);
}
private void doCheckLinesWithContinuationIndents(Integer... linesWithContinuationIndents) {