Fix compiler warnings

- Add `@Nullable` where needed
- Suppress warnings where appropriate
- Add generic type definitions
This commit is contained in:
Mahmoud Ben Hassine
2023-07-12 20:55:18 +02:00
parent f4c663c452
commit 4763480c57
12 changed files with 22 additions and 8 deletions

View File

@@ -99,6 +99,7 @@ public class ChunkProcessorChunkHandler<S> implements ChunkHandler<S>, Initializ
* @param stepContribution the step contribution to update
* @throws Exception if there is a fatal exception
*/
@SuppressWarnings(value = { "unchecked", "rawtypes" })
private Throwable process(ChunkRequest<S> chunkRequest, StepContribution stepContribution) throws Exception {
Chunk chunk = chunkRequest.getItems();

View File

@@ -34,7 +34,7 @@ import org.springframework.transaction.PlatformTransactionManager;
* @author Mahmoud Ben Hassine
*/
@Configuration(proxyBeanMethods = false)
public class BatchIntegrationConfiguration implements InitializingBean {
public class BatchIntegrationConfiguration<I, O> implements InitializingBean {
private final JobExplorer jobExplorer;
@@ -44,7 +44,7 @@ public class BatchIntegrationConfiguration implements InitializingBean {
private RemoteChunkingManagerStepBuilderFactory remoteChunkingManagerStepBuilderFactory;
private RemoteChunkingWorkerBuilder remoteChunkingWorkerBuilder;
private RemoteChunkingWorkerBuilder<I, O> remoteChunkingWorkerBuilder;
private RemotePartitioningManagerStepBuilderFactory remotePartitioningManagerStepBuilderFactory;
@@ -65,7 +65,7 @@ public class BatchIntegrationConfiguration implements InitializingBean {
}
@Bean
public <I, O> RemoteChunkingWorkerBuilder<I, O> remoteChunkingWorkerBuilder() {
public RemoteChunkingWorkerBuilder<I, O> remoteChunkingWorkerBuilder() {
return remoteChunkingWorkerBuilder;
}

View File

@@ -286,6 +286,7 @@ public class MessageChannelPartitionHandler extends AbstractPartitionHandler imp
}
}
@SuppressWarnings("unchecked")
private Set<StepExecution> receiveReplies(PollableChannel currentReplyChannel) {
Message<Set<StepExecution>> message = (Message<Set<StepExecution>>) messagingGateway
.receive(currentReplyChannel);