View | Details | Raw Unified | Return to bug 420510
Collapse All | Expand All

(-)a/org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportStaticMethod/in/a/A.java (+5 lines)
Added Link Here
1
package a;
2
3
public class A {
4
	public static void foo() { }
5
}
(-)a/org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportStaticMethod/in/a/B.java (+6 lines)
Added Link Here
1
package a;
2
3
public class B {
4
	public static void foo(String s) { }
5
6
}
(-)a/org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportStaticMethod/in/b/C.java (+9 lines)
Added Link Here
1
package b;
2
import static a.A.foo;
3
import static a.B.foo;
4
public class C {
5
  public void test() {
6
	  foo();
7
	  foo("hello");
8
  }
9
}
(-)a/org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportStaticMethod/out/b/C.java (+9 lines)
Added Link Here
1
package b;
2
import static x.A.foo;
3
import static x.B.foo;
4
public class C {
5
  public void test() {
6
	  foo();
7
	  foo("hello");
8
  }
9
}
(-)a/org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportStaticMethod/out/x/A.java (+5 lines)
Added Link Here
1
package x;
2
3
public class A {
4
	public static void foo() { }
5
}
(-)a/org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportStaticMethod/out/x/B.java (+6 lines)
Added Link Here
1
package x;
2
3
public class B {
4
	public static void foo(String s) { }
5
6
}
(-)a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/RenamePackageTests.java (+5 lines)
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Samrat Dhillon samrat.dhillon@gmail.com [rename] "Rename package" refactoring drops 2nd static import of method with same name but different signature https://bugs.eclipse.org/bugs/show_bug.cgi?id=420510
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.jdt.ui.tests.refactoring;
12
package org.eclipse.jdt.ui.tests.refactoring;
12
13
Lines 1437-1442 Link Here
1437
	public void testStatic1() throws Exception {
1438
	public void testStatic1() throws Exception {
1438
		helper2(new String[]{"s1.j.l", "s1"}, new String[][]{{"S"},{"B"}}, "s1.java.lang");
1439
		helper2(new String[]{"s1.j.l", "s1"}, new String[][]{{"S"},{"B"}}, "s1.java.lang");
1439
	}
1440
	}
1441
	
1442
	public void testImportStaticMethod() throws Exception{
1443
		helper2(new String[]{"a", "b"}, new String[][]{{"A","B"},{"C"}}, "x");
1444
	}
1440
1445
1441
	public void testStaticMultiRoots1() throws Exception {
1446
	public void testStaticMultiRoots1() throws Exception {
1442
		helperProjectsPrgTest(
1447
		helperProjectsPrgTest(
(-)a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenamePackageProcessor.java (-2 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
2
 * Copyright (c) 2000, 2013 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Samrat Dhillon samrat.dhillon@gmail.com [rename] "Rename package" refactoring drops 2nd static import of method with same name but different signature https://bugs.eclipse.org/bugs/show_bug.cgi?id=420510
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.jdt.internal.corext.refactoring.rename;
12
package org.eclipse.jdt.internal.corext.refactoring.rename;
12
13
Lines 1081-1087 Link Here
1081
				}
1082
				}
1082
				for (Iterator<String[]> iterator= importChange.fStaticToAdd.iterator(); iterator.hasNext();) {
1083
				for (Iterator<String[]> iterator= importChange.fStaticToAdd.iterator(); iterator.hasNext();) {
1083
					String[] toAdd= iterator.next();
1084
					String[] toAdd= iterator.next();
1084
					importRewrite.addStaticImport(toAdd[0], toAdd[1], true);
1085
					importRewrite.addStaticImport(toAdd[0], toAdd[1], false);
1085
				}
1086
				}
1086
				for (Iterator<String> iterator= importChange.fToAdd.iterator(); iterator.hasNext();) {
1087
				for (Iterator<String> iterator= importChange.fToAdd.iterator(); iterator.hasNext();) {
1087
					importRewrite.addImport(iterator.next());
1088
					importRewrite.addImport(iterator.next());

Return to bug 420510