View | Details | Raw Unified | Return to bug 286912 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java (-10 / +300 lines)
Lines 10603-10614 Link Here
10603
		"\n" + 
10603
		"\n" + 
10604
		"	void foo() {\n" + 
10604
		"	void foo() {\n" + 
10605
		"		String x = \"select x \"\n" + 
10605
		"		String x = \"select x \"\n" + 
10606
		"				+ \"from y \"\n" + 
10606
		"					+ \"from y \"\n" + 
10607
		"				+ \"where z=a\";\n" + 
10607
		"					+ \"where z=a\";\n" + 
10608
		"	}\n" + 
10608
		"	}\n" + 
10609
		"}\n"
10609
		"}\n"
10610
	);
10610
	);
10611
}
10611
}
10612
public void testBug198074b() throws JavaModelException {
10613
	this.formatterPrefs.join_wrapped_lines = false;
10614
	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
10615
	String source = 
10616
		"public class Test {\n" + 
10617
		"\n" + 
10618
		"	void foo() {\n" + 
10619
		"String x = \"select x \"\n" + 
10620
		"         + \"from y \"\n" + 
10621
		"         + \"where z=a\";\n" + 
10622
		"	}\n" + 
10623
		"}\n";
10624
	formatSource(source,
10625
		"public class Test {\n" + 
10626
		"\n" + 
10627
		"    void foo() {\n" + 
10628
		"        String x = \"select x \"\n" + 
10629
		"                 + \"from y \"\n" + 
10630
		"                 + \"where z=a\";\n" + 
10631
		"    }\n" + 
10632
		"}\n"
10633
	);
10634
}
10612
// another test case put in bug's comment 1
10635
// another test case put in bug's comment 1
10613
public void testBug198074_c1() throws JavaModelException {
10636
public void testBug198074_c1() throws JavaModelException {
10614
	this.formatterPrefs.join_wrapped_lines = false;
10637
	this.formatterPrefs.join_wrapped_lines = false;
Lines 10632-10644 Link Here
10632
		"			// we need x\n" + 
10655
		"			// we need x\n" + 
10633
		"			// we need a select\n" + 
10656
		"			// we need a select\n" + 
10634
		"			return \"select x \"\n" + 
10657
		"			return \"select x \"\n" + 
10635
		"					+ \"from X\";\n" + 
10658
		"			+ \"from X\";\n" + 
10636
		"		}\n" + 
10659
		"		}\n" + 
10637
		"		return null;\n" + 
10660
		"		return null;\n" + 
10638
		"	}\n" + 
10661
		"	}\n" + 
10639
		"}\n"
10662
		"}\n"
10640
	);
10663
	);
10641
}
10664
}
10665
public void testBug198074_c1b() throws JavaModelException {
10666
	this.formatterPrefs.join_wrapped_lines = false;
10667
	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
10668
	String source = 
10669
		"public class Test {\n" + 
10670
		"\n" + 
10671
		"	String foo(boolean enabled) {\n" + 
10672
		"if (enabled)\n" + 
10673
		"{\n" + 
10674
		"   // we need x\n" + 
10675
		"   // we need a select\n" + 
10676
		"   return \"select x \"\n" + 
10677
		"        + \"from X\";}\n" + 
10678
		"	return null;}\n" + 
10679
		"}\n";
10680
	formatSource(source,
10681
		"public class Test {\n" + 
10682
		"\n" + 
10683
		"    String foo(boolean enabled) {\n" + 
10684
		"        if (enabled) {\n" + 
10685
		"            // we need x\n" + 
10686
		"            // we need a select\n" + 
10687
		"            return \"select x \"\n" + 
10688
		"                 + \"from X\";\n" + 
10689
		"        }\n" + 
10690
		"        return null;\n" + 
10691
		"    }\n" + 
10692
		"}\n"
10693
	);
10694
}
10642
// another test case put in bug's comment 3
10695
// another test case put in bug's comment 3
10643
public void testBug198074_c3() throws JavaModelException {
10696
public void testBug198074_c3() throws JavaModelException {
10644
	this.formatterPrefs.join_wrapped_lines = false;
10697
	this.formatterPrefs.join_wrapped_lines = false;
Lines 10660-10674 Link Here
10660
		"\n" + 
10713
		"\n" + 
10661
		"	public String toString() {\n" + 
10714
		"	public String toString() {\n" + 
10662
		"		return \"YAD01: \"\n" + 
10715
		"		return \"YAD01: \"\n" + 
10663
		"				+ \" nommbr=\'\" + getName() + \"\'\"\n" + 
10716
		"		+ \" nommbr=\'\" + getName() + \"\'\"\n" + 
10664
		"				+ \" nomgrp=\'\" + getService().getArgtbl() + \"\'\"\n" + 
10717
		"		+ \" nomgrp=\'\" + getService().getArgtbl() + \"\'\"\n" + 
10665
		"				+ \" typmbr=\'\" + getMemberType().getArgument() + \"\'\"\n" + 
10718
		"		+ \" typmbr=\'\" + getMemberType().getArgument() + \"\'\"\n" + 
10666
		"				+ \" srcpat=\'\" + getPhysicalPath() + \"\'\"\n" + 
10719
		"		+ \" srcpat=\'\" + getPhysicalPath() + \"\'\"\n" + 
10667
		"				+ \" nommdl=\'\" + getModel() + \"\'\";\n" + 
10720
		"		+ \" nommdl=\'\" + getModel() + \"\'\";\n" + 
10668
		"	}\n" + 
10721
		"	}\n" + 
10669
		"}\n"
10722
		"}\n"
10670
	);
10723
	);
10671
}
10724
}
10725
public void testBug198074_c3b() throws JavaModelException {
10726
	this.formatterPrefs.join_wrapped_lines = false;
10727
	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
10728
	String source = 
10729
		"public class Test {\n" + 
10730
		"\n" + 
10731
		"public String toString() {\n" + 
10732
		"        return \"YAD01: \"\n" + 
10733
		"             + \" nommbr=\'\"+getName()+\"\'\"\n" + 
10734
		"             + \" nomgrp=\'\"+getService().getArgtbl()+\"\'\"\n" + 
10735
		"             + \" typmbr=\'\"+getMemberType().getArgument()+\"\'\"\n" + 
10736
		"             + \" srcpat=\'\"+getPhysicalPath()+\"\'\"\n" + 
10737
		"             + \" nommdl=\'\"+getModel()+\"\'\"\n" + 
10738
		"        ;\n" + 
10739
		"}\n" + 
10740
		"}\n";
10741
	formatSource(source,
10742
		"public class Test {\n" + 
10743
		"\n" + 
10744
		"    public String toString() {\n" + 
10745
		"        return \"YAD01: \"\n" + 
10746
		"             + \" nommbr=\'\" + getName() + \"\'\"\n" + 
10747
		"             + \" nomgrp=\'\" + getService().getArgtbl() + \"\'\"\n" + 
10748
		"             + \" typmbr=\'\" + getMemberType().getArgument() + \"\'\"\n" + 
10749
		"             + \" srcpat=\'\" + getPhysicalPath() + \"\'\"\n" + 
10750
		"             + \" nommdl=\'\" + getModel() + \"\'\";\n" + 
10751
		"    }\n" + 
10752
		"}\n"
10753
	);
10754
}
10672
public void testBug198074_comments() throws JavaModelException {
10755
public void testBug198074_comments() throws JavaModelException {
10673
	this.formatterPrefs.join_lines_in_comments = false;
10756
	this.formatterPrefs.join_lines_in_comments = false;
10674
	String source = 
10757
	String source = 
Lines 10764-10771 Link Here
10764
		"	void foo() {\n" + 
10847
		"	void foo() {\n" + 
10765
		"		int a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0;\n" + 
10848
		"		int a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0;\n" + 
10766
		"		if ((a == b && b == c) &&\n" + 
10849
		"		if ((a == b && b == c) &&\n" + 
10767
		"				(d == e) &&\n" + 
10850
		"			(d == e) &&\n" + 
10768
		"				(f == g && h == i)) {\n" + 
10851
		"			(f == g && h == i)) {\n" + 
10769
		"		}\n" + 
10852
		"		}\n" + 
10770
		"	}\n" + 
10853
		"	}\n" + 
10771
		"}\n"
10854
		"}\n"
Lines 10914-10917 Link Here
10914
		"}\n"
10997
		"}\n"
10915
	);
10998
	);
10916
}
10999
}
11000
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=286668
11001
public void testBug286608() throws JavaModelException {
11002
	this.formatterPrefs.join_wrapped_lines = false;
11003
	String source = 
11004
		"public class Test {\n" + 
11005
		"\n" + 
11006
		"	void foo() {\n" + 
11007
		"		StringBuilder builder = new StringBuilder();\n" + 
11008
		"		builder.append(\"abc\").append(\"def\").append(\"ghi\").append(\"jkl\").append(\"mno\")\n" + 
11009
		"		.append(\"pqr\").append(\"stu\").append(\"vwx\").append(\"yz\");\n" + 
11010
		"	}\n" + 
11011
		"}\n";
11012
	formatSource(source,
11013
		"public class Test {\n" + 
11014
		"\n" + 
11015
		"	void foo() {\n" + 
11016
		"		StringBuilder builder = new StringBuilder();\n" + 
11017
		"		builder.append(\"abc\").append(\"def\").append(\"ghi\").append(\"jkl\").append(\n" + 
11018
		"				\"mno\")\n" + 
11019
		"		.append(\"pqr\").append(\"stu\").append(\"vwx\").append(\"yz\");\n" + 
11020
		"	}\n" + 
11021
		"}\n"
11022
	);
11023
}
11024
public void testBug286608b() throws JavaModelException {
11025
	this.formatterPrefs.join_wrapped_lines = false;
11026
	String source = 
11027
		"public class Test {\n" + 
11028
		"\n" + 
11029
		"	void foo() {\n" + 
11030
		"		StringBuilder builder = new StringBuilder();\n" + 
11031
		"		builder.append(\"abc\").append(\"def\")\n" + 
11032
		"		.append(\"ghi\").append(\"jkl\").append(\"mno\")\n" + 
11033
		"		.append(\"pqr\").append(\"stu\").append(\"vwx\").append(\"yz\");\n" + 
11034
		"	}\n" + 
11035
		"}\n";
11036
	formatSource(source);
11037
}
11038
public void testBug286608c() throws JavaModelException {
11039
	this.formatterPrefs.join_wrapped_lines = false;
11040
	String source = 
11041
		"public class Test {\n" + 
11042
		"\n" + 
11043
		"	void foo() {\n" + 
11044
		"		StringBuilder builder = new StringBuilder();\n" + 
11045
		"		builder.append(\"abc\").append(\"def\")\n" + 
11046
		"		.append(\"ghi\").append(\"jkl\").append(\"mno\")\n" + 
11047
		"		.append(\"pqr\").append(\"stu\").append(\"vwx\")\n" + 
11048
		"		.append(\"yz\");\n" + 
11049
		"	}\n" + 
11050
		"}\n";
11051
	formatSource(source);
11052
}
11053
public void testBug286608_40w() throws JavaModelException {
11054
	this.formatterPrefs.join_wrapped_lines = false;
11055
	this.formatterPrefs.page_width = 40;
11056
	String source = 
11057
		"public class Test {\n" + 
11058
		"\n" + 
11059
		"	void foo() {\n" + 
11060
		"		StringBuilder builder = new StringBuilder();\n" + 
11061
		"		builder.append(\"abc\").append(\"def\").append(\"ghi\").append(\"jkl\").append(\"mno\")\n" + 
11062
		"		.append(\"pqr\").append(\"stu\").append(\"vwx\").append(\"yz\");\n" + 
11063
		"	}\n" + 
11064
		"}\n";
11065
	formatSource(source,
11066
		"public class Test {\n" + 
11067
		"\n" + 
11068
		"	void foo() {\n" + 
11069
		"		StringBuilder builder = new StringBuilder();\n" + 
11070
		"		builder.append(\"abc\").append(\n" + 
11071
		"				\"def\").append(\"ghi\")\n" + 
11072
		"				.append(\"jkl\").append(\n" + 
11073
		"						\"mno\")\n" + 
11074
		"		.append(\"pqr\").append(\"stu\")\n" + 
11075
		"				.append(\"vwx\").append(\n" + 
11076
		"						\"yz\");\n" + 
11077
		"	}\n" + 
11078
		"}\n"
11079
	);
11080
}
11081
public void testBug286608b_40w() throws JavaModelException {
11082
	this.formatterPrefs.join_wrapped_lines = false;
11083
	this.formatterPrefs.page_width = 40;
11084
	String source = 
11085
		"public class Test {\n" + 
11086
		"\n" + 
11087
		"	void foo() {\n" + 
11088
		"		StringBuilder builder = new StringBuilder();\n" + 
11089
		"		builder.append(\"abc\").append(\"def\")\n" + 
11090
		"		.append(\"ghi\").append(\"jkl\").append(\"mno\")\n" + 
11091
		"		.append(\"pqr\").append(\"stu\").append(\"vwx\").append(\"yz\");\n" + 
11092
		"	}\n" + 
11093
		"}\n";
11094
	formatSource(source,
11095
		"public class Test {\n" + 
11096
		"\n" + 
11097
		"	void foo() {\n" + 
11098
		"		StringBuilder builder = new StringBuilder();\n" + 
11099
		"		builder.append(\"abc\").append(\n" + 
11100
		"				\"def\")\n" + 
11101
		"		.append(\"ghi\").append(\"jkl\")\n" + 
11102
		"				.append(\"mno\")\n" + 
11103
		"		.append(\"pqr\").append(\"stu\")\n" + 
11104
		"				.append(\"vwx\").append(\n" + 
11105
		"						\"yz\");\n" + 
11106
		"	}\n" + 
11107
		"}\n"
11108
	);
11109
}
11110
public void testBug286608c_40w() throws JavaModelException {
11111
	this.formatterPrefs.join_wrapped_lines = false;
11112
	this.formatterPrefs.page_width = 40;
11113
	String source = 
11114
		"public class Test {\n" + 
11115
		"\n" + 
11116
		"	void foo() {\n" + 
11117
		"		StringBuilder builder = new StringBuilder();\n" + 
11118
		"		builder.append(\"abc\").append(\"def\")\n" + 
11119
		"		.append(\"ghi\").append(\"jkl\").append(\"mno\")\n" + 
11120
		"		.append(\"pqr\").append(\"stu\").append(\"vwx\")\n" + 
11121
		"		.append(\"yz\");\n" + 
11122
		"	}\n" + 
11123
		"}\n";
11124
	formatSource(source,
11125
		"public class Test {\n" + 
11126
		"\n" + 
11127
		"	void foo() {\n" + 
11128
		"		StringBuilder builder = new StringBuilder();\n" + 
11129
		"		builder.append(\"abc\").append(\n" + 
11130
		"				\"def\")\n" + 
11131
		"		.append(\"ghi\").append(\"jkl\")\n" + 
11132
		"				.append(\"mno\")\n" + 
11133
		"		.append(\"pqr\").append(\"stu\")\n" + 
11134
		"				.append(\"vwx\")\n" + 
11135
		"		.append(\"yz\");\n" + 
11136
		"	}\n" + 
11137
		"}\n"
11138
	);
11139
}
11140
public void testBug286608_60w() throws JavaModelException {
11141
	this.formatterPrefs.join_wrapped_lines = false;
11142
	this.formatterPrefs.page_width = 60;
11143
	String source = 
11144
		"public class Test {\n" + 
11145
		"\n" + 
11146
		"	void foo() {\n" + 
11147
		"		StringBuilder builder = new StringBuilder();\n" + 
11148
		"		builder.append(\"abc\").append(\"def\").append(\"ghi\").append(\"jkl\").append(\"mno\")\n" + 
11149
		"		.append(\"pqr\").append(\"stu\").append(\"vwx\").append(\"yz\");\n" + 
11150
		"	}\n" + 
11151
		"}\n";
11152
	formatSource(source,
11153
		"public class Test {\n" + 
11154
		"\n" + 
11155
		"	void foo() {\n" + 
11156
		"		StringBuilder builder = new StringBuilder();\n" + 
11157
		"		builder.append(\"abc\").append(\"def\").append(\"ghi\")\n" + 
11158
		"				.append(\"jkl\").append(\"mno\")\n" + 
11159
		"		.append(\"pqr\").append(\"stu\").append(\"vwx\").append(\n" + 
11160
		"				\"yz\");\n" + 
11161
		"	}\n" + 
11162
		"}\n"
11163
	);
11164
}
11165
public void testBug286608b_60w() throws JavaModelException {
11166
	this.formatterPrefs.join_wrapped_lines = false;
11167
	this.formatterPrefs.page_width = 60;
11168
	String source = 
11169
		"public class Test {\n" + 
11170
		"\n" + 
11171
		"	void foo() {\n" + 
11172
		"		StringBuilder builder = new StringBuilder();\n" + 
11173
		"		builder.append(\"abc\").append(\"def\")\n" + 
11174
		"		.append(\"ghi\").append(\"jkl\").append(\"mno\")\n" + 
11175
		"		.append(\"pqr\").append(\"stu\").append(\"vwx\").append(\"yz\");\n" + 
11176
		"	}\n" + 
11177
		"}\n";
11178
	formatSource(source,
11179
		"public class Test {\n" + 
11180
		"\n" + 
11181
		"	void foo() {\n" + 
11182
		"		StringBuilder builder = new StringBuilder();\n" + 
11183
		"		builder.append(\"abc\").append(\"def\")\n" + 
11184
		"		.append(\"ghi\").append(\"jkl\").append(\"mno\")\n" + 
11185
		"		.append(\"pqr\").append(\"stu\").append(\"vwx\").append(\n" + 
11186
		"				\"yz\");\n" + 
11187
		"	}\n" + 
11188
		"}\n"
11189
	);
11190
}
11191
public void testBug286608c_60w() throws JavaModelException {
11192
	this.formatterPrefs.join_wrapped_lines = false;
11193
	this.formatterPrefs.page_width = 60;
11194
	String source = 
11195
		"public class Test {\n" + 
11196
		"\n" + 
11197
		"	void foo() {\n" + 
11198
		"		StringBuilder builder = new StringBuilder();\n" + 
11199
		"		builder.append(\"abc\").append(\"def\")\n" + 
11200
		"		.append(\"ghi\").append(\"jkl\").append(\"mno\")\n" + 
11201
		"		.append(\"pqr\").append(\"stu\").append(\"vwx\")\n" + 
11202
		"		.append(\"yz\");\n" + 
11203
		"	}\n" + 
11204
		"}\n";
11205
	formatSource(source);
11206
}
10917
}
11207
}
(-)formatter/org/eclipse/jdt/internal/formatter/align/Alignment.java (-1 lines)
Lines 45-51 Link Here
45
	public int shiftBreakIndentationLevel;
45
	public int shiftBreakIndentationLevel;
46
	public int[] fragmentBreaks;
46
	public int[] fragmentBreaks;
47
	public boolean wasSplit;
47
	public boolean wasSplit;
48
	public boolean useBreakIndentation = false; // used while preserving line breaks
49
48
50
	public Scribe scribe;
49
	public Scribe scribe;
51
50
(-)formatter/org/eclipse/jdt/internal/formatter/Location.java (+2 lines)
Lines 18-23 Link Here
18
public class Location {
18
public class Location {
19
19
20
	public int inputOffset;
20
	public int inputOffset;
21
	public int inputColumn;
21
	public int outputLine;
22
	public int outputLine;
22
	public int outputColumn;
23
	public int outputColumn;
23
	public int outputIndentationLevel;
24
	public int outputIndentationLevel;
Lines 42-47 Link Here
42
		this.outputColumn = scribe.column;
43
		this.outputColumn = scribe.column;
43
		this.outputLine = scribe.line;
44
		this.outputLine = scribe.line;
44
		this.inputOffset = sourceRestart;
45
		this.inputOffset = sourceRestart;
46
		this.inputColumn = scribe.getCurrentIndentation(sourceRestart);
45
		this.outputIndentationLevel = scribe.indentationLevel;
47
		this.outputIndentationLevel = scribe.indentationLevel;
46
		this.lastNumberOfNewLines = scribe.lastNumberOfNewLines;
48
		this.lastNumberOfNewLines = scribe.lastNumberOfNewLines;
47
		this.needSpace = scribe.needSpace;
49
		this.needSpace = scribe.needSpace;
(-)formatter/org/eclipse/jdt/internal/formatter/Scribe.java (-2 / +41 lines)
Lines 817-822 Link Here
817
		return offset;
817
		return offset;
818
	}
818
	}
819
819
820
	int getCurrentIndentation(int start) {
821
		int linePtr = -Arrays.binarySearch(this.lineEnds, start);
822
		int offset = 0;
823
		int beginningOfLine = getLineEnd(linePtr - 1);
824
		if (beginningOfLine == -1) {
825
			beginningOfLine = 0;
826
		}
827
		char[] source = this.scanner.source;
828
829
		for (int i=beginningOfLine; i<start; i++) {
830
			char currentCharacter = source[i];
831
			switch (currentCharacter) {
832
				case '\t' :
833
					offset += this.tabLength;
834
					break;
835
				case '\r' :
836
				case '\n' :
837
					break;
838
				case ' ':
839
					offset++;
840
					break;
841
				default:
842
					return offset;
843
			}
844
		}
845
		return offset;
846
	}
847
820
	public String getEmptyLines(int linesNumber) {
848
	public String getEmptyLines(int linesNumber) {
821
		if (this.nlsTagCounter > 0) {
849
		if (this.nlsTagCounter > 0) {
822
			return Util.EMPTY_STRING;
850
			return Util.EMPTY_STRING;
Lines 947-956 Link Here
947
				// insert a new line only if it has not been already done before
975
				// insert a new line only if it has not been already done before
948
				// see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=283476
976
				// see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=283476
949
				if (this.lastNumberOfNewLines == 0) {
977
				if (this.lastNumberOfNewLines == 0) {
978
					// Reset indentation level to the location output
979
					this.indentationLevel = this.currentAlignment.location.outputIndentationLevel;
980
					this.numberOfIndentations = this.currentAlignment.location.numberOfIndentations;
981
					this.formatter.lastLocalDeclarationSourceStart = this.currentAlignment.location.lastLocalDeclarationSourceStart;
982
					// Create new line keeping the existing indentation
950
					StringBuffer buffer = new StringBuffer(getNewLine());
983
					StringBuffer buffer = new StringBuffer(getNewLine());
951
					if (this.currentAlignment.useBreakIndentation) {
984
					int currentColumn = getCurrentIndentation(this.scanner.currentPosition);
985
					Alignment rootAlignment = this.currentAlignment;
986
					while (rootAlignment.enclosing != null) {
987
						rootAlignment = rootAlignment.enclosing;
988
					}
989
					Location location = rootAlignment.location;
990
					if (currentColumn > location.inputColumn) {
952
						int savedIndentation = this.indentationLevel;
991
						int savedIndentation = this.indentationLevel;
953
						this.indentationLevel = this.currentAlignment.breakIndentationLevel;
992
						this.indentationLevel += currentColumn - location.inputColumn;
954
						printIndentationIfNecessary(buffer);
993
						printIndentationIfNecessary(buffer);
955
						this.indentationLevel = savedIndentation;
994
						this.indentationLevel = savedIndentation;
956
					} else {
995
					} else {
(-)formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java (-5 / +3 lines)
Lines 427-437 Link Here
427
		BinaryExpressionFragmentBuilder builder = buildFragments(binaryExpression, scope);
427
		BinaryExpressionFragmentBuilder builder = buildFragments(binaryExpression, scope);
428
		final int fragmentsSize = builder.size();
428
		final int fragmentsSize = builder.size();
429
429
430
		if ((builder.realFragmentsSize() > 1 || fragmentsSize > 2) && numberOfParens == 0) {
430
		if ((builder.realFragmentsSize() > 1 || fragmentsSize > 4) && numberOfParens == 0) {
431
			this.scribe.printComment();
431
			Alignment binaryExpressionAlignment = this.scribe.createAlignment("binaryExpressionAlignment", this.preferences.alignment_for_binary_expression, Alignment.R_OUTERMOST, fragmentsSize, this.scribe.scanner.currentPosition); //$NON-NLS-1$
432
			Alignment binaryExpressionAlignment = this.scribe.createAlignment("binaryExpressionAlignment", this.preferences.alignment_for_binary_expression, Alignment.R_OUTERMOST, fragmentsSize, this.scribe.scanner.currentPosition); //$NON-NLS-1$
432
			this.scribe.enterAlignment(binaryExpressionAlignment);
433
			this.scribe.enterAlignment(binaryExpressionAlignment);
433
			binaryExpressionAlignment.useBreakIndentation = true;
434
			this.scribe.printComment();
435
			boolean ok = false;
434
			boolean ok = false;
436
			ASTNode[] fragments = builder.fragments();
435
			ASTNode[] fragments = builder.fragments();
437
			int[] operators = builder.operators();
436
			int[] operators = builder.operators();
Lines 4862-4873 Link Here
4862
			manageOpeningParenthesizedExpression(stringLiteral, numberOfParens);
4861
			manageOpeningParenthesizedExpression(stringLiteral, numberOfParens);
4863
		}
4862
		}
4864
4863
4864
		this.scribe.printComment();
4865
		ASTNode[] fragments = stringLiteral.literals;
4865
		ASTNode[] fragments = stringLiteral.literals;
4866
		int fragmentsSize = stringLiteral.counter;
4866
		int fragmentsSize = stringLiteral.counter;
4867
		Alignment binaryExpressionAlignment = this.scribe.createAlignment("binaryExpressionAlignment", this.preferences.alignment_for_binary_expression, Alignment.R_OUTERMOST, fragmentsSize, this.scribe.scanner.currentPosition); //$NON-NLS-1$
4867
		Alignment binaryExpressionAlignment = this.scribe.createAlignment("binaryExpressionAlignment", this.preferences.alignment_for_binary_expression, Alignment.R_OUTERMOST, fragmentsSize, this.scribe.scanner.currentPosition); //$NON-NLS-1$
4868
		this.scribe.enterAlignment(binaryExpressionAlignment);
4868
		this.scribe.enterAlignment(binaryExpressionAlignment);
4869
		binaryExpressionAlignment.useBreakIndentation = true;
4870
		this.scribe.printComment();
4871
		boolean ok = false;
4869
		boolean ok = false;
4872
		do {
4870
		do {
4873
			try {
4871
			try {

Return to bug 286912