View | Details | Raw Unified | Return to bug 287462
Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java (-6 / +5 lines)
Lines 10773-10780 Link Here
10773
	);
10773
	);
10774
}
10774
}
10775
// duplicate bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=201022
10775
// duplicate bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=201022
10776
// TODO (frederic) Enable when bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=287462 will be fixed
10776
public void testBug201022() throws JavaModelException {
10777
public void _testBug201022() throws JavaModelException {
10778
	this.formatterPrefs.join_wrapped_lines = false;
10777
	this.formatterPrefs.join_wrapped_lines = false;
10779
	String source = 
10778
	String source = 
10780
		"public class Test {\n" + 
10779
		"public class Test {\n" + 
Lines 10792-10801 Link Here
10792
		"\n" + 
10791
		"\n" + 
10793
		"	void foo() {\n" + 
10792
		"	void foo() {\n" + 
10794
		"		String sQuery =\n" + 
10793
		"		String sQuery =\n" + 
10795
		"				\"select * \" +\n" + 
10794
		"			\"select * \" +\n" + 
10796
		"				\"from person p, address a \" +\n" + 
10795
		"			\"from person p, address a \" +\n" + 
10797
		"				\"where p.person_id = a.person_id \" +\n" + 
10796
		"			\"where p.person_id = a.person_id \" +\n" + 
10798
		"				\"and p.person_id = ?\";\n" + 
10797
		"			\"and p.person_id = ?\";\n" + 
10799
		"	}\n" + 
10798
		"	}\n" + 
10800
		"}\n"
10799
		"}\n"
10801
	);
10800
	);
(-)formatter/org/eclipse/jdt/internal/formatter/Scribe.java (-2 / +5 lines)
Lines 818-826 Link Here
818
	}
818
	}
819
819
820
	int getCurrentIndentation(int start) {
820
	int getCurrentIndentation(int start) {
821
		int linePtr = -Arrays.binarySearch(this.lineEnds, start);
821
		int linePtr = Arrays.binarySearch(this.lineEnds, start);
822
		if (linePtr < 0) {
823
			linePtr = -linePtr - 1;
824
		}
822
		int offset = 0;
825
		int offset = 0;
823
		int beginningOfLine = getLineEnd(linePtr - 1);
826
		int beginningOfLine = getLineEnd(linePtr);
824
		if (beginningOfLine == -1) {
827
		if (beginningOfLine == -1) {
825
			beginningOfLine = 0;
828
			beginningOfLine = 0;
826
		}
829
		}

Return to bug 287462