Skip to content

Commit 296876d

Browse files
committed
[ci] Use diamond operators (test classes)
squash with diamond
1 parent 7c5df27 commit 296876d

File tree

7 files changed

+11
-12
lines changed

7 files changed

+11
-12
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,7 @@ void shouldCacheMapperMethod() throws Exception {
588588
try (SqlSession session = sqlSessionFactory.openSession()) {
589589

590590
// Create another mapper instance with a method cache we can test against:
591-
final MapperProxyFactory<BoundBlogMapper> mapperProxyFactory = new MapperProxyFactory<BoundBlogMapper>(
592-
BoundBlogMapper.class);
591+
final MapperProxyFactory<BoundBlogMapper> mapperProxyFactory = new MapperProxyFactory<>(BoundBlogMapper.class);
593592
assertEquals(BoundBlogMapper.class, mapperProxyFactory.getMapperInterface());
594593
final BoundBlogMapper mapper = mapperProxyFactory.newInstance(session);
595594
assertNotSame(mapper, mapperProxyFactory.newInstance(session));

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ void shouldTrimNoSetClause() throws Exception {
261261

262262
@Test
263263
void shouldIterateOnceForEachItemInCollection() throws Exception {
264-
final HashMap<String, String[]> parameterObject = new HashMap<String, String[]>() {
264+
final HashMap<String, String[]> parameterObject = new HashMap<>() {
265265
{
266266
put("array", new String[] { "one", "two", "three" });
267267
}
@@ -280,7 +280,7 @@ void shouldIterateOnceForEachItemInCollection() throws Exception {
280280

281281
@Test
282282
void shouldHandleOgnlExpression() throws Exception {
283-
final HashMap<String, String> parameterObject = new HashMap<String, String>() {
283+
final HashMap<String, String> parameterObject = new HashMap<>() {
284284
{
285285
put("name", "Steve");
286286
}
@@ -294,7 +294,7 @@ void shouldHandleOgnlExpression() throws Exception {
294294

295295
@Test
296296
void shouldSkipForEachWhenCollectionIsEmpty() throws Exception {
297-
final HashMap<String, Integer[]> parameterObject = new HashMap<String, Integer[]>() {
297+
final HashMap<String, Integer[]> parameterObject = new HashMap<>() {
298298
{
299299
put("array", new Integer[] {});
300300
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class Bean {
8383

8484
@Test
8585
void shouldIterateOverIterable() {
86-
final HashMap<String, String[]> parameterObject = new HashMap<String, String[]>() {
86+
final HashMap<String, String[]> parameterObject = new HashMap<>() {
8787
{
8888
put("array", new String[] { "1", "2", "3" });
8989
}

src/test/java/org/apache/ibatis/submitted/sqlprovider/OurSqlBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ private Class<?> getEntityClass(ProviderContext providerContext) {
284284
private Map<String, String> getColumnMap(ProviderContext context) {
285285
Class<?> entityClass = getEntityClass(context);
286286
Field[] fields = entityClass.getDeclaredFields();
287-
Map<String, String> columnMap = new LinkedHashMap<String, String>();
287+
Map<String, String> columnMap = new LinkedHashMap<>();
288288
for (Field field : fields) {
289289
BaseMapper.Column column = field.getAnnotation(BaseMapper.Column.class);
290290
if (column != null) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ enum MyEnum {
2828
ONE, TWO
2929
}
3030

31-
private static final TypeHandler<MyEnum> TYPE_HANDLER = new EnumOrdinalTypeHandler<MyEnum>(MyEnum.class);
31+
private static final TypeHandler<MyEnum> TYPE_HANDLER = new EnumOrdinalTypeHandler<>(MyEnum.class);
3232

3333
@Override
3434
@Test

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ enum MyEnum {
2929
ONE, TWO
3030
}
3131

32-
private static final TypeHandler<MyEnum> TYPE_HANDLER = new EnumTypeHandler<MyEnum>(MyEnum.class);
32+
private static final TypeHandler<MyEnum> TYPE_HANDLER = new EnumTypeHandler<>(MyEnum.class);
3333

3434
@Override
3535
@Test

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void shouldRegisterAndRetrieveTypeHandler() {
6262

6363
@Test
6464
void shouldRegisterAndRetrieveComplexTypeHandler() {
65-
TypeHandler<List<URI>> fakeHandler = new TypeHandler<List<URI>>() {
65+
TypeHandler<List<URI>> fakeHandler = new TypeHandler<>() {
6666

6767
@Override
6868
public void setParameter(PreparedStatement ps, int i, List<URI> parameter, JdbcType jdbcType) {
@@ -89,7 +89,7 @@ public List<URI> getResult(ResultSet rs, String columnName) {
8989

9090
};
9191

92-
TypeReference<List<URI>> type = new TypeReference<List<URI>>() {
92+
TypeReference<List<URI>> type = new TypeReference<>() {
9393
};
9494

9595
typeHandlerRegistry.register(type, fakeHandler);
@@ -98,7 +98,7 @@ public List<URI> getResult(ResultSet rs, String columnName) {
9898

9999
@Test
100100
void shouldAutoRegisterAndRetrieveComplexTypeHandler() {
101-
TypeHandler<List<URI>> fakeHandler = new BaseTypeHandler<List<URI>>() {
101+
TypeHandler<List<URI>> fakeHandler = new BaseTypeHandler<>() {
102102

103103
@Override
104104
public void setNonNullParameter(PreparedStatement ps, int i, List<URI> parameter, JdbcType jdbcType) {

0 commit comments

Comments
 (0)