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
contents.append("class ____C{void ____m()"); 
			final int methodOffset= contents.length();
			contents.append(source);
			contents.append('}');
			
			char[] buffer= contents.toString().toCharArray();
	
			return new CompilationUnitInfo(buffer, sourceRange.getOffset() - methodOffset);
	
		} catch (BadLocationException e) {
			JavaPlugin.log(e);
		}
	
		return null;
	}
	
	private static boolean areBlocksConsistent(IDocument document, int offset, String partitioning) {
		if (offset < 1 || offset >= document.getLength())
			return false;
		
		int begin= offset;
		int end= offset - 1;
		
		while (true) {
			begin= searchForOpeningPeer(document, begin - 1, partitioning, '{', '}');
			end= searchForClosingPeer(document, end + 1, partitioning, '{', '}');
			if (begin == -1 && end == -1)
				return true;
			if (begin == -1 || end == -1)
				return false;