summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoopur Gupta2013-02-21 07:03:53 (EST)
committer Dani Megert2013-02-21 07:03:53 (EST)
commit470ff6a9d1aefcd997dc6e2968d0e433923f0ebd (patch)
tree8d6eb0199675382803def93c59c97905aaf70740
parentab40939a6c55e0fb03045c2f0131c8cea08b2183 (diff)
downloadeclipse.jdt.ui-470ff6a9d1aefcd997dc6e2968d0e433923f0ebd.zip
eclipse.jdt.ui-470ff6a9d1aefcd997dc6e2968d0e433923f0ebd.tar.gz
eclipse.jdt.ui-470ff6a9d1aefcd997dc6e2968d0e433923f0ebd.tar.bz2
Fixed bug 346230: [clean up] certain combination of Clean Up settings
messes up the code (ie. garbles it)
-rw-r--r--org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CodeStyleFix.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CodeStyleFix.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CodeStyleFix.java
index b9c8f56..91d47c6 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CodeStyleFix.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CodeStyleFix.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@ package org.eclipse.jdt.internal.corext.fix;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
@@ -655,6 +656,14 @@ public class CodeStyleFix extends CompilationUnitRewriteOperationsFix {
Expression qualifier= op.fQualifier;
if (!(qualifier instanceof MethodInvocation) || !isMethodArgument(qualifier)) {
+ for (Iterator<CompilationUnitRewriteOperation> it= result.iterator(); it.hasNext();) { // see bug 346230
+ CompilationUnitRewriteOperation oper= it.next();
+ if (oper instanceof CodeStyleFix.AddThisQualifierOperation
+ && ((CodeStyleFix.AddThisQualifierOperation) oper).fName.equals(qualifier)) {
+ result.remove(oper);
+ break;
+ }
+ }
result.add(op);
}
}