SimplifyBooleanExpressionFix: preserve comments during simple replacement

This commit is contained in:
Tagir Valeev
2018-01-15 13:08:37 +07:00
parent cf454fab2c
commit 128e018b9c
4 changed files with 10 additions and 8 deletions
@@ -1,7 +1,7 @@
class SideEffectReturn {
private boolean isValidValue(String value) {
try {
return <warning descr="Condition 'Test.valueOf(value) != null' is always 'true'">Test.valueOf(value) <caret>!= null</warning>;
return <warning descr="Condition 'Test.valueOf(value/*oops*/) != null' is always 'true'">Test.valueOf(value/*oops*/<caret>) != null</warning>;
} catch (IllegalArgumentException e) {
return false;
}
@@ -1,7 +1,7 @@
class SideEffectReturn {
private boolean isValidValue(String value) {
try {
Test.valueOf(value);
Test.valueOf(value/*oops*/);
return true;
} catch (IllegalArgumentException e) {
return false;