SimpleJavaBlock: removed unnecessary strategy calculation - it will be overwritten in AbstractJavaBlock#processChild after retrieving alignment from AbstractJavaBlock#arrangeChildWrap and wrapping it into strategy. Field in column alignment will be retrived in arrangeChildWrap method by invoking getVariableDeclarationSubElementAlignment.

This commit is contained in:
Yaroslav Lepenkin
2014-12-04 21:13:00 +02:00
parent e3be03110f
commit 2a2b009535
@@ -85,7 +85,7 @@ public class SimpleJavaBlock extends AbstractJavaBlock {
while (myCurrentChild != null) {
if (isNotEmptyNode(myCurrentChild)) {
final ASTNode astNode = myCurrentChild;
AlignmentStrategy alignmentStrategyToUse = getAlignmentStrategy(myCurrentChild);
AlignmentStrategy alignmentStrategyToUse = AlignmentStrategy.wrap(chooseAlignment(myReservedAlignment, myReservedAlignment2, myCurrentChild));
myCurrentChild = processChild(result, astNode, alignmentStrategyToUse, childWrap, myCurrentIndent, myCurrentOffset);
if (astNode != myCurrentChild && myCurrentChild != null) {
myCurrentOffset = myCurrentChild.getTextRange().getStartOffset();
@@ -124,12 +124,6 @@ public class SimpleJavaBlock extends AbstractJavaBlock {
}
}
private AlignmentStrategy getAlignmentStrategy(ASTNode child) {
return JavaElementType.FIELD == myNode.getElementType()
? myAlignmentStrategy
: AlignmentStrategy.wrap(chooseAlignment(myReservedAlignment, myReservedAlignment2, child));
}
private boolean isNotEmptyNode(@NotNull ASTNode child) {
return !FormatterUtil.containsWhiteSpacesOnly(child) && child.getTextLength() > 0;
}