You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When moving the dependentMethod method to the TargetClass class, the use of private field value in dependentMethod resulted in compilation errors after move method refactoring.
class SourceClass {
private int value;
TargetClass c;
public void setValue(int value) {
this.value = value;
}
//move method dependentMethod to TargetClass
public void dependentMethod() {
System.out.println("Dependent method: " + value);
}
}
class TargetClass {
public void callDependentMethod() {
SourceClass source = new SourceClass();
source.dependentMethod();
}
}
The refactorin results are as follows:
The text was updated successfully, but these errors were encountered:
- fix MoveInstanceMethodProcessor.createMethodBody() to perform any
needed adjustments to field modifiers if required by the move
- add new test to MoveInstanceMethodTests
- fixeseclipse-jdt#1297
When moving the dependentMethod method to the TargetClass class, the use of private field value in dependentMethod resulted in compilation errors after move method refactoring.
class SourceClass {
private int value;
TargetClass c;
public void setValue(int value) {
this.value = value;
}
}
class TargetClass {
public void callDependentMethod() {
SourceClass source = new SourceClass();
source.dependentMethod();
}
}
The refactorin results are as follows:
The text was updated successfully, but these errors were encountered: