Use diamond operator where appropriate

This commit is contained in:
Mahmoud Ben Hassine
2023-06-05 13:48:31 +02:00
parent 0dc5b63469
commit 92159cbc2b
105 changed files with 411 additions and 403 deletions

View File

@@ -84,7 +84,7 @@ public class StagingItemReader<T>
"SELECT ID FROM BATCH_STAGING WHERE JOB_ID=? AND PROCESSED=? ORDER BY ID",
new RowMapper<Long>() {
new RowMapper<>() {
@Override
public Long mapRow(ResultSet rs, int rowNum) throws SQLException {
return rs.getLong(1);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2014 the original author or authors.
* Copyright 2006-2023 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.
@@ -21,12 +21,13 @@ package org.springframework.batch.sample.domain.multiline;
*
* @see AggregateItemReader
* @author Dave Syer
* @author Mahmoud Ben Hassine
*
*/
public class AggregateItem<T> {
@SuppressWarnings("rawtypes")
private static final AggregateItem FOOTER = new AggregateItem<Object>(false, true) {
private static final AggregateItem FOOTER = new AggregateItem<>(false, true) {
@Override
public Object getItem() {
throw new IllegalStateException("Footer record has no item.");
@@ -43,7 +44,7 @@ public class AggregateItem<T> {
}
@SuppressWarnings("rawtypes")
private static final AggregateItem HEADER = new AggregateItem<Object>(true, false) {
private static final AggregateItem HEADER = new AggregateItem<>(true, false) {
@Override
public Object getItem() {
throw new IllegalStateException("Header record has no item.");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2019-2022 the original author or authors.
* Copyright 2019-2023 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.
@@ -49,7 +49,7 @@ public class SkippableExceptionDuringProcessSample {
@Bean
public ItemReader<Integer> itemReader() {
return new ListItemReader<Integer>(Arrays.asList(1, 2, 3, 4, 5, 6)) {
return new ListItemReader<>(Arrays.asList(1, 2, 3, 4, 5, 6)) {
@Override
public Integer read() {
Integer item = super.read();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2019-2022 the original author or authors.
* Copyright 2019-2023 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.
@@ -49,7 +49,7 @@ public class SkippableExceptionDuringReadSample {
@Bean
public ItemReader<Integer> itemReader() {
return new ListItemReader<Integer>(Arrays.asList(1, 2, 3, 4, 5, 6)) {
return new ListItemReader<>(Arrays.asList(1, 2, 3, 4, 5, 6)) {
@Override
public Integer read() {
Integer item = super.read();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2019-2022 the original author or authors.
* Copyright 2019-2023 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.
@@ -49,7 +49,7 @@ public class SkippableExceptionDuringWriteSample {
@Bean
public ItemReader<Integer> itemReader() {
return new ListItemReader<Integer>(Arrays.asList(1, 2, 3, 4, 5, 6)) {
return new ListItemReader<>(Arrays.asList(1, 2, 3, 4, 5, 6)) {
@Override
public Integer read() {
Integer item = super.read();