Skip to content

Commit 6a2e63c

Browse files
committed
tests: Do not use string builder where not needed
underlying jvm will handle this making it easier to read.
1 parent c24c1a4 commit 6a2e63c

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

src/test/java/org/apache/ibatis/submitted/nestedresulthandler/Item.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@ public class Item {
2121

2222
@Override
2323
public String toString() {
24-
return new StringBuilder().append("Item(").append(id).append(", ").append(name).append(" )").toString();
24+
return "Item(" + id + ", " + name + " )";
2525
}
2626

2727
public Integer getId() {

src/test/java/org/apache/ibatis/submitted/nestedresulthandler/Person.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,8 +26,7 @@ public class Person {
2626

2727
@Override
2828
public String toString() {
29-
return new StringBuilder().append("Person(").append(id).append(", ").append(name).append(", ").append(items)
30-
.append(" )").toString();
29+
return "Person(" + id + ", " + name + ", " + items + " )";
3130
}
3231

3332
public Integer getId() {

src/test/java/org/apache/ibatis/submitted/nestedresulthandler/PersonItemPair.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,8 +24,7 @@ public class PersonItemPair {
2424

2525
@Override
2626
public String toString() {
27-
return new StringBuilder().append("PersonItemPair(").append(person).append(", ").append(item).append(" )")
28-
.toString();
27+
return "PersonItemPair(" + person + ", " + item + " )";
2928
}
3029

3130
public Person getPerson() {

0 commit comments

Comments
 (0)