Bug 108312 [typing] Smart semicolong option should support anonymizing a class
1) Place the caret between the closing parenthesis ')' and semicolon ';'. 2) Type an open brace '{'. 3) Type Enter key (carriage return). See that closing brace '}' is automatically added, but semicolon ';' is illegally misplaced. ----------------- Bug.java ------------------------ class Bug { Object object=new Object(); }
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java
*/
	private static void removeJavaStuff(Document document) {
		document.setDocumentPartitioner(IJavaPartitions.JAVA_PARTITIONING, null);
	}
	private void smartPaste(IDocument document, DocumentCommand command) {
		int newOffset= command.offset;
		int newLength= command.length;
		String newText= command.text;
		try {
			JavaHeuristicScanner scanner= new JavaHeuristicScanner(document);
			JavaIndenter indenter= new JavaIndenter(document, scanner, fProject);
			int offset= newOffset;
			
			int refOffset= indenter.findReferencePosition(offset);
			if (refOffset == JavaHeuristicScanner.NOT_FOUND)
				return;
			int peerOffset= getPeerPosition(document, command);
			peerOffset= indenter.findReferencePosition(peerOffset);
			refOffset= Math.min(refOffset, peerOffset);
			
			int firstLine= 1; 
			IRegion line= document.getLineInformationOfOffset(offset);
			String notSelected= document.get(line.getOffset(), offset - line.getOffset());
			if (notSelected.trim().length() == 0) {
				newLength += notSelected.length();
				newOffset= line.getOffset();
				firstLine= 0;
			}
			
			IRegion refLine= document.getLineInformationOfOffset(refOffset);