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
/**
	 * Reads the next token in backward direction from the heuristic scanner and sets the fields
	 * <code>fToken, fPreviousPosition</code> and <code>fPosition</code> accordingly.
	 */
	private void nextToken() {
		nextToken(fPosition);
	}
	/**
	 * Reads the next token in backward direction of <code>start</code> from the heuristic scanner and sets the fields
	 * <code>fToken, fPreviousPosition</code> and <code>fPosition</code> accordingly.
	 */
	private void nextToken(int start) {
		fToken= fScanner.previousToken(start - 1, JavaHeuristicScanner.UNBOUND);
		fPreviousPos= start;
		fPosition= fScanner.getPosition() + 1;
	}
	/**
	 * Returns <code>true</code> if the current tokens look like a method declaration header 
	 * (i.e. only the return type and method name). 
	 * 
	 * @return <code>true</code> if the current position looks like a method header.
	 */
	private boolean looksLikeMethodDecl() {
		
		nextToken();
		if (fToken == Symbols.TokenIDENT) { 
			do nextToken();
			while (skipBrackets()); 
			return fToken == Symbols.TokenIDENT;