AutoRefactor
AutoRefactor copied to clipboard
SimplifyExpressionRefactoring: Creates compile error
Here the diff:
- return (equalsKeyValues(compObj)
+ return equalsKeyValues(compObj)
&& ObjectUtil.safeEquals(name, compObj.getName())
// && (xxx == compObj.getXxx())
&& (yyy == compObj.getYyy())
@@ -188,8 +187,7 @@
&& (num == compObj.getNum())
// && ObjectUtil.safeEquals(name2, compObj.getName2())
// && ObjectUtil.safeEquals(name3, compObj.getName3())
- // && ObjectUtil.safeEquals(copytext, compObj.getCopytext())
- );
+ // && ObjectUtil.safeEquals(copytext, compObj.getCopytext());
}
I think it is a bug in JDT
Reduced test case:
public boolean areEqual(Object o, Object o2) {
return (o == o2
// commented code
);
}
is wongly refactored to code that does not compile:
public boolean areEqual(Object o, Object o2) {
return o == o2
// commented code;
}