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
int pos= scanner.findNonWhitespaceBackward(p, JavaHeuristicScanner.UNBOUND);
			if (pos == -1)
				return;
			int lastLine= d.getLineOfOffset(pos);
			
			
			if (lastLine < line) {
			
				JavaIndenter indenter= new JavaIndenter(d, scanner);
				StringBuffer indent= indenter.computeIndentation(p, true);
				if (indent != null) {
					c.text= indent.append(c.text).toString();
					c.length += c.offset - lineOffset;
					c.offset= lineOffset;
				}
			}
			
		} catch (BadLocationException e) {
			JavaPlugin.log(e);
		}
		
	}
	private void smartIndentAfterNewLine(IDocument d, DocumentCommand c) {
		JavaHeuristicScanner scanner= new JavaHeuristicScanner(d);
		JavaIndenter indenter= new JavaIndenter(d, scanner);
		StringBuffer indent= indenter.computeIndentation(c.offset);
		if (indent == null)
			indent= new StringBuffer(); 
		int docLength= d.getLength();
		if (c.offset == -1 || docLength == 0)