Skip to content

Commit 5f498fa

Browse files
committed
Polishing
1 parent 03e0ea2 commit 5f498fa

File tree

6 files changed

+15
-16
lines changed

6 files changed

+15
-16
lines changed

src/test/java/examples/paging/LimitAndOffsetAdapter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
* This adapter modifies the generated SQL by adding a LIMIT and OFFSET clause at the end
2929
* of the generated SQL. This can be used to create a paginated query.
3030
*
31-
* LIMIT and OFFSET has limited support in relational databases, so this cannot be considered
31+
* <p>LIMIT and OFFSET has limited support in relational databases, so this cannot be considered
3232
* a general solution for all paginated queries (and that is why this adapter lives only in the
3333
* test source tree and is not packaged with the core library code).
3434
*
35-
* I believe it works in MySQL, HSQLDB, and Postgres.
35+
* <p>I believe it works in MySQL, HSQLDB, and Postgres.
3636
*
37-
* <b>Important Note: </b> this adapter is no longer required for limit and offset support as the
37+
* <p><b>Important Note: </b> this adapter is no longer required for limit and offset support as the
3838
* library now supports limit and offset natively. However, this remains a good example of altering the generated
3939
* SQL before it is executed.
4040
*

src/test/java/examples/simple/LastName.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ public boolean equals(Object obj) {
5050
return false;
5151
LastName other = (LastName) obj;
5252
if (name == null) {
53-
if (other.name != null)
54-
return false;
55-
} else if (!name.equals(other.name))
56-
return false;
57-
return true;
53+
return other.name == null;
54+
} else return name.equals(other.name);
5855
}
5956
}

src/test/java/examples/spring/LastName.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ public boolean equals(Object obj) {
5050
return false;
5151
LastName other = (LastName) obj;
5252
if (name == null) {
53-
if (other.name != null)
54-
return false;
55-
} else if (!name.equals(other.name))
56-
return false;
57-
return true;
53+
return other.name == null;
54+
} else return name.equals(other.name);
5855
}
5956
}

src/test/java/examples/springbatch/bulkinsert/TestRecordGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class TestRecordGenerator implements ItemReader<PersonRecord> {
2323

2424
private int index = 0;
2525

26-
private static PersonRecord[] testRecords = {
26+
private static final PersonRecord[] testRecords = {
2727
new PersonRecord("Fred", "Flintstone"),
2828
new PersonRecord("Wilma", "Flintstone"),
2929
new PersonRecord("Pebbles", "Flintstone"),
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# About these Tests
22

3-
GitHub issues 100 and 102 exposed issues where calling the `build()` method at an unexpected location caused the rendered SQL to be incorrect. Changes for this issue now allow for the `build()` method to be called on any intermediate object in the select statement chain * regardless if further operations have been performed * and consistent renderings will occur.
3+
GitHub issues 100 and 102 exposed issues where calling the `build()` method at an unexpected location caused the
4+
rendered SQL to be incorrect. Changes for this issue now allow for the `build()` method to be called on any
5+
intermediate object in the select statement chain regardless if further operations have been performed and
6+
consistent renderings will occur.
47

5-
Tests in this directory cover many of the possible places where a `build()` method could be called and many of the possible paths through a select statement.
8+
Tests in this directory cover many of the possible places where a `build()` method could be called and many of the
9+
possible paths through a select statement.

src/test/java/issues/gh324/NameService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public NameService() {
4040
try {
4141
Class.forName(JDBC_DRIVER);
4242
InputStream is = getClass().getResourceAsStream("/issues/gh324/CreateDB.sql");
43+
assert is != null;
4344
try (Connection connection = DriverManager.getConnection(JDBC_URL, "sa", "")) {
4445
ScriptRunner sr = new ScriptRunner(connection);
4546
sr.setLogWriter(null);

0 commit comments

Comments
 (0)