Polish
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 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.
|
||||
@@ -83,7 +83,7 @@ public class SimpleJobBuilder extends JobBuilderHelper<SimpleJobBuilder> {
|
||||
* @return a builder for fluent chaining
|
||||
*/
|
||||
public FlowBuilder.TransitionBuilder<FlowJobBuilder> on(String pattern) {
|
||||
Assert.state(steps.size() > 0, "You have to start a job with a step");
|
||||
Assert.state(!steps.isEmpty(), "You have to start a job with a step");
|
||||
for (Step step : steps) {
|
||||
if (builder == null) {
|
||||
builder = new JobFlowBuilder(new FlowJobBuilder(this), step);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
* Copyright 2006-2024 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.
|
||||
@@ -156,7 +156,7 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
|
||||
|
||||
List<ExecutionContext> results = getJdbcTemplate().query(getQuery(FIND_JOB_EXECUTION_CONTEXT),
|
||||
new ExecutionContextRowMapper(), executionId);
|
||||
if (results.size() > 0) {
|
||||
if (!results.isEmpty()) {
|
||||
return results.get(0);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 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.
|
||||
@@ -180,7 +180,7 @@ public abstract class AbstractTaskletStepBuilder<B extends AbstractTaskletStepBu
|
||||
chunkListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterChunk.class));
|
||||
chunkListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), AfterChunkError.class));
|
||||
|
||||
if (chunkListenerMethods.size() > 0) {
|
||||
if (!chunkListenerMethods.isEmpty()) {
|
||||
StepListenerFactoryBean factory = new StepListenerFactoryBean();
|
||||
factory.setDelegate(listener);
|
||||
this.listener((ChunkListener) factory.getObject());
|
||||
|
||||
@@ -199,7 +199,7 @@ public class FaultTolerantStepBuilder<I, O> extends SimpleStepBuilder<I, O> {
|
||||
skipListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), OnSkipInProcess.class));
|
||||
skipListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), OnSkipInWrite.class));
|
||||
|
||||
if (skipListenerMethods.size() > 0) {
|
||||
if (!skipListenerMethods.isEmpty()) {
|
||||
StepListenerFactoryBean factory = new StepListenerFactoryBean();
|
||||
factory.setDelegate(listener);
|
||||
skipListeners.add((SkipListener<I, O>) factory.getObject());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
* Copyright 2006-2024 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.
|
||||
@@ -269,7 +269,7 @@ public class SimpleStepBuilder<I, O> extends AbstractTaskletStepBuilder<SimpleSt
|
||||
itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), OnProcessError.class));
|
||||
itemListenerMethods.addAll(ReflectionUtils.findMethod(listener.getClass(), OnWriteError.class));
|
||||
|
||||
if (itemListenerMethods.size() > 0) {
|
||||
if (!itemListenerMethods.isEmpty()) {
|
||||
StepListenerFactoryBean factory = new StepListenerFactoryBean();
|
||||
factory.setDelegate(listener);
|
||||
itemListeners.add((StepListener) factory.getObject());
|
||||
|
||||
@@ -229,7 +229,7 @@ public class RepositoryItemReader<T> extends AbstractItemCountingItemStreamItemR
|
||||
|
||||
List<Object> parameters = new ArrayList<>();
|
||||
|
||||
if (arguments != null && arguments.size() > 0) {
|
||||
if (arguments != null && !arguments.isEmpty()) {
|
||||
parameters.addAll(arguments);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2022 the original author or authors.
|
||||
* Copyright 2006-2024 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.
|
||||
@@ -185,7 +185,7 @@ public class JdbcPagingItemReader<T> extends AbstractPagingItemReader<T> impleme
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("SQL used for reading first page: [" + firstPageSql + "]");
|
||||
}
|
||||
if (parameterValues != null && parameterValues.size() > 0) {
|
||||
if (parameterValues != null && !parameterValues.isEmpty()) {
|
||||
if (this.queryProvider.isUsingNamedParameters()) {
|
||||
query = namedParameterJdbcTemplate.query(firstPageSql, getParameterMap(parameterValues, null),
|
||||
rowCallback);
|
||||
@@ -277,7 +277,7 @@ public class JdbcPagingItemReader<T> extends AbstractPagingItemReader<T> impleme
|
||||
}
|
||||
List<Object> parameterList = new ArrayList<>();
|
||||
parameterList.addAll(sm.values());
|
||||
if (sortKeyValue != null && sortKeyValue.size() > 0) {
|
||||
if (sortKeyValue != null && !sortKeyValue.isEmpty()) {
|
||||
List<Map.Entry<String, Object>> keys = new ArrayList<>(sortKeyValue.entrySet());
|
||||
|
||||
for (int i = 0; i < keys.size(); i++) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2023 the original author or authors.
|
||||
* Copyright 2006-2024 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.
|
||||
@@ -194,7 +194,7 @@ public abstract class AbstractSqlPagingQueryProvider implements PagingQueryProvi
|
||||
}
|
||||
List<String> namedParameters = new ArrayList<>();
|
||||
parameterCount = JdbcParameterUtils.countParameterPlaceholders(sql.toString(), namedParameters);
|
||||
if (namedParameters.size() > 0) {
|
||||
if (!namedParameters.isEmpty()) {
|
||||
if (parameterCount != namedParameters.size()) {
|
||||
throw new InvalidDataAccessApiUsageException(
|
||||
"You can't use both named parameters and classic \"?\" placeholders: " + sql);
|
||||
|
||||
Reference in New Issue
Block a user