Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 500312

Summary: Renaming package or moving class does not update import statements when project is depended on indirectly
Product: [Eclipse Project] JDT Reporter: Stefan Dijkstra <s.dijkstra>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact: Manoj N Palat <manoj.palat>
Severity: normal    
Priority: P3 CC: jarthana, manoj.palat
Version: 4.6   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug

Description Stefan Dijkstra CLA 2016-08-26 02:31:12 EDT
Situation: Project A depends on project B and exports it. Project C does not directly depend on B, but does depend on A so it gains access to all classes in B indirectly.
Action: I rename a package "com.foo" inside B to "com.bar".
Expectation: I expect all import statements in C that reference classes in B's "com.foo" to be updated to "com.bar".
Error: The import statements are not updated and cause compile errors.

Workaround 1: I can remove the old import statements manually, and then use "Organize Imports" to insert the correct ones.
Workaround 2: I can add to project C an explicit dependency on project B. Now, renaming a package or moving a class in B do update the import statements in C correctly.

Note: The exact same thing happens when moving a class in B from one package to another: the import statements are not updated.
Note: I did make sure the checkbox "Update references .." was checked in the "Rename" and "Move" refactoring dialog windows.

-- Configuration Details --
Product: Eclipse 4.6.0.20160613-1800 (org.eclipse.epp.package.java.product)
Installed Features:
 org.eclipse.jdt 3.12.0.v20160606-1100
Comment 1 Eclipse Genie CLA 2019-08-16 17:20:01 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.