package com.example;
public class B {
private int field1;
private int field2;
private int field3;
public int getField1() {
return field1;
}
public int getField2() {
return field2;
}
public int getField3() {
return field3;
}
}
package com.example;
public class A {
void method1() {
B b = new B();
b.getField1();
b.getField2();
}
void method2() {
B b = new B();
b.getField1();
b.getField3();
}
void method3() {
B b = new B();
b.getField2();
b.getField3();
}
}
Problem 1: From logical point of view the first suggestion is correct. But where are the two others which are symmetrical?
Problem 2: The second refactoring is very strange. It suggests to move getter. And such suggestions arise very often. For example there are many of them in spellchecker module of community IDEA project.
CCDA output:
Problem 1: From logical point of view the first suggestion is correct. But where are the two others which are symmetrical? Problem 2: The second refactoring is very strange. It suggests to move getter. And such suggestions arise very often. For example there are many of them in spellchecker module of community IDEA project.