Community
Participate
Working Groups
I have my code setup in the default package: class A implements B; class C; interface B { method m{C c}; } moving the interface B to a new interfaces package creates interfaces\interface B which imports C which isn't available and results is a compiler error; I believe it would be beneficial if imports from default package would be marked as warnings when refactoring to different pacakges.
Moving to JDT/UI
This is still relevant in 4.19 (Version: 2021-03 (4.19.0), Build id: 20210312-0638). As the original example is incomplete and unnecessarily complicated, here's a restatement of the problem: If a type is moved to a different package (by dragging it there in the Package Explorer or using the "Move" refactoring), type references across packages (in both directions) cause errors if the types referred to are not public. For instance, in the following code: // A.java package original; class A extends B {}; // B.java package original; class B { C c; } // C.java package original; class C {} moving B to package "interfaces" generates the line import interfaces.B; in A.java, which doesn't compile since B isn't public, and the line import original.C; in B.java, which doesn't compile since C isn't public. The solution would be to make the classes that are being referred to across packages public (or to provide an option to do so).