Bug 109730 Surround with runnable quick assist
Version: 3.1.0 Build id: I20050906-1200 Until now surround with runnable was only a text templat. This patches add a quick assist for surround with runnable. Variable declarations are made final and initializers are split off if required. Surround with runnable does not guarantee to generate syntactically correct code in every situation. i.e.: int i = 10, j = i; System.out.println(i); System.out.println(j); Applying surround with runnable on System.out.println(i); results in final int i = 10; int j = i; Runnable runnable = new Runnable() { public void run() { System.out.println(i); } } System.out.println(j);
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest.java
private static final Class THIS= AssistQuickFixTest.class;
	
	private IJavaProject fJProject1;
	private IPackageFragmentRoot fSourceFolder;
	public AssistQuickFixTest(String name) {
		super(name);
	}
	
	public static Test allTests() {
		return new ProjectTestSetup(new TestSuite(THIS));
	}
	
	public static Test suite() {
		if (true) {
			return allTests();
		} else {
			TestSuite suite= new TestSuite();
			suite.addTest(new AssistQuickFixTest("testAssignToLocal7"));
			return new ProjectTestSetup(suite);
		}
	}
	public static Test setUpTest(Test test) {
		return new ProjectTestSetup(test);
	}
	protected void setUp() throws Exception {
		Hashtable options= TestOptions.getDefaultOptions();