Bug 7985 extract method: cannot extract (entire) try/catch block
public class A{ String f(int y, int z, boolean ff){ /*[*/try{ } catch (Exception e){ }/*]*/ return null; } void f(){} } cannot extract the selected fragment
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TextBufferTest.java
public void testSwap3() throws Exception {
		SwapTextEdit e1= new SwapTextEdit(1, 1, 3, 1);
		SwapTextEdit e2= new SwapTextEdit(5, 1, 7, 1);
		SwapTextEdit e3= new SwapTextEdit(1, 3, 5, 3);
		fEditor.add(e1);
		fEditor.add(e2);
		fEditor.add(e3);
		assertTrue("Can perform edits", fEditor.canPerformEdits());
		UndoMemento undo= fEditor.performEdits(null);
		assertEquals("Buffer content", "0765432189", fBuffer.getContent());
		doUndo(undo);
	}
	
	private void doUndo(UndoMemento undo) throws Exception {
		fEditor.add(undo);
		fEditor.performEdits(null);
		assertBufferContent();
	}
	
	private void assert(TextRange r, int offset, int length) {
		assertEquals("Offset", offset, r.getOffset());
		assertEquals("Length", length, r.getLength());	
	}
	
	private void assertBufferContent() {
		assertEquals("Buffer content restored", "0123456789", fBuffer.getContent());
	}	
}