Bug 67614 After "create field", additional text is inserted at multiple locations
I wrote the following method call: assertEquals(1.0d, blah(), delta); The field "delta" is not yet declared. I press Ctrl-1 and select "create field". The resulting line is: private Object delta; By typing the following sequence of keys: [Tab] double [Tab] [Right] = 0.0001d I change that manually to: private double delta = 0.00001d; Surprisingly, my original method call is now changed to: assertEquals(1.0d, blah(), delta = 0.00001d); And that is of course wrong. (BTW, I believe that the Ctrl-1 aid should guess the expected field type, but that's a different issue.)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LinkedCorrectionProposal.java
/*******************************************************************************
 * Copyright (c) 2000, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.internal.ui.text.correction;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.DocumentEvent;