mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-04 18:13:32 +00:00
pmd:ConsecutiveAppendsShouldReuse - Consecutive Appends Should Reuse
This commit is contained in:
1 parent
1a55f3a420
commit
d00bfae5ee
3 files changed
+22
-26
No files matched your search
@@ -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());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user