View | Details | Raw Unified | Return to bug 93727 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java (-1 / +24 lines)
Lines 62-68 Link Here
62
			return suite;
62
			return suite;
63
		}
63
		}
64
		junit.framework.TestSuite suite = new Suite(FormatterRegressionTests.class.getName());
64
		junit.framework.TestSuite suite = new Suite(FormatterRegressionTests.class.getName());
65
		suite.addTest(new FormatterRegressionTests("test574"));  //$NON-NLS-1$
65
		suite.addTest(new FormatterRegressionTests("test575"));  //$NON-NLS-1$
66
		return suite;
66
		return suite;
67
	}
67
	}
68
68
Lines 8027-8030 Link Here
8027
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8027
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8028
		runTest(codeFormatter, "test574", "A.java", CodeFormatter.K_JAVA_DOC, false);//$NON-NLS-1$ //$NON-NLS-2$
8028
		runTest(codeFormatter, "test574", "A.java", CodeFormatter.K_JAVA_DOC, false);//$NON-NLS-1$ //$NON-NLS-2$
8029
	}
8029
	}
8030
	
8031
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77809
8032
	public void test575() {
8033
		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8034
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8035
		Hashtable javaCoreOptions = JavaCore.getOptions();
8036
		try {
8037
			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8038
			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8039
			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8040
			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8041
			JavaCore.setOptions(newJavaCoreOptions);
8042
		
8043
			Map compilerOptions = new HashMap();
8044
			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8045
			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8046
			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);		
8047
			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8048
			runTest(codeFormatter, "test575", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8049
		} finally {
8050
			JavaCore.setOptions(javaCoreOptions);
8051
		}
8052
	}
8030
}
8053
}
(-)workspace/Formatter/test575/A_in.java (+5 lines)
Added Link Here
1
public class A
2
{  public Object foo( @Ann("parameter") Object parameter ) {
3
    return parameter;
4
  }
5
}
(-)workspace/Formatter/test575/A_out.java (+6 lines)
Added Link Here
1
public class A {
2
	public Object foo(@Ann("parameter")
3
	Object parameter) {
4
		return parameter;
5
	}
6
}

Return to bug 93727