Fix some raw types

This commit is contained in:
Philippe Marschall
2020-11-15 14:01:04 +01:00
committed by Mahmoud Ben Hassine
parent c9e06b2a7f
commit f15edd414a
12 changed files with 39 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -237,7 +237,6 @@ public class ExtendedConnectionDataSourceProxy implements SmartDataSource, Initi
* @param target the original Connection to wrap
* @return the wrapped Connection
*/
@SuppressWarnings("rawtypes")
protected Connection getCloseSuppressingConnectionProxy(Connection target) {
return (Connection) Proxy.newProxyInstance(ConnectionProxy.class.getClassLoader(),
new Class[] { ConnectionProxy.class }, new CloseSuppressingInvocationHandler(target, this));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2019 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -158,7 +158,7 @@ public class JdbcBatchItemWriter<T> implements ItemWriter<T>, InitializingBean {
/* (non-Javadoc)
* @see org.springframework.batch.item.ItemWriter#write(java.util.List)
*/
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings("unchecked")
@Override
public void write(final List<? extends T> items) throws Exception {

View File

@@ -114,7 +114,7 @@ public class AvroItemWriterBuilderTests extends AvroItemWriterTestSupport {
@Test(expected = IllegalArgumentException.class)
public void shouldFailWitNoType() {
new AvroItemWriterBuilder()
new AvroItemWriterBuilder<>()
.resource(output)
.schema(schemaResource)
.build();

View File

@@ -42,6 +42,8 @@ import org.springframework.data.mongodb.core.convert.DbRefResolver;
import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
import org.springframework.data.mongodb.core.convert.MongoConverter;
import org.springframework.data.mongodb.core.mapping.MongoMappingContext;
import org.springframework.data.mongodb.core.mapping.MongoPersistentEntity;
import org.springframework.data.mongodb.core.mapping.MongoPersistentProperty;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.support.TransactionCallback;
@@ -79,7 +81,7 @@ public class MongoItemWriterTests {
when(this.template.bulkOps(any(), anyString())).thenReturn(this.bulkOperations);
when(this.template.bulkOps(any(), any(Class.class))).thenReturn(this.bulkOperations);
MappingContext mappingContext = new MongoMappingContext();
MappingContext<MongoPersistentEntity<?>, MongoPersistentProperty> mappingContext = new MongoMappingContext();
MappingMongoConverter mongoConverter = spy(new MappingMongoConverter(this.dbRefResolver, mappingContext));
when(this.template.getConverter()).thenReturn(mongoConverter);
@@ -305,7 +307,6 @@ public class MongoItemWriterTests {
@Test
public void testResourceKeyCollision() throws Exception {
final int limit = 5000;
@SuppressWarnings("unchecked")
List<MongoItemWriter<String>> writers = new ArrayList<>(limit);
final String[] documents = new String[limit];
final String[] results = new String[limit];

View File

@@ -39,6 +39,8 @@ import org.springframework.data.mongodb.core.convert.DbRefResolver;
import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
import org.springframework.data.mongodb.core.convert.MongoConverter;
import org.springframework.data.mongodb.core.mapping.MongoMappingContext;
import org.springframework.data.mongodb.core.mapping.MongoPersistentEntity;
import org.springframework.data.mongodb.core.mapping.MongoPersistentProperty;
import org.springframework.data.mongodb.core.query.Query;
import static org.junit.Assert.assertEquals;
@@ -72,7 +74,7 @@ public class MongoItemWriterBuilderTests {
when(this.template.bulkOps(any(), anyString())).thenReturn(this.bulkOperations);
when(this.template.bulkOps(any(), any(Class.class))).thenReturn(this.bulkOperations);
MappingContext mappingContext = new MongoMappingContext();
MappingContext<MongoPersistentEntity<?>, MongoPersistentProperty> mappingContext = new MongoMappingContext();
mongoConverter = spy(new MappingMongoConverter(this.dbRefResolver, mappingContext));
when(this.template.getConverter()).thenReturn(mongoConverter);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2008 the original author or authors.
* Copyright 2006-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -152,7 +152,7 @@ public class JdbcBatchItemWriterNamedParameterTests {
assertEquals("bar", results.get("foo"));
}
@SuppressWarnings({ "rawtypes", "serial", "unchecked" })
@SuppressWarnings( "serial" )
@Test
public void testWriteAndFlushMapWithItemSqlParameterSourceProvider() throws Exception {
JdbcBatchItemWriter<Map<String, Object>> mapWriter = new JdbcBatchItemWriter<>();

View File

@@ -377,7 +377,7 @@ public class KafkaItemReaderTests {
@Test
public void testReadFromMultiplePartitionsAfterRestart() throws ExecutionException, InterruptedException {
List<ListenableFuture> futures = new ArrayList<>();
List<ListenableFuture<SendResult<String, String>>> futures = new ArrayList<>();
futures.add(this.template.send("topic4", 0, null, "val0"));
futures.add(this.template.send("topic4", 0, null, "val2"));
futures.add(this.template.send("topic4", 0, null, "val4"));
@@ -387,7 +387,7 @@ public class KafkaItemReaderTests {
futures.add(this.template.send("topic4", 1, null, "val5"));
futures.add(this.template.send("topic4", 1, null, "val7"));
for (ListenableFuture future : futures) {
for (ListenableFuture<?> future : futures) {
future.get();
}