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
StringBuffer buf= new StringBuffer(c.text);
			if (c.offset < docLength && d.getChar(c.offset) == '}') {
				int indLine= findMatchingOpenBracket(d, line, c.offset, 0);
				if (indLine == -1) {
					indLine= line;
				}
				buf.append(getIndentOfLine(d, indLine));
			} else {
				int start= d.getLineOffset(line);
				ITypedRegion region= TextUtilities.getPartition(d, fPartitioning, start);
				if (IJavaPartitions.JAVA_DOC.equals(region.getType()))
					start= d.getLineInformationOfOffset(region.getOffset()).getOffset();
				int whiteend= findEndOfWhiteSpace(d, start, c.offset);
				int length= whiteend - start;
				buf.append(d.get(start, length));
				if (getBracketCount(d, start, c.offset, true) > 0) {
					
					buf.append(createIndent(1, useSpaces()));
					
					if (closeBrace() && !isClosed(d, c.offset, c.length)) {
						c.caretOffset= c.offset + buf.length();
						c.shiftsCaret= false;
						
						
						
						IRegion reg= d.getLineInformation(line);
						int lineEnd= reg.getOffset() + reg.getLength();
						if (!(computeAnonymousPosition(d, c.offset - 1, fPartitioning, lineEnd) != -1)) {
							int contentStart= findEndOfWhiteSpace(d, c.offset, lineEnd);
							if (lineEnd - contentStart > 0) {