mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user