Lines 10364-10370
Link Here
|
10364 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10364 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10365 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10365 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10366 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10366 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10367 |
preferences.insert_new_line_after_annotation_on_member = false; |
10367 |
preferences.insert_new_line_after_annotation_on_type = false; |
|
|
10368 |
preferences.insert_new_line_after_annotation_on_field = false; |
10369 |
preferences.insert_new_line_after_annotation_on_method = false; |
10370 |
preferences.insert_new_line_after_annotation_on_constructor = false; |
10371 |
preferences.insert_new_line_after_annotation_on_package = false; |
10368 |
preferences.insert_new_line_after_annotation_on_parameter = true; |
10372 |
preferences.insert_new_line_after_annotation_on_parameter = true; |
10369 |
DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences); |
10373 |
DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences); |
10370 |
IRegion[] regions = new IRegion[] { |
10374 |
IRegion[] regions = new IRegion[] { |
Lines 10378-10384
Link Here
|
10378 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10382 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10379 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10383 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10380 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10384 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10381 |
preferences.insert_new_line_after_annotation_on_member = false; |
10385 |
preferences.insert_new_line_after_annotation_on_type = false; |
|
|
10386 |
preferences.insert_new_line_after_annotation_on_field = false; |
10387 |
preferences.insert_new_line_after_annotation_on_method = false; |
10388 |
preferences.insert_new_line_after_annotation_on_constructor = false; |
10389 |
preferences.insert_new_line_after_annotation_on_package = false; |
10382 |
preferences.insert_new_line_after_annotation_on_parameter = false; |
10390 |
preferences.insert_new_line_after_annotation_on_parameter = false; |
10383 |
DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences); |
10391 |
DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences); |
10384 |
IRegion[] regions = new IRegion[] { |
10392 |
IRegion[] regions = new IRegion[] { |
Lines 10393-10399
Link Here
|
10393 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10401 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10394 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10402 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10395 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10403 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10396 |
preferences.insert_new_line_after_annotation_on_member = false; |
10404 |
preferences.insert_new_line_after_annotation_on_type = false; |
|
|
10405 |
preferences.insert_new_line_after_annotation_on_field = false; |
10406 |
preferences.insert_new_line_after_annotation_on_method = false; |
10407 |
preferences.insert_new_line_after_annotation_on_constructor = false; |
10408 |
preferences.insert_new_line_after_annotation_on_package = false; |
10397 |
preferences.insert_new_line_after_annotation_on_parameter = true; |
10409 |
preferences.insert_new_line_after_annotation_on_parameter = true; |
10398 |
preferences.insert_new_line_after_annotation_on_local_variable = false; |
10410 |
preferences.insert_new_line_after_annotation_on_local_variable = false; |
10399 |
Hashtable javaCoreOptions = JavaCore.getOptions(); |
10411 |
Hashtable javaCoreOptions = JavaCore.getOptions(); |
Lines 10419-10425
Link Here
|
10419 |
public void test707() { |
10431 |
public void test707() { |
10420 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10432 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10421 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10433 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10422 |
preferences.insert_new_line_after_annotation_on_member = true; |
10434 |
preferences.insert_new_line_after_annotation_on_type = true; |
|
|
10435 |
preferences.insert_new_line_after_annotation_on_field = true; |
10436 |
preferences.insert_new_line_after_annotation_on_method = true; |
10437 |
preferences.insert_new_line_after_annotation_on_constructor = true; |
10438 |
preferences.insert_new_line_after_annotation_on_package = true; |
10423 |
preferences.insert_new_line_after_annotation_on_parameter = true; |
10439 |
preferences.insert_new_line_after_annotation_on_parameter = true; |
10424 |
preferences.insert_new_line_after_annotation_on_local_variable = false; |
10440 |
preferences.insert_new_line_after_annotation_on_local_variable = false; |
10425 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10441 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
Lines 10447-10453
Link Here
|
10447 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10463 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10448 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10464 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10449 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10465 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10450 |
preferences.insert_new_line_after_annotation_on_member = true; |
10466 |
preferences.insert_new_line_after_annotation_on_type = true; |
|
|
10467 |
preferences.insert_new_line_after_annotation_on_field = true; |
10468 |
preferences.insert_new_line_after_annotation_on_method = true; |
10469 |
preferences.insert_new_line_after_annotation_on_constructor = true; |
10470 |
preferences.insert_new_line_after_annotation_on_package = true; |
10451 |
preferences.insert_new_line_after_annotation_on_parameter = false; |
10471 |
preferences.insert_new_line_after_annotation_on_parameter = false; |
10452 |
preferences.insert_new_line_after_annotation_on_local_variable = false; |
10472 |
preferences.insert_new_line_after_annotation_on_local_variable = false; |
10453 |
Hashtable javaCoreOptions = JavaCore.getOptions(); |
10473 |
Hashtable javaCoreOptions = JavaCore.getOptions(); |
Lines 10473-10479
Link Here
|
10473 |
public void test709() { |
10493 |
public void test709() { |
10474 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10494 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10475 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10495 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10476 |
preferences.insert_new_line_after_annotation_on_member = false; |
10496 |
preferences.insert_new_line_after_annotation_on_type = false; |
|
|
10497 |
preferences.insert_new_line_after_annotation_on_field = false; |
10498 |
preferences.insert_new_line_after_annotation_on_method = false; |
10499 |
preferences.insert_new_line_after_annotation_on_constructor = false; |
10500 |
preferences.insert_new_line_after_annotation_on_package = false; |
10477 |
preferences.insert_new_line_after_annotation_on_parameter = false; |
10501 |
preferences.insert_new_line_after_annotation_on_parameter = false; |
10478 |
preferences.insert_new_line_after_annotation_on_local_variable = false; |
10502 |
preferences.insert_new_line_after_annotation_on_local_variable = false; |
10479 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10503 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
Lines 10500-10506
Link Here
|
10500 |
public void test710() { |
10524 |
public void test710() { |
10501 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10525 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10502 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10526 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10503 |
preferences.insert_new_line_after_annotation_on_member = false; |
10527 |
preferences.insert_new_line_after_annotation_on_type = false; |
|
|
10528 |
preferences.insert_new_line_after_annotation_on_field = false; |
10529 |
preferences.insert_new_line_after_annotation_on_method = false; |
10530 |
preferences.insert_new_line_after_annotation_on_constructor = false; |
10531 |
preferences.insert_new_line_after_annotation_on_package = false; |
10504 |
preferences.insert_new_line_after_annotation_on_parameter = true; |
10532 |
preferences.insert_new_line_after_annotation_on_parameter = true; |
10505 |
preferences.insert_new_line_after_annotation_on_local_variable = true; |
10533 |
preferences.insert_new_line_after_annotation_on_local_variable = true; |
10506 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10534 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
Lines 10527-10533
Link Here
|
10527 |
public void test711() { |
10555 |
public void test711() { |
10528 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10556 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10529 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10557 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10530 |
preferences.insert_new_line_after_annotation_on_member = false; |
10558 |
preferences.insert_new_line_after_annotation_on_type = false; |
|
|
10559 |
preferences.insert_new_line_after_annotation_on_field = false; |
10560 |
preferences.insert_new_line_after_annotation_on_method = false; |
10561 |
preferences.insert_new_line_after_annotation_on_constructor = false; |
10562 |
preferences.insert_new_line_after_annotation_on_package = false; |
10531 |
preferences.insert_new_line_after_annotation_on_parameter = false; |
10563 |
preferences.insert_new_line_after_annotation_on_parameter = false; |
10532 |
preferences.insert_new_line_after_annotation_on_local_variable = true; |
10564 |
preferences.insert_new_line_after_annotation_on_local_variable = true; |
10533 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10565 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
Lines 10726-10729
Link Here
|
10726 |
"}\n" |
10758 |
"}\n" |
10727 |
); |
10759 |
); |
10728 |
} |
10760 |
} |
|
|
10761 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=308000 |
10762 |
public void test725() { |
10763 |
this.formatterPrefs = null; |
10764 |
this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6); |
10765 |
this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); |
10766 |
this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6); |
10767 |
String source = |
10768 |
"public class Test {\n" + |
10769 |
" @Deprecated Test(String s) {}\n" + |
10770 |
" @Deprecated String label;\n" + |
10771 |
" @Deprecated void foo() {}\n" + |
10772 |
" @Deprecated interface I {}\n" + |
10773 |
"}\n"; |
10774 |
formatSource(source, |
10775 |
"public class Test {\n" + |
10776 |
" @Deprecated\n" + |
10777 |
" Test(String s) {\n" + |
10778 |
" }\n" + |
10779 |
"\n" + |
10780 |
" @Deprecated\n" + |
10781 |
" String label;\n" + |
10782 |
"\n" + |
10783 |
" @Deprecated\n" + |
10784 |
" void foo() {\n" + |
10785 |
" }\n" + |
10786 |
"\n" + |
10787 |
" @Deprecated\n" + |
10788 |
" interface I {\n" + |
10789 |
" }\n" + |
10790 |
"}\n" |
10791 |
); |
10792 |
} |
10793 |
public void test726() { |
10794 |
this.formatterPrefs = null; |
10795 |
this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6); |
10796 |
this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); |
10797 |
this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6); |
10798 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE, DefaultCodeFormatterConstants.FALSE); |
10799 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD, DefaultCodeFormatterConstants.FALSE); |
10800 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD, DefaultCodeFormatterConstants.FALSE); |
10801 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_CONSTRUCTOR, DefaultCodeFormatterConstants.FALSE); |
10802 |
String source = |
10803 |
"public class Test {\n" + |
10804 |
" @Deprecated Test(String s) {}\n" + |
10805 |
" @Deprecated String label;\n" + |
10806 |
" @Deprecated void foo() {}\n" + |
10807 |
" @Deprecated interface I {}\n" + |
10808 |
"}\n"; |
10809 |
formatSource(source, |
10810 |
"public class Test {\n" + |
10811 |
" @Deprecated Test(String s) {\n" + |
10812 |
" }\n" + |
10813 |
"\n" + |
10814 |
" @Deprecated String label;\n" + |
10815 |
"\n" + |
10816 |
" @Deprecated void foo() {\n" + |
10817 |
" }\n" + |
10818 |
"\n" + |
10819 |
" @Deprecated interface I {\n" + |
10820 |
" }\n" + |
10821 |
"}\n" |
10822 |
); |
10823 |
} |
10824 |
|
10729 |
} |
10825 |
} |