Project: JDT
Bug 47509 Refactor name of package fragment does not handle on demand import
Reported: 2003-11-26 07:33:01 | Status: verified fixed

Build Eclipse 2.1.2 On the following setup, select package fragment 'p' located in project B and rename it into 'q'. It will rename the 'import p.*;' statement, but did not realize there was still a use for it due to other fragment. It should have inserted an extra import during the rename action. Project A +- package p +- A.java Project B prereqs A +- package p | +- B.java +- package c +- C.java package c; import p.*; public class C { }

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots1/in/srcPrg/p/p/A.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots1/in/srcTest/p/p/ATest.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots1/in/srcTest/tests/AllTests.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots1/out/srcPrg/q/A.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots1/out/srcTest/p/p/ATest.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots1/out/srcTest/tests/AllTests.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots2/in/srcPrg/p/p/A.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots2/in/srcTest/p/p/ATest.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots2/in/srcTest/p/p/TestHelper.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots2/in/srcTest/tests/AllTests.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots2/in/srcTest/tests/QualifiedTests.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots2/out/srcPrg/q/A.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots2/out/srcTest/p/p/ATest.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots2/out/srcTest/p/p/TestHelper.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots2/out/srcTest/tests/AllTests.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots2/out/srcTest/tests/QualifiedTests.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots3/in/srcPrg/p/p/ToQ.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots3/in/srcTest/p/p/Ref.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots3/out/srcPrg/q/ToQ.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots3/out/srcTest/p/p/Ref.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots4/in/srcPrg/p/A.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots4/in/srcPrg/p/B.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots4/in/srcTest/p/ATest.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots4/out/srcPrg/a/b/c/A.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots4/out/srcPrg/a/b/c/B.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots4/out/srcTest/p/ATest.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots5/in/srcPrg/p/p/A.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots5/in/srcTest/p/p/ATest.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots5/out/srcPrg/p/p/A.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots5/out/srcTest/q/ATest.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots6/in/srcPrg/p/p/A.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots6/in/srcTest/p/p/ATest.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots6/out/srcPrg/p/p/A.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots6/out/srcTest/cheese/ATest.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots7/in/srcPrj.other/pack/Namesake.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots7/in/srcPrj.ref/pack/Referer.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots7/in/srcPrj.ref/pack/man/StarImporter.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots7/in/srcPrj/pack/DingsDa.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots7/out/srcPrj.other/pack/Namesake.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots7/out/srcPrj.ref/pack/Referer.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots7/out/srcPrj.ref/pack/man/StarImporter.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/testImportFromMultiRoots7/out/srcPrj/com/packt/DingsDa.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/RefactoringScopeFactory.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenamePackageProcessor.java