Bug 42279 unwanted indents after if()/for()/while()....
Since 3.0m3 (and one or two integration builds before it) i get an automatic indent after controll statements like if()+new line. So my code looks like this (only automatic indents): public class Main { void someMethod() { if(true) { // this doesn't look good } else if(1==1) { // this is getting even worse } // oh my god :( } } After running the code formater the code looks like expected public class Main { void someMethod() { if (true) { // this doesn't look good } else if (1 == 1) { // this is getting even worse } // oh my god :( } } If there is a switch i didn't didn't find: sorry. If not: please fix it asap
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java
private int fTabWidth;
	private boolean fUseSpaces;
	private boolean fCloseBrace;
	private boolean fIsSmartMode;
	private String fPartitioning;
	
	/**
	 * Creates a new Java auto indent strategy for the given document partitioning.
	 * 
	 * @param partitioning the document partitioning
	 */
	public JavaAutoIndentStrategy(String partitioning) {
		fPartitioning= partitioning;
 	}
	/**
	 * Evaluates the given line for the opening bracket that matches the closing bracket on the given line.
	 */
	private int findMatchingOpenBracket(IDocument d, int lineNumber, int endOffset, int closingBracketIncrease) throws BadLocationException {
		int startOffset= d.getLineOffset(lineNumber);
		int bracketCount= getBracketCount(d, startOffset, endOffset, false) - closingBracketIncrease;
		
		
		while (bracketCount < 0) {
			--lineNumber;
			if (lineNumber < 0)
				return -1;
			startOffset= d.getLineOffset(lineNumber);
			endOffset= startOffset + d.getLineLength(lineNumber) - 1;
			bracketCount += getBracketCount(d, startOffset, endOffset, false);