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_package = false; |
10368 |
preferences.insert_new_line_after_annotation_on_parameter = true; |
10371 |
preferences.insert_new_line_after_annotation_on_parameter = true; |
10369 |
DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences); |
10372 |
DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences); |
10370 |
IRegion[] regions = new IRegion[] { |
10373 |
IRegion[] regions = new IRegion[] { |
Lines 10378-10384
Link Here
|
10378 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10381 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10379 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10382 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10380 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10383 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10381 |
preferences.insert_new_line_after_annotation_on_member = false; |
10384 |
preferences.insert_new_line_after_annotation_on_type = false; |
|
|
10385 |
preferences.insert_new_line_after_annotation_on_field = false; |
10386 |
preferences.insert_new_line_after_annotation_on_method = false; |
10387 |
preferences.insert_new_line_after_annotation_on_package = false; |
10382 |
preferences.insert_new_line_after_annotation_on_parameter = false; |
10388 |
preferences.insert_new_line_after_annotation_on_parameter = false; |
10383 |
DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences); |
10389 |
DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences); |
10384 |
IRegion[] regions = new IRegion[] { |
10390 |
IRegion[] regions = new IRegion[] { |
Lines 10393-10399
Link Here
|
10393 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10399 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10394 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10400 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10395 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10401 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10396 |
preferences.insert_new_line_after_annotation_on_member = false; |
10402 |
preferences.insert_new_line_after_annotation_on_type = false; |
|
|
10403 |
preferences.insert_new_line_after_annotation_on_field = false; |
10404 |
preferences.insert_new_line_after_annotation_on_method = false; |
10405 |
preferences.insert_new_line_after_annotation_on_package = false; |
10397 |
preferences.insert_new_line_after_annotation_on_parameter = true; |
10406 |
preferences.insert_new_line_after_annotation_on_parameter = true; |
10398 |
preferences.insert_new_line_after_annotation_on_local_variable = false; |
10407 |
preferences.insert_new_line_after_annotation_on_local_variable = false; |
10399 |
Hashtable javaCoreOptions = JavaCore.getOptions(); |
10408 |
Hashtable javaCoreOptions = JavaCore.getOptions(); |
Lines 10419-10425
Link Here
|
10419 |
public void test707() { |
10428 |
public void test707() { |
10420 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10429 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10421 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10430 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10422 |
preferences.insert_new_line_after_annotation_on_member = true; |
10431 |
preferences.insert_new_line_after_annotation_on_type = true; |
|
|
10432 |
preferences.insert_new_line_after_annotation_on_field = true; |
10433 |
preferences.insert_new_line_after_annotation_on_method = true; |
10434 |
preferences.insert_new_line_after_annotation_on_package = true; |
10423 |
preferences.insert_new_line_after_annotation_on_parameter = true; |
10435 |
preferences.insert_new_line_after_annotation_on_parameter = true; |
10424 |
preferences.insert_new_line_after_annotation_on_local_variable = false; |
10436 |
preferences.insert_new_line_after_annotation_on_local_variable = false; |
10425 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10437 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
Lines 10447-10453
Link Here
|
10447 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10459 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10448 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10460 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10449 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10461 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10450 |
preferences.insert_new_line_after_annotation_on_member = true; |
10462 |
preferences.insert_new_line_after_annotation_on_type = true; |
|
|
10463 |
preferences.insert_new_line_after_annotation_on_field = true; |
10464 |
preferences.insert_new_line_after_annotation_on_method = true; |
10465 |
preferences.insert_new_line_after_annotation_on_package = true; |
10451 |
preferences.insert_new_line_after_annotation_on_parameter = false; |
10466 |
preferences.insert_new_line_after_annotation_on_parameter = false; |
10452 |
preferences.insert_new_line_after_annotation_on_local_variable = false; |
10467 |
preferences.insert_new_line_after_annotation_on_local_variable = false; |
10453 |
Hashtable javaCoreOptions = JavaCore.getOptions(); |
10468 |
Hashtable javaCoreOptions = JavaCore.getOptions(); |
Lines 10473-10479
Link Here
|
10473 |
public void test709() { |
10488 |
public void test709() { |
10474 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10489 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10475 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10490 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10476 |
preferences.insert_new_line_after_annotation_on_member = false; |
10491 |
preferences.insert_new_line_after_annotation_on_type = false; |
|
|
10492 |
preferences.insert_new_line_after_annotation_on_field = false; |
10493 |
preferences.insert_new_line_after_annotation_on_method = false; |
10494 |
preferences.insert_new_line_after_annotation_on_package = false; |
10477 |
preferences.insert_new_line_after_annotation_on_parameter = false; |
10495 |
preferences.insert_new_line_after_annotation_on_parameter = false; |
10478 |
preferences.insert_new_line_after_annotation_on_local_variable = false; |
10496 |
preferences.insert_new_line_after_annotation_on_local_variable = false; |
10479 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10497 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
Lines 10500-10506
Link Here
|
10500 |
public void test710() { |
10518 |
public void test710() { |
10501 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10519 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10502 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10520 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10503 |
preferences.insert_new_line_after_annotation_on_member = false; |
10521 |
preferences.insert_new_line_after_annotation_on_type = false; |
|
|
10522 |
preferences.insert_new_line_after_annotation_on_field = false; |
10523 |
preferences.insert_new_line_after_annotation_on_method = false; |
10524 |
preferences.insert_new_line_after_annotation_on_package = false; |
10504 |
preferences.insert_new_line_after_annotation_on_parameter = true; |
10525 |
preferences.insert_new_line_after_annotation_on_parameter = true; |
10505 |
preferences.insert_new_line_after_annotation_on_local_variable = true; |
10526 |
preferences.insert_new_line_after_annotation_on_local_variable = true; |
10506 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10527 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
Lines 10527-10533
Link Here
|
10527 |
public void test711() { |
10548 |
public void test711() { |
10528 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10549 |
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); |
10529 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10550 |
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); |
10530 |
preferences.insert_new_line_after_annotation_on_member = false; |
10551 |
preferences.insert_new_line_after_annotation_on_type = false; |
|
|
10552 |
preferences.insert_new_line_after_annotation_on_field = false; |
10553 |
preferences.insert_new_line_after_annotation_on_method = false; |
10554 |
preferences.insert_new_line_after_annotation_on_package = false; |
10531 |
preferences.insert_new_line_after_annotation_on_parameter = false; |
10555 |
preferences.insert_new_line_after_annotation_on_parameter = false; |
10532 |
preferences.insert_new_line_after_annotation_on_local_variable = true; |
10556 |
preferences.insert_new_line_after_annotation_on_local_variable = true; |
10533 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
10557 |
preferences.line_separator = "\n";//$NON-NLS-1$ |
Lines 10726-10729
Link Here
|
10726 |
"}\n" |
10750 |
"}\n" |
10727 |
); |
10751 |
); |
10728 |
} |
10752 |
} |
|
|
10753 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=308000 |
10754 |
public void test725() { |
10755 |
this.formatterPrefs = null; |
10756 |
this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6); |
10757 |
this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); |
10758 |
this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6); |
10759 |
String source = |
10760 |
"@Deprecated package pack;\n" + |
10761 |
"public class Test {\n" + |
10762 |
" @Deprecated Test(String s) {}\n" + |
10763 |
" @Deprecated String label;\n" + |
10764 |
" @Deprecated void foo() {}\n" + |
10765 |
" @Deprecated interface I {}\n" + |
10766 |
"}\n"; |
10767 |
formatSource(source, |
10768 |
"@Deprecated\n" + |
10769 |
"package pack;\n" + |
10770 |
"\n" + |
10771 |
"public class Test {\n" + |
10772 |
" @Deprecated\n" + |
10773 |
" Test(String s) {\n" + |
10774 |
" }\n" + |
10775 |
"\n" + |
10776 |
" @Deprecated\n" + |
10777 |
" String label;\n" + |
10778 |
"\n" + |
10779 |
" @Deprecated\n" + |
10780 |
" void foo() {\n" + |
10781 |
" }\n" + |
10782 |
"\n" + |
10783 |
" @Deprecated\n" + |
10784 |
" interface I {\n" + |
10785 |
" }\n" + |
10786 |
"}\n" |
10787 |
); |
10788 |
} |
10789 |
public void test726() { |
10790 |
this.formatterPrefs = null; |
10791 |
this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6); |
10792 |
this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); |
10793 |
this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6); |
10794 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE, DefaultCodeFormatterConstants.FALSE); |
10795 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD, DefaultCodeFormatterConstants.FALSE); |
10796 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD, DefaultCodeFormatterConstants.FALSE); |
10797 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE, DefaultCodeFormatterConstants.FALSE); |
10798 |
String source = |
10799 |
"@Deprecated package pack;\n" + |
10800 |
"public class Test {\n" + |
10801 |
" @Deprecated Test(String s) {}\n" + |
10802 |
" @Deprecated String label;\n" + |
10803 |
" @Deprecated void foo() {}\n" + |
10804 |
" @Deprecated interface I {}\n" + |
10805 |
"}\n"; |
10806 |
formatSource(source, |
10807 |
"@Deprecated package pack;\n" + |
10808 |
"\n" + |
10809 |
"public class Test {\n" + |
10810 |
" @Deprecated Test(String s) {\n" + |
10811 |
" }\n" + |
10812 |
"\n" + |
10813 |
" @Deprecated String label;\n" + |
10814 |
"\n" + |
10815 |
" @Deprecated void foo() {\n" + |
10816 |
" }\n" + |
10817 |
"\n" + |
10818 |
" @Deprecated interface I {\n" + |
10819 |
" }\n" + |
10820 |
"}\n" |
10821 |
); |
10822 |
} |
10823 |
|
10824 |
/** |
10825 |
* @deprecated Use a deprecated formatter option. |
10826 |
*/ |
10827 |
public void test727() { |
10828 |
this.formatterPrefs = null; |
10829 |
this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6); |
10830 |
this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); |
10831 |
this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6); |
10832 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE, DefaultCodeFormatterConstants.TRUE); |
10833 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_MEMBER, DefaultCodeFormatterConstants.FALSE); |
10834 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER, DefaultCodeFormatterConstants.FALSE); |
10835 |
String source = |
10836 |
"@Deprecated package pack;\n" + |
10837 |
"public class Test {\n" + |
10838 |
" @Deprecated Test(String s) {}\n" + |
10839 |
" @Deprecated String label;\n" + |
10840 |
" @Deprecated void foo() {}\n" + |
10841 |
" @Deprecated interface I {}\n" + |
10842 |
"}\n"; |
10843 |
formatSource(source, |
10844 |
"@Deprecated package pack;\n" + |
10845 |
"\n" + |
10846 |
"public class Test {\n" + |
10847 |
" @Deprecated Test(String s) {\n" + |
10848 |
" }\n" + |
10849 |
"\n" + |
10850 |
" @Deprecated String label;\n" + |
10851 |
"\n" + |
10852 |
" @Deprecated void foo() {\n" + |
10853 |
" }\n" + |
10854 |
"\n" + |
10855 |
" @Deprecated interface I {\n" + |
10856 |
" }\n" + |
10857 |
"}\n" |
10858 |
); |
10859 |
} |
10860 |
|
10861 |
/** |
10862 |
* @deprecated Use a deprecated formatter option. |
10863 |
*/ |
10864 |
public void test728() { |
10865 |
this.formatterPrefs = null; |
10866 |
this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6); |
10867 |
this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); |
10868 |
this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6); |
10869 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION, DefaultCodeFormatterConstants.FALSE); |
10870 |
String source = |
10871 |
"@Deprecated package pack;\n" + |
10872 |
"public class Test {\n" + |
10873 |
" @Deprecated Test(String s) {}\n" + |
10874 |
" @Deprecated String label;\n" + |
10875 |
" @Deprecated void foo() {}\n" + |
10876 |
" @Deprecated interface I {}\n" + |
10877 |
"}\n"; |
10878 |
formatSource(source, |
10879 |
"@Deprecated package pack;\n" + |
10880 |
"\n" + |
10881 |
"public class Test {\n" + |
10882 |
" @Deprecated Test(String s) {\n" + |
10883 |
" }\n" + |
10884 |
"\n" + |
10885 |
" @Deprecated String label;\n" + |
10886 |
"\n" + |
10887 |
" @Deprecated void foo() {\n" + |
10888 |
" }\n" + |
10889 |
"\n" + |
10890 |
" @Deprecated interface I {\n" + |
10891 |
" }\n" + |
10892 |
"}\n" |
10893 |
); |
10894 |
} |
10895 |
|
10729 |
} |
10896 |
} |