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/JavaHeuristicScanner.java
/**
	 * Checks whether <code>position</code> resides in a default (Java) partition of <code>fDocument</code>.
	 * 
	 * @param position the position to be checked
	 * @return <code>true</code> if <code>position</code> is in the default partition of <code>fDocument</code>, <code>false</code> otherwise
	 */
	public boolean isDefaultPartition(int position) {
		Assert.isTrue(position >= 0);
		Assert.isTrue(position <= fDocument.getLength());
		
		try {
			ITypedRegion region= TextUtilities.getPartition(fDocument, fPartitioning, position);
			return region.getType().equals(fPartition);
			
		} catch (BadLocationException e) {
		}
		
		return false;
	}
	/**
	 * 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),