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
import org.eclipse.jface.text.Position;
import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.source.Annotation;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.jface.util.Assert;
import org.eclipse.ui.IEditorPart;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jdt.ui.PreferenceConstants;
import org.eclipse.jdt.ui.text.IColorManager;
import org.eclipse.jdt.ui.text.JavaTextTools;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.javaeditor.IJavaAnnotation;
import org.eclipse.jdt.internal.ui.javaeditor.JavaAnnotationIterator;
import org.eclipse.jdt.internal.ui.text.HTMLTextPresenter;
import org.eclipse.jdt.internal.ui.text.JavaPartitionScanner;
public class JavaCorrectionAssistant extends ContentAssistant {
	private ITextViewer fViewer;
	private IEditorPart fEditor;
	private Position fPosition;
	
	/**
	 * Constructor for CorrectionAssistant.
	 */
	public JavaCorrectionAssistant(IEditorPart editor) {
		super();
		Assert.isNotNull(editor);
		fEditor= editor;
		
		JavaCorrectionProcessor processor= new JavaCorrectionProcessor(editor);