Skip to content

Commit 09137f4

Browse files
committed
[ci] Various small cleanups
1 parent 57d10a6 commit 09137f4

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

src/test/java/org/apache/ibatis/builder/xml/dynamic/ExpressionEvaluatorTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ void shouldIterateOverIterable() {
9292
final Iterable<?> iterable = evaluator.evaluateIterable("array", parameterObject);
9393
int i = 0;
9494
for (Object o : iterable) {
95-
assertEquals(String.valueOf(++i), o);
95+
i++;
96+
assertEquals(String.valueOf(i), o);
9697
}
9798
}
9899

src/test/java/org/apache/ibatis/executor/BaseExecutorTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,12 +326,11 @@ void shouldSelectAuthorViaOutParams() throws Exception {
326326
assertEquals("[email protected]", author.getEmail());
327327
assertNull(author.getBio());
328328
} catch (ExecutorException e) {
329-
if (executor instanceof CachingExecutor) {
330-
// TODO see issue #464. Fail is OK.
331-
assertTrue(e.getMessage().contains("OUT params is not supported"));
332-
} else {
329+
if (!(executor instanceof CachingExecutor)) {
333330
throw e;
334331
}
332+
// TODO see issue #464. Fail is OK.
333+
assertTrue(e.getMessage().contains("OUT params is not supported"));
335334
} finally {
336335
executor.rollback(true);
337336
executor.close(false);

src/test/java/org/apache/ibatis/io/VFSTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void invoke() throws IOException, NoSuchMethodException {
9797

9898
}
9999

100-
private class InstanceGetterProcedure implements Runnable {
100+
private static class InstanceGetterProcedure implements Runnable {
101101

102102
volatile VFS instanceGot;
103103

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
context.put("data", new DataClass());
4343
ExecutorService executor = Executors.newCachedThreadPool();
4444
IntStream.range(0, run).forEach(i -> {
45-
futures.add(executor.submit(() -> {
46-
return OgnlCache.getValue("data.id", context);
47-
}));
45+
futures.add(executor.submit(() -> OgnlCache.getValue("data.id", context)));
4846
});
4947
for (int i = 0; i < run; i++) {
5048
assertNotNull(futures.get(i).get());

src/test/java/org/apache/ibatis/type/TypeHandlerRegistryTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,11 @@ void shouldAutoRegisterEnumTypeInMultiThreadEnvironment() throws Exception {
238238
try {
239239
for (int iteration = 0; iteration < 2000; iteration++) {
240240
TypeHandlerRegistry typeHandlerRegistry = new TypeHandlerRegistry();
241-
List<Future<Boolean>> taskResults = IntStream.range(0, 2).mapToObj(taskIndex -> executorService.submit(() -> {
242-
return typeHandlerRegistry.hasTypeHandler(TestEnum.class, JdbcType.VARCHAR);
243-
})).collect(Collectors.toList());
244-
for (int i = 0; i < taskResults.size(); i++) {
245-
Future<Boolean> future = taskResults.get(i);
241+
List<Future<Boolean>> taskResults = IntStream.range(0, 2)
242+
.mapToObj(taskIndex -> executorService
243+
.submit(() -> typeHandlerRegistry.hasTypeHandler(TestEnum.class, JdbcType.VARCHAR)))
244+
.collect(Collectors.toList());
245+
for (Future<Boolean> future : taskResults) {
246246
assertTrue(future.get(), "false is returned at round " + iteration);
247247
}
248248
}

0 commit comments

Comments
 (0)