Community
Participate
Working Groups
Build Identifier: 20120614-1722 If the package of a Java class is manually modified, then a quick fix appears to move the file in the correct new package. However, if the class has dependencies from the same package - these do not appear in the imports (because they're in the same package). Moving the file should however add these necessary imports automatically - otherwise the file will have compilation errors. To reproduce, simply move a java class that uses another one from the same package - it will no longer compile. Reproducible: Always
To make sure we're on the same page, are you suggesting the quick fix ("Move 'xxx.java' to package 'y'") should do the same as Refactor > Mode (Alt + Shift + V) from the context menu?
Yes I am. Refactor would leave the system in a consistent state, whereas this operation doesn't. Thanks. Eugen.
I thought the problem is in organize imports, but if the refactor works fine, then this should too. Moving to JDT/UI for comment.
Remotely related to bug 222700. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=222700#c5 Ideally we should use the 'Move' refactoring operation to handle this scenario, which will take care of the internal consistency of the Java file. But since this Quick Fix require changes to a single file, we should take this up as an improvement for the current Quick Fix.