Project: JDT
Bug 117465 [refactoring] [move] Moving method to another class incorrectly sets field visibility
Reported: 2005-11-22 06:12:04 | Status: resolved fixed

Initial source: package test1; public class Test1 { public void methodToMove() {} private TestTarget target; public TestTarget getTestTarget() { return target; } } package test1; public class TestTarget {} package test2; import test1.Test1; public class Test2 { public Test2() { new Test1().methodToMove(); }} After moving method: package test1; public class Test1 { TestTarget target; public TestTarget getTestTarget() { return target; } } package test1; public class TestTarget { public void methodToMove() {} } package test2; import test1.Test1; public class Test2 { public Test2() { new Test1().target.methodToMove(); }} Test.target field should be public instead of friendly.

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test34/in/Test1.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test34/in/Test2.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test34/in/TestTarget.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test34/out/Test1.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test34/out/Test2.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test34/out/TestTarget.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test35/in/Test1.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test35/in/Test2.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test35/in/TestTarget.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test35/out/Test1.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test35/out/Test2.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test35/out/TestTarget.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/MoveInstanceMethodTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java