Improved the mapping of logging statements
@@ -356,7 +356,19 @@ public abstract class AbstractCodeMapping {
}
private boolean identical() {
- return getReplacements().size() == 1 && fragment1.getVariableDeclarations().size() == fragment2.getVariableDeclarations().size();
+ if(getReplacements().size() == 1 && fragment1.getVariableDeclarations().size() == fragment2.getVariableDeclarations().size()) {
+ return true;
+ }
+ int stringLiteralReplacents = 0;
+ for(Replacement r : replacements) {
+ if((r.getBefore().startsWith("\"") && r.getBefore().endsWith("\"")) || (r.getAfter().startsWith("\"") && r.getAfter().endsWith("\""))) {
+ stringLiteralReplacents++;
+ }
+ }
+ if(stringLiteralReplacents == replacements.size()) {
+ return true;
+ }
+ return false;
}
private boolean wrappedAsArgument(AbstractExpression initializer, String replacedExpression) {
