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
* 
	 * @return an offset where corrections are available or -1 if none
	 */
	private int computeOffsetWithCorrection(int initalOffset) {
		if (fViewer == null || fViewer.getDocument() == null)
			return -1;
		
		IRegion lineInfo= null;
		try {
			lineInfo= fViewer.getDocument().getLineInformationOfOffset(initalOffset);
		} catch (BadLocationException ex) {
			return -1;
		}
		int startOffset= lineInfo.getOffset();
		int endOffset= startOffset + lineInfo.getLength();
		
		int result= computeOffsetWithCorrection(startOffset, endOffset, initalOffset);
		if (result > 0)
			return result;
		else
			return -1;
	}
	/**
	 * @return the best matching offset with corrections or -1 if nothing is found
	 */
	private int computeOffsetWithCorrection(int startOffset, int endOffset, int initialOffset) {
		IAnnotationModel model= JavaUI.getDocumentProvider().getAnnotationModel(fEditor.getEditorInput());
		int invocationOffset= -1;
		int offsetOfFirstProblem= Integer.MAX_VALUE;
		Iterator iter= new JavaAnnotationIterator(model, true);