Bug 31323 QuickAssist only wraps 2 lines
build I20030206. 1. Start with the following class public class Test { public static void main(String[] args) { int x = 3; x++; int y=x*x; } } 2. Select the THREE lines of code in the main method. 3. Press ctrl-1 4. If you select any of the quick assists (do, for, if, try, while), only the first TWO lines of the code are inserted. When I selected FOUR lines, still only the first TWO lines were inserted.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/JavaCorrectionAssistant.java
int newOffset= pos.offset;
		if (newOffset <= initalOffset && initalOffset <= newOffset + pos.length)
			return initalOffset;
		if (invocationOffset < 0)
			return newOffset;
		if (newOffset <= initalOffset && invocationOffset >= initalOffset)
			return newOffset;
		if (newOffset <= initalOffset && invocationOffset < initalOffset)
			return Math.max(invocationOffset, newOffset);
		if (invocationOffset <= initalOffset)
			return invocationOffset;
		
		return Math.max(invocationOffset, newOffset);
	}
	/* 
	 * @see org.eclipse.jface.text.contentassist.ContentAssistant#possibleCompletionsClosed()
	 */
	protected void possibleCompletionsClosed() {
		super.possibleCompletionsClosed();
		restorePosition();
	}
	/**
	 * Returns <code>true</code> if one line is completely selected or if multiple lines are selected.
	 * Being completely selected means that all characters except the new line characters are 
	 * selected.
	 * 
	 * @return <code>true</code> if one or multiple lines are selected
	 * @since 2.1
	 */
	private boolean areMultipleLinesSelected() {