fix build warnings

This commit is contained in:
Mahmoud Ben Hassine
2018-08-10 12:02:23 +02:00
parent e5ac0e9975
commit 76c34c7f72
26 changed files with 71 additions and 42 deletions

View File

@@ -53,7 +53,7 @@ public class RepositoryItemReaderBuilder<T> {
private String methodName;
private RepositoryMethodReference repositoryMethodReference;
private RepositoryMethodReference<?> repositoryMethodReference;
private boolean saveState = true;
@@ -213,7 +213,7 @@ public class RepositoryItemReaderBuilder<T> {
* @see RepositoryItemReader#setRepository(PagingAndSortingRepository)
*
*/
public RepositoryItemReaderBuilder<T> repository(RepositoryMethodReference repositoryMethodReference) {
public RepositoryItemReaderBuilder<T> repository(RepositoryMethodReference<?> repositoryMethodReference) {
this.repositoryMethodReference = repositoryMethodReference;
return this;
@@ -275,6 +275,7 @@ public class RepositoryItemReaderBuilder<T> {
* information about the method.
* @return T is a proxy of the object passed in in the constructor
*/
@SuppressWarnings("unchecked")
public T methodIs() {
Enhancer enhancer = new Enhancer();
enhancer.setSuperclass(this.repository.getClass());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017 the original author or authors.
* Copyright 2017-2018 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.
@@ -18,9 +18,6 @@ package org.springframework.batch.item.data.builder;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.springframework.batch.item.data.RepositoryItemWriter;
import org.springframework.cglib.proxy.Enhancer;
@@ -33,6 +30,7 @@ import org.springframework.util.Assert;
* A builder implementation for the {@link RepositoryItemWriter}.
*
* @author Glenn Renfro
* @author Mahmoud Ben Hassine
* @since 4.0
* @see RepositoryItemWriter
*/
@@ -136,6 +134,7 @@ public class RepositoryItemWriterBuilder<T> {
* information about the method.
* @return T is a proxy of the object passed in in the constructor
*/
@SuppressWarnings("unchecked")
public T methodIs() {
Enhancer enhancer = new Enhancer();
enhancer.setSuperclass(this.repository.getClass());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2013 the original author or authors.
* Copyright 2006-2018 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.
@@ -38,9 +38,10 @@ import org.springframework.util.StringUtils;
* queries.
*
* @author Dave Syer
* @author Mahmoud Ben Hassine
*
*/
@SuppressWarnings("rawtype")
@SuppressWarnings("rawtypes")
public class HibernateItemReaderHelper<T> implements InitializingBean {
private SessionFactory sessionFactory;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017 the original author or authors.
* Copyright 2017-2018 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.
@@ -37,6 +37,7 @@ import org.springframework.util.StringUtils;
*
* @author Michael Minella
* @author Glenn Renfro
* @author Mahmoud Ben Hassine
* @since 4.0
* @see HibernateCursorItemReader
*/
@@ -58,7 +59,7 @@ public class HibernateCursorItemReaderBuilder<T> {
private String nativeQuery;
private Class nativeClass;
private Class<T> nativeClass;
private boolean saveState = true;
@@ -232,7 +233,7 @@ public class HibernateCursorItemReaderBuilder<T> {
return this;
}
public HibernateCursorItemReaderBuilder<T> entityClass(Class nativeClass) {
public HibernateCursorItemReaderBuilder<T> entityClass(Class<T> nativeClass) {
this.nativeClass = nativeClass;
return this;
@@ -267,7 +268,7 @@ public class HibernateCursorItemReaderBuilder<T> {
reader.setQueryString(this.queryString);
}
else if(StringUtils.hasText(this.nativeQuery) && this.nativeClass != null) {
HibernateNativeQueryProvider provider = new HibernateNativeQueryProvider();
HibernateNativeQueryProvider<T> provider = new HibernateNativeQueryProvider<>();
provider.setSqlQuery(this.nativeQuery);
provider.setEntityClass(this.nativeClass);

View File

@@ -183,7 +183,7 @@ public class HibernatePagingItemReaderBuilder<T> {
* @return this instance for method chaining
* @see HibernatePagingItemReader#setQueryProvider(HibernateQueryProvider)
*/
public HibernatePagingItemReaderBuilder<T> queryProvider(HibernateQueryProvider queryProvider) {
public HibernatePagingItemReaderBuilder<T> queryProvider(HibernateQueryProvider<T> queryProvider) {
this.queryProvider = queryProvider;
return this;

View File

@@ -412,6 +412,8 @@ public abstract class AbstractFileItemWriter<T> extends AbstractItemStreamItemWr
/**
* Return the byte offset position of the cursor in the output file as a
* long integer.
* @return the byte offset position of the cursor in the output file
* @throws IOException If unable to get the offset position
*/
public long position() throws IOException {
long pos = 0;
@@ -519,7 +521,7 @@ public abstract class AbstractFileItemWriter<T> extends AbstractItemStreamItemWr
/**
* @param line String to be written to the file
* @throws IOException
* @throws IOException If unable to write the String to the file
*/
public void write(String line) throws IOException {
if (!initialized) {