Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-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.
|
||||
@@ -24,18 +24,18 @@ import org.springframework.core.task.TaskExecutor;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Adapter that takes a Spring {@link org.springframework.core.task.TaskExecutor})
|
||||
* Adapter that takes a Spring {@link org.springframework.core.task.TaskExecutor}
|
||||
* and exposes a full {@code java.util.concurrent.ExecutorService} for it.
|
||||
*
|
||||
* <p>This is primarily for adapting to client components that communicate via the
|
||||
* {@code java.util.concurrent.ExecutorService} API. It can also be used as
|
||||
* common ground between a local Spring {@code TaskExecutor} backend and a
|
||||
* JNDI-located {@code ManagedExecutorService} in a Java EE 6 environment.
|
||||
* JNDI-located {@code ManagedExecutorService} in a Java EE 7 environment.
|
||||
*
|
||||
* <p><b>NOTE:</b> This ExecutorService adapter does <em>not</em> support the
|
||||
* lifecycle methods in the {@code java.util.concurrent.ExecutorService} API
|
||||
* ("shutdown()" etc), similar to a server-wide {@code ManagedExecutorService}
|
||||
* in a Java EE 6 environment. The lifecycle is always up to the backend pool,
|
||||
* in a Java EE 7 environment. The lifecycle is always up to the backend pool,
|
||||
* with this adapter acting as an access-only proxy for that target pool.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -107,9 +107,9 @@ public abstract class NamedParameterUtils {
|
||||
String parameter = null;
|
||||
if (j < statement.length && c == ':' && statement[j] == '{') {
|
||||
// :{x} style parameter
|
||||
while (j < statement.length && '}' != statement[j]) {
|
||||
while (j < statement.length && statement[j] != '}') {
|
||||
j++;
|
||||
if (':' == statement[j] || '{' == statement[j]) {
|
||||
if (statement[j] == ':' || statement[j] == '{') {
|
||||
throw new InvalidDataAccessApiUsageException("Parameter name contains invalid character '" +
|
||||
statement[j] + "' at position " + i + " in statement: " + sql);
|
||||
}
|
||||
@@ -121,7 +121,8 @@ public abstract class NamedParameterUtils {
|
||||
if (j - i > 2) {
|
||||
parameter = sql.substring(i + 2, j);
|
||||
namedParameterCount = addNewNamedParameter(namedParameters, namedParameterCount, parameter);
|
||||
totalParameterCount = addNamedParameter(parameterList, totalParameterCount, escapes, i, j + 1, parameter);
|
||||
totalParameterCount = addNamedParameter(
|
||||
parameterList, totalParameterCount, escapes, i, j + 1, parameter);
|
||||
}
|
||||
j++;
|
||||
}
|
||||
@@ -132,7 +133,8 @@ public abstract class NamedParameterUtils {
|
||||
if (j - i > 1) {
|
||||
parameter = sql.substring(i + 1, j);
|
||||
namedParameterCount = addNewNamedParameter(namedParameters, namedParameterCount, parameter);
|
||||
totalParameterCount = addNamedParameter(parameterList, totalParameterCount, escapes, i, j, parameter);
|
||||
totalParameterCount = addNamedParameter(
|
||||
parameterList, totalParameterCount, escapes, i, j, parameter);
|
||||
}
|
||||
}
|
||||
i = j - 1;
|
||||
|
||||
Reference in New Issue
Block a user