Bug 43364 [typing] new line insertion sometimes goes wrong!
try and put a new line between the two variable declarations. It will shift the second variable declaration to line up with "c". ------------------------------------------------------------ public class A { private static final String[] var = new String[] { "a", "b", "c", "d"}; private static final int var2 = 4; //press enter at beginning of this line } ------------------------------------------------------------
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/JavaIndenter.java
* while(condition); is ambiguous when parsed backwardly, as it is a valid statement by its own,
	 * so we have to check whether there is a matching do. A <code>do</code> can either be separated
	 * from the while by a block, or by a single statement, which limits our search distance.
	 * 
	 * @return <code>true</code> if the <code>while</code> currently in <code>fToken</code> has a matching <code>do</code>.
	 */
	private boolean hasMatchingDo() {
		Assert.isTrue(fToken == Symbols.TokenWHILE);
		
		return skipStatementOrBlock() && fToken == Symbols.TokenDO;
	}
	/**
	 * Skips a statement or block, the token being the next token after it.
	 * 
	 * @return <code>true</code> if a statement or block could be parsed, <code>false</code> otherwise.
	 */
	private boolean skipStatementOrBlock() {
		nextToken();
		
		switch (fToken) {		
			case Symbols.TokenRBRACE:
				
				if (skipScope(Symbols.TokenLBRACE, Symbols.TokenRBRACE)) {
					nextToken();
					return true;
				}
				break;
			case Symbols.TokenSEMICOLON:
				
				nextToken();