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
* A proposal for quick fixes and quick assists that works on a AST rewriter and enters the
 * linked mode when the proposal is set up.
 * Either a rewriter is directly passed in the constructor or method {@link #getRewrite()} is overridden
 * to provide the AST rewriter that is evaluated to the document when the proposal is
 * applied.
 * @since 3.0
 */
public class LinkedCorrectionProposal extends ASTRewriteCorrectionProposal {
	public static class LinkedModeGroup {
		final List fPositions= new ArrayList(); 
		final List fProposals= new ArrayList(); 
		
		public ITrackedNodePosition[] getPositions() {
			return (ITrackedNodePosition[])fPositions.toArray(new ITrackedNodePosition[fPositions.size()]);
		}
		public IJavaCompletionProposal[] getProposals() {
			return (IJavaCompletionProposal[])fProposals.toArray(new IJavaCompletionProposal[fProposals.size()]);
		}
	}
	
	private ITrackedNodePosition fSelectionDescription;
	private Map fLinkGroups;
	private List fPositionOrder;
	/**
	 * Constructs a linked correction proposal.
	 * @param name The display name of the proposal.
	 * @param cu The compilation unit that is modified.
	 * @param rewrite The AST rewrite that is invoked when the proposal is applied
	 *  <code>null</code> can be passed if {@link #getRewrite()} is overridden.
	 * @param relevance The relevance of this proposal.