Bug 51093 [typing] Pressing enter after an opening curly brace closes the curly brace repeatedly.
Pressing enter after an opening curly brace closes the curly brace repeatedly. IF you are about to define a method and you open a curly brace, the completion closing curly brace is added automatically. If you go and press "enter" again in front of the opening curly brace , it adds another closing brace repeatedly.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java
else
			return 1;
	}
	/**
	 * The preference setting for the visual tabulator display.
	 *  
	 * @return the number of spaces displayed for a tabulator in the editor
	 */
	private static int getVisualTabLengthPreference() {
		return JavaPlugin.getDefault().getPreferenceStore().getInt(PreferenceConstants.EDITOR_TAB_WIDTH);
	}
	private static int getPeerPosition(IDocument document, DocumentCommand command) {
    	/*
    	 * Search for scope closers in the pasted text and find their opening peers
    	 * in the document. 
    	 */
    	Document pasted= new Document(command.text);
    	installJavaStuff(pasted);
    	int firstPeer= command.offset;
    	
    	JavaHeuristicScanner pScanner= new JavaHeuristicScanner(pasted);
    	JavaHeuristicScanner dScanner= new JavaHeuristicScanner(document);
    	
    	
    	int afterToken= dScanner.nextToken(command.offset + command.length, JavaHeuristicScanner.UNBOUND);
    	try {
			switch (afterToken) {
			case Symbols.TokenRBRACE:
				pasted.replace(pasted.getLength(), 0, "}"); 
				break;