Bug 40038 [typing] Smart semicolon fooled by method braces
Build: I20030710 Start writing a setter method, like this: public void setValue(int i) {} Then position cursor between the braces and fill in the method body. You end up with this: public void setValue(int i) {this.value=i}; Problem: when you type the semicolon, it jumps over the closing method body brace and places it at the end of the line, resulting in a syntax error.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/SmartSemicolonAutoEditStrategy.java
private static final char SEMICHAR= ';';
	
	private static final String BRACE= "{"; 
	
	private static final char BRACECHAR= '{';
	private char fCharacter;
	private String fPartitioning;
	/**
	 * Creates a new SmartSemicolonAutoEditStrategy.
	 * 
	 * @param partitioning the document partitioning
	 */
	public SmartSemicolonAutoEditStrategy(String partitioning) {
		fPartitioning= partitioning;
	}
	/*
	 * @see org.eclipse.jface.text.IAutoEditStrategy#customizeDocumentCommand(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.DocumentCommand)
	 */
	public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
		
		
		
		
		if (command.text == null)
			return;
		if (command.text.equals(SEMICOLON))
			fCharacter= SEMICHAR;
		else if (command.text.equals(BRACE))
			fCharacter= BRACECHAR;