Index: src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java,v retrieving revision 1.158 diff -u -r1.158 FormatterRegressionTests.java --- src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java 13 Apr 2005 14:18:55 -0000 1.158 +++ src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java 11 May 2005 19:17:55 -0000 @@ -62,7 +62,7 @@ return suite; } junit.framework.TestSuite suite = new Suite(FormatterRegressionTests.class.getName()); - suite.addTest(new FormatterRegressionTests("test574")); //$NON-NLS-1$ + suite.addTest(new FormatterRegressionTests("test575")); //$NON-NLS-1$ return suite; } @@ -8027,4 +8027,27 @@ DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences); runTest(codeFormatter, "test574", "A.java", CodeFormatter.K_JAVA_DOC, false);//$NON-NLS-1$ //$NON-NLS-2$ } + + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=77809 + public void test575() { + Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); + DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); + Hashtable javaCoreOptions = JavaCore.getOptions(); + try { + Hashtable newJavaCoreOptions = JavaCore.getOptions(); + newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5); + newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); + newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); + JavaCore.setOptions(newJavaCoreOptions); + + Map compilerOptions = new HashMap(); + compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5); + compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); + compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); + DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions); + runTest(codeFormatter, "test575", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$ + } finally { + JavaCore.setOptions(javaCoreOptions); + } + } } Index: workspace/Formatter/test575/A_in.java =================================================================== RCS file: workspace/Formatter/test575/A_in.java diff -N workspace/Formatter/test575/A_in.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Formatter/test575/A_in.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,5 @@ +public class A +{ public Object foo( @Ann("parameter") Object parameter ) { + return parameter; + } +} Index: workspace/Formatter/test575/A_out.java =================================================================== RCS file: workspace/Formatter/test575/A_out.java diff -N workspace/Formatter/test575/A_out.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Formatter/test575/A_out.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,6 @@ +public class A { + public Object foo(@Ann("parameter") + Object parameter) { + return parameter; + } +}