pmd:ConsecutiveAppendsShouldReuse - Consecutive Appends Should Reuse

This commit is contained in:
Mohammed Ezzat
2016-01-26 19:55:32 +02:00
parent 1a55f3a420
commit d00bfae5ee
3 changed files with 22 additions and 26 deletions

View File

@ -63,12 +63,12 @@ public class CustomerTest {
@Test
public void testToString() {
final StringBuffer buffer = new StringBuffer();
buffer.append("Customer{id=");
buffer.append("" + customer.getId());
buffer.append(", firstName='");
buffer.append(customer.getFirstName());
buffer.append("\', lastName='");
buffer.append(customer.getLastName() + "\'}");
buffer.append("Customer{id=")
.append("" + customer.getId())
.append(", firstName='")
.append(customer.getFirstName())
.append("\', lastName='")
.append(customer.getLastName() + "\'}");
assertEquals(buffer.toString(), customer.toString());
}
}