Project: JDT
Bug 42439 Moving a private static method should change the visibility [refactoring]
Reported: 2003-09-03 07:45:16 | Status: verified fixed

class A has a private static method f(). I realize that I could reuse that elsewhere, and in fact, it has little to do with A, but is simply used from there. So, I create a "util" class B to hold that method. I use Refactor-Move. Because this private method was called from A, it worked. After the refactoring, it's now private to B, and the call to A cannot compile. Therefore, this type of move should change the visibility of the method. When A & B are in different packages, clearly it should be public. When they're in the same package, perhaps a dialog should be popped up with a choice. The "visibility choice dialog" might also be desirable when A & B are related, though I haven't thought that through. P.S. Would be really slick if I could specify a new class as part of the Move.

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test42/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test42/in/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test42/out/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test42/out/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test43/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test43/in/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test43/out/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test43/out/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test44/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test44/in/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test44/out/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test44/out/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test45/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test45/in/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test45/out/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test45/out/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test46/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test46/in/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test46/out/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test46/out/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test47/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test47/in/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test47/out/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test47/out/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test48/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test48/in/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test48/out/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test48/out/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test49/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test49/in/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test49/out/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test49/out/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test50/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test50/in/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test50/out/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/test50/out/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/testFail10/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/testFail10/in/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/testFail11/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/testFail11/in/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/testFail12/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/testFail12/in/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/testFail13/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/testFail13/in/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/testFail14/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/testFail14/in/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/testFail9/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveMembers/testFail9/in/B.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/MoveMembersTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MemberVisibilityAdjustor.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveStaticMembersProcessor.java