Bug 82173 [5.0][typing] Angle Bracket<> auto closing should work in more situations
I20041221-0800 Angular Bracket auto closing does not work for a field type. In this example: void m() { HashMap hm= new HashMap(); ... ... an opening bracket < is - automatically closed when inserted between HashMap and () - not automatically closed when inserted between HashMap and hm. It should be closed in both cases.
org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/BracketInserterTest.java
assertEquals(BODY_OFFSET + 2, getCaret());
		
		LinkedModeModel model= LinkedModeModel.getModel(fDocument, BODY_OFFSET + 2);
		assertNotNull(model);
		assertTrue("models must be nested", model.isNested());
		
		
		type(SWT.BS);
		assertEquals("()", fDocument.get(BODY_OFFSET, 2));
		assertEquals(BODY_OFFSET + 1, getCaret());
		
		model= LinkedModeModel.getModel(fDocument, BODY_OFFSET + 1);
		assertNotNull(model);
		assertFalse("model must not be nested", model.isNested());
		
		
		type(SWT.BS);
		assertEquals(CU_CONTENTS, fDocument.get());
		assertEquals(BODY_OFFSET, getCaret());
		
		assertEquals(CU_CONTENTS, fDocument.get());
		assertFalse("no linked model must exist", LinkedModeModel.hasInstalledModel(fDocument));
	}
	
	public void testNoInsertInsideText() throws BadLocationException {
		setCaret(ARGS_OFFSET);
		type('(');
		
		assertEquals("(St", fDocument.get(ARGS_OFFSET, 3));
		assertEquals(ARGS_OFFSET + 1, getCaret());