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
c.length=  lineEnd - c.offset;
								buf.append(d.get(contentStart, lineEnd - contentStart).toCharArray());
							}
						}
					
						buf.append(getLineDelimiter(d));
						buf.append(d.get(start, length));
						buf.append('}');
					}
				} else if (isBracelessBlockStart(d, c.offset, start)) {
					buf.append(createIndent(1, useSpaces()));
				}
			}
			c.text= buf.toString();
		} catch (BadLocationException e) {
			JavaPlugin.log(e);
		}
	}
	/**
	 * Checks if the line seems to be an open condition not followed by a block (i.e. an if, while, 
	 * or for statement with just one following statement, see example below). 
	 * 
	 * <pre>
	 * if (condition)
	 *     doStuff();
	 * </pre>
	 * 
	 * <p>Algorithm: if the last non-WS, non-Comment code on the line is an if (condition), while (condition),
	 * for( expression), do, else, and there is no statement after that </p> 
	 *