Project: JDT
Bug 76348 'import static' becomes 'import' while renaming package
Reported: 2004-10-15 08:20:32 | Status: verified fixed

Using build I20041013. I've following test case: s1/j/l/S.java package s1.j.l; public class S { public final static String out = "out"; public final static String in = "in"; public static class Member { public static int RED = 0; } } s1/B.java: package s1; import static s1.j.l.S.*; public class B { public void foo() { out.toString(); in.toString(); } } Then I want to rename package "s1.j.l" as "s1.java.lang". Looking at preview I see that static import statement in B.java is rewritten as: "import s1.java.lang.S.*" instead of expected "import static s1.java.lang.S.*" This is quite annoying as after renaming, B.java does no longer compile! Note that you need HEAD from org.eclipse.jdt.core otherwise Search will not find the package reference in static import statement...

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testStatic1/in/s1/B.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testStatic1/in/s1/j/l/S.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testStatic1/out/s1/B.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testStatic1/out/s1/java/lang/S.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testStaticMultiRoots1/in/srcPrg/p/p/A.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testStaticMultiRoots1/in/srcTest/p/p/ATest.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testStaticMultiRoots1/in/srcTest/tests/AllTests.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testStaticMultiRoots1/out/srcPrg/q/A.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testStaticMultiRoots1/out/srcTest/p/p/ATest.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testStaticMultiRoots1/out/srcTest/tests/AllTests.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/RenamePackageTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenamePackageProcessor.java