Bug 49945 Typing a brace destroys subsequent character
I20040106 + plugin-export 20040108_1804 Typing a brace destroys the subsequent '/' character: public class Example { public Example() { } // <- insert '{' before comment public static void main(String[] args) { } } All Preferences 'Java > Editor > Typing' have the default setting.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java
int afterToken= dScanner.nextToken(command.offset + command.length, JavaHeuristicScanner.UNBOUND);
    	try {
			switch (afterToken) {
			case Symbols.TokenRBRACE:
				pasted.replace(pasted.getLength(), 0, "}"); 
				break;
			case Symbols.TokenRPAREN:
				pasted.replace(pasted.getLength(), 0, ")"); 
				break;
			case Symbols.TokenRBRACKET:
				pasted.replace(pasted.getLength(), 0, "]"); 
				break;
			}
		} catch (BadLocationException e) {
			
			Assert.isTrue(false);
		}
    	
    	int pPos= 0; 
    	int dPos= Math.max(0, command.offset - 1); 
    	while (true) {
    		int token= pScanner.nextToken(pPos, JavaHeuristicScanner.UNBOUND);
   			pPos= pScanner.getPosition();
    		switch (token) {
    			case Symbols.TokenLBRACE:
    			case Symbols.TokenLBRACKET:
    			case Symbols.TokenLPAREN:
    				pPos= skipScope(pScanner, pPos, token);
    				if (pPos == JavaHeuristicScanner.NOT_FOUND)
    					return firstPeer;