Link Here
|
6339 |
"}\n"); |
6339 |
"}\n"); |
6340 |
} |
6340 |
} |
6341 |
|
6341 |
|
|
|
6342 |
/** |
6343 |
* @bug 305830: [formatter] Turning off formatting changes comment's formatting |
6344 |
* @test Verify that turning off formatting in a javadoc does not screw up its indentation |
6345 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=305830" |
6346 |
*/ |
6347 |
public void testBug305830() { |
6348 |
this.formatterPrefs = null; |
6349 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "40"); |
6350 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "40"); |
6351 |
String source = |
6352 |
"public class X01 {\n" + |
6353 |
"void foo() {\n" + |
6354 |
"bar(\"a non-nls string\", 0 /*a comment*/); //$NON-NLS-1$\n" + |
6355 |
"}\n" + |
6356 |
"void bar(String string, int i) {\n" + |
6357 |
"}\n" + |
6358 |
"}\n"; |
6359 |
formatSource(source, |
6360 |
"public class X01 {\n" + |
6361 |
" void foo() {\n" + |
6362 |
" bar(\"a non-nls string\", 0 /*a comment*/); //$NON-NLS-1$\n" + |
6363 |
" }\n" + |
6364 |
"\n" + |
6365 |
" void bar(String string, int i) {\n" + |
6366 |
" }\n" + |
6367 |
"}\n" |
6368 |
); |
6369 |
} |
6370 |
public void testBug305830b() { |
6371 |
this.formatterPrefs = null; |
6372 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "40"); |
6373 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "40"); |
6374 |
String source = |
6375 |
"public class X02 {\n" + |
6376 |
"void foo() {\n" + |
6377 |
"bar(\"str\", 0 /*a comment*/); //$NON-NLS-1$\n" + |
6378 |
"}\n" + |
6379 |
"void bar(String string, int i) {\n" + |
6380 |
"}\n" + |
6381 |
"}\n"; |
6382 |
formatSource(source, |
6383 |
"public class X02 {\n" + |
6384 |
" void foo() {\n" + |
6385 |
" bar(\"str\", 0 /* a comment */); //$NON-NLS-1$\n" + |
6386 |
" }\n" + |
6387 |
"\n" + |
6388 |
" void bar(String string, int i) {\n" + |
6389 |
" }\n" + |
6390 |
"}\n" |
6391 |
); |
6392 |
} |
6393 |
public void testBug305830c() { |
6394 |
this.formatterPrefs = null; |
6395 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "40"); |
6396 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, "40"); |
6397 |
String source = |
6398 |
"public class X03 {\n" + |
6399 |
"void foo() {\n" + |
6400 |
"bar(\"str\", 0 /* a comment */); //$NON-NLS-1$\n" + |
6401 |
"}\n" + |
6402 |
"void bar(String string, int i) {\n" + |
6403 |
"}\n" + |
6404 |
"}\n"; |
6405 |
formatSource(source, |
6406 |
"public class X03 {\n" + |
6407 |
" void foo() {\n" + |
6408 |
" bar(\"str\", 0 /* a comment */); //$NON-NLS-1$\n" + |
6409 |
" }\n" + |
6410 |
"\n" + |
6411 |
" void bar(String string, int i) {\n" + |
6412 |
" }\n" + |
6413 |
"}\n" |
6414 |
); |
6415 |
} |
6416 |
|
6342 |
} |
6417 |
} |