Skip to content

Commit c5ec7a1

Browse files
authored
Merge pull request #3352 from hazendaz/next
Null safety, diamond operator, and lambda cleanup
2 parents 814d755 + fee0d54 commit c5ec7a1

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/main/java/org/apache/ibatis/jdbc/AbstractSQL.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ private void sqlClause(SafeAppendable builder, String keyword, List<String> part
712712
String last = "________";
713713
for (int i = 0, n = parts.size(); i < n; i++) {
714714
String part = parts.get(i);
715-
if (i > 0 && !part.equals(AND) && !part.equals(OR) && !last.equals(AND) && !last.equals(OR)) {
715+
if (i > 0 && !AND.equals(part) && !OR.equals(part) && !AND.equals(last) && !OR.equals(last)) {
716716
builder.append(conjunction);
717717
}
718718
builder.append(part);

src/test/java/org/apache/ibatis/binding/BindingTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void shouldSelectBlogWithPostsUsingSubSelect() {
106106
void shouldFindPostsInList() {
107107
try (SqlSession session = sqlSessionFactory.openSession()) {
108108
BoundAuthorMapper mapper = session.getMapper(BoundAuthorMapper.class);
109-
List<Post> posts = mapper.findPostsInList(new ArrayList<Integer>() {
109+
List<Post> posts = mapper.findPostsInList(new ArrayList<>() {
110110
private static final long serialVersionUID = 1L;
111111
{
112112
add(1);
@@ -430,7 +430,7 @@ void shouldExecuteBoundSelectOneBlogStatementWithConstructorUsingXMLConfig() {
430430
void shouldSelectOneBlogAsMap() {
431431
try (SqlSession session = sqlSessionFactory.openSession()) {
432432
BoundBlogMapper mapper = session.getMapper(BoundBlogMapper.class);
433-
Map<String, Object> blog = mapper.selectBlogAsMap(new HashMap<String, Object>() {
433+
Map<String, Object> blog = mapper.selectBlogAsMap(new HashMap<>() {
434434
private static final long serialVersionUID = 1L;
435435
{
436436
put("id", 1);

src/test/java/org/apache/ibatis/scripting/xmltags/OgnlCacheTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ class DataClass {
4242
List<Future<Object>> futures = new ArrayList<>();
4343
context.put("data", new DataClass());
4444
ExecutorService executor = Executors.newCachedThreadPool();
45-
IntStream.range(0, run).forEach(i -> {
46-
futures.add(executor.submit(() -> OgnlCache.getValue("data.id", context)));
47-
});
45+
IntStream.range(0, run).forEach(i -> futures.add(executor.submit(() -> OgnlCache.getValue("data.id", context))));
4846
for (int i = 0; i < run; i++) {
4947
assertNotNull(futures.get(i).get());
5048
}

0 commit comments

Comments
 (0)