Skip to content

Commit 1ca0653

Browse files
committed
Polishing
1 parent 1ab0850 commit 1ca0653

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

spring-core/src/main/java/org/springframework/core/task/support/ExecutorServiceAdapter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,18 +24,18 @@
2424
import org.springframework.util.Assert;
2525

2626
/**
27-
* Adapter that takes a Spring {@link org.springframework.core.task.TaskExecutor})
27+
* Adapter that takes a Spring {@link org.springframework.core.task.TaskExecutor}
2828
* and exposes a full {@code java.util.concurrent.ExecutorService} for it.
2929
*
3030
* <p>This is primarily for adapting to client components that communicate via the
3131
* {@code java.util.concurrent.ExecutorService} API. It can also be used as
3232
* common ground between a local Spring {@code TaskExecutor} backend and a
33-
* JNDI-located {@code ManagedExecutorService} in a Java EE 6 environment.
33+
* JNDI-located {@code ManagedExecutorService} in a Java EE 7 environment.
3434
*
3535
* <p><b>NOTE:</b> This ExecutorService adapter does <em>not</em> support the
3636
* lifecycle methods in the {@code java.util.concurrent.ExecutorService} API
3737
* ("shutdown()" etc), similar to a server-wide {@code ManagedExecutorService}
38-
* in a Java EE 6 environment. The lifecycle is always up to the backend pool,
38+
* in a Java EE 7 environment. The lifecycle is always up to the backend pool,
3939
* with this adapter acting as an access-only proxy for that target pool.
4040
*
4141
* @author Juergen Hoeller

spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterUtils.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ public static ParsedSql parseSqlStatement(final String sql) {
107107
String parameter = null;
108108
if (j < statement.length && c == ':' && statement[j] == '{') {
109109
// :{x} style parameter
110-
while (j < statement.length && '}' != statement[j]) {
110+
while (j < statement.length && statement[j] != '}') {
111111
j++;
112-
if (':' == statement[j] || '{' == statement[j]) {
112+
if (statement[j] == ':' || statement[j] == '{') {
113113
throw new InvalidDataAccessApiUsageException("Parameter name contains invalid character '" +
114114
statement[j] + "' at position " + i + " in statement: " + sql);
115115
}
@@ -121,7 +121,8 @@ public static ParsedSql parseSqlStatement(final String sql) {
121121
if (j - i > 2) {
122122
parameter = sql.substring(i + 2, j);
123123
namedParameterCount = addNewNamedParameter(namedParameters, namedParameterCount, parameter);
124-
totalParameterCount = addNamedParameter(parameterList, totalParameterCount, escapes, i, j + 1, parameter);
124+
totalParameterCount = addNamedParameter(
125+
parameterList, totalParameterCount, escapes, i, j + 1, parameter);
125126
}
126127
j++;
127128
}
@@ -132,7 +133,8 @@ public static ParsedSql parseSqlStatement(final String sql) {
132133
if (j - i > 1) {
133134
parameter = sql.substring(i + 1, j);
134135
namedParameterCount = addNewNamedParameter(namedParameters, namedParameterCount, parameter);
135-
totalParameterCount = addNamedParameter(parameterList, totalParameterCount, escapes, i, j, parameter);
136+
totalParameterCount = addNamedParameter(
137+
parameterList, totalParameterCount, escapes, i, j, parameter);
136138
}
137139
}
138140
i = j - 1;

0 commit comments

Comments
 (0)