Apply SingleSpaceSeparator Checkstyle module

This commit also fixes its violations.

Closes gh-31469
This commit is contained in:
Johnny Lim
2023-10-22 00:10:45 +09:00
committed by Sam Brannen
parent 8a05661707
commit 64e9fcad53
164 changed files with 229 additions and 226 deletions

View File

@@ -370,7 +370,7 @@ public class BeanPropertyRowMapper<T> implements RowMapper<T> {
* @throws SQLException if an SQLException is encountered
* @since 5.3
*/
protected T constructMappedInstance(ResultSet rs, TypeConverter tc) throws SQLException {
protected T constructMappedInstance(ResultSet rs, TypeConverter tc) throws SQLException {
Assert.state(this.mappedClass != null, "Mapped class was not specified");
return BeanUtils.instantiateClass(this.mappedClass);
}

View File

@@ -107,7 +107,7 @@ public class DataClassRowMapper<T> extends BeanPropertyRowMapper<T> {
}
@Override
protected T constructMappedInstance(ResultSet rs, TypeConverter tc) throws SQLException {
protected T constructMappedInstance(ResultSet rs, TypeConverter tc) throws SQLException {
Assert.state(this.mappedConstructor != null, "Mapped constructor was not initialized");
Object[] args;

View File

@@ -1149,7 +1149,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
Assert.notNull(action, "Callback object must not be null");
if (logger.isDebugEnabled()) {
String sql = getSql(csc);
logger.debug("Calling stored procedure" + (sql != null ? " [" + sql + "]" : ""));
logger.debug("Calling stored procedure" + (sql != null ? " [" + sql + "]" : ""));
}
Connection con = DataSourceUtils.getConnection(obtainDataSource());

View File

@@ -554,7 +554,7 @@ public class CallMetaDataContext {
Map<String, String> callParameterNames = CollectionUtils.newHashMap(this.callParameters.size());
for (SqlParameter parameter : this.callParameters) {
if (parameter.isInputValueProvided()) {
String parameterName = parameter.getName();
String parameterName = parameter.getName();
String parameterNameToMatch = provider.parameterNameToUse(parameterName);
if (parameterNameToMatch != null) {
callParameterNames.put(parameterNameToMatch.toLowerCase(), parameterName);
@@ -606,7 +606,7 @@ public class CallMetaDataContext {
int i = 0;
for (SqlParameter parameter : this.callParameters) {
if (parameter.isInputValueProvided()) {
String parameterName = parameter.getName();
String parameterName = parameter.getName();
matchedParameters.put(parameterName, parameterValues[i++]);
}
}

View File

@@ -114,7 +114,7 @@ public class GenericCallMetaDataProvider implements CallMetaDataProvider {
@Nullable String schemaName, @Nullable String procedureName) throws SQLException {
this.procedureColumnMetaDataUsed = true;
processProcedureColumns(databaseMetaData, catalogName, schemaName, procedureName);
processProcedureColumns(databaseMetaData, catalogName, schemaName, procedureName);
}
@Override

View File

@@ -404,7 +404,7 @@ public abstract class AbstractJdbcCall {
logger.debug("The following parameters are used for call " + getCallString() + " with " + args);
int i = 1;
for (SqlParameter param : getCallParameters()) {
logger.debug(i + ": " + param.getName() + ", SQL type "+ param.getSqlType() + ", type name " +
logger.debug(i + ": " + param.getName() + ", SQL type " + param.getSqlType() + ", type name " +
param.getTypeName() + ", parameter class [" + param.getClass().getName() + "]");
i++;
}

View File

@@ -474,7 +474,7 @@ public abstract class AbstractJdbcInsert {
if (getGeneratedKeyNames().length > 1) {
throw new InvalidDataAccessApiUsageException(
"Current database only supports retrieving the key for a single column. There are " +
getGeneratedKeyNames().length + " columns specified: " + Arrays.toString(getGeneratedKeyNames()));
getGeneratedKeyNames().length + " columns specified: " + Arrays.toString(getGeneratedKeyNames()));
}
Assert.state(getTableName() != null, "No table name set");

View File

@@ -41,7 +41,7 @@ public interface SqlValue {
* @param paramIndex the index of the parameter for which we need to set the value
* @throws SQLException if an SQLException is encountered while setting parameter values
*/
void setValue(PreparedStatement ps, int paramIndex) throws SQLException;
void setValue(PreparedStatement ps, int paramIndex) throws SQLException;
/**
* Clean up resources held by this value object.

View File

@@ -269,7 +269,7 @@ public interface SqlRowSet extends Serializable {
* @see java.sql.ResultSet#getObject(int, Map)
*/
@Nullable
Object getObject(int columnIndex, Map<String, Class<?>> map) throws InvalidResultSetAccessException;
Object getObject(int columnIndex, Map<String, Class<?>> map) throws InvalidResultSetAccessException;
/**
* Retrieve the value of the indicated column in the current row as an Object.
@@ -279,7 +279,7 @@ public interface SqlRowSet extends Serializable {
* @see java.sql.ResultSet#getObject(String, Map)
*/
@Nullable
Object getObject(String columnLabel, Map<String, Class<?>> map) throws InvalidResultSetAccessException;
Object getObject(String columnLabel, Map<String, Class<?>> map) throws InvalidResultSetAccessException;
/**
* Retrieve the value of the indicated column in the current row as an Object.

View File

@@ -60,7 +60,7 @@ import static org.mockito.Mockito.verify;
*/
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.LENIENT)
class SqlLobValueTests {
class SqlLobValueTests {
@Mock
private PreparedStatement preparedStatement;

View File

@@ -181,32 +181,32 @@ public class DataSourceTransactionManagerTests {
}
@Test
public void testTransactionRollbackWithAutoCommitTrue() throws Exception {
public void testTransactionRollbackWithAutoCommitTrue() throws Exception {
doTestTransactionRollbackRestoringAutoCommit(true, false, false);
}
@Test
public void testTransactionRollbackWithAutoCommitFalse() throws Exception {
public void testTransactionRollbackWithAutoCommitFalse() throws Exception {
doTestTransactionRollbackRestoringAutoCommit(false, false, false);
}
@Test
public void testTransactionRollbackWithAutoCommitTrueAndLazyConnection() throws Exception {
public void testTransactionRollbackWithAutoCommitTrueAndLazyConnection() throws Exception {
doTestTransactionRollbackRestoringAutoCommit(true, true, false);
}
@Test
public void testTransactionRollbackWithAutoCommitFalseAndLazyConnection() throws Exception {
public void testTransactionRollbackWithAutoCommitFalseAndLazyConnection() throws Exception {
doTestTransactionRollbackRestoringAutoCommit(false, true, false);
}
@Test
public void testTransactionRollbackWithAutoCommitTrueAndLazyConnectionAndCreateStatement() throws Exception {
public void testTransactionRollbackWithAutoCommitTrueAndLazyConnectionAndCreateStatement() throws Exception {
doTestTransactionRollbackRestoringAutoCommit(true, true, true);
}
@Test
public void testTransactionRollbackWithAutoCommitFalseAndLazyConnectionAndCreateStatement() throws Exception {
public void testTransactionRollbackWithAutoCommitFalseAndLazyConnectionAndCreateStatement() throws Exception {
doTestTransactionRollbackRestoringAutoCommit(false, true, true);
}

View File

@@ -54,7 +54,7 @@ import static org.mockito.Mockito.verify;
* @author Thomas Risberg
* @author Juergen Hoeller
*/
public class SqlQueryTests {
public class SqlQueryTests {
//FIXME inline?
private static final String SELECT_ID =

View File

@@ -187,32 +187,32 @@ public class JdbcTransactionManagerTests {
}
@Test
public void testTransactionRollbackWithAutoCommitTrue() throws Exception {
public void testTransactionRollbackWithAutoCommitTrue() throws Exception {
doTestTransactionRollbackRestoringAutoCommit(true, false, false);
}
@Test
public void testTransactionRollbackWithAutoCommitFalse() throws Exception {
public void testTransactionRollbackWithAutoCommitFalse() throws Exception {
doTestTransactionRollbackRestoringAutoCommit(false, false, false);
}
@Test
public void testTransactionRollbackWithAutoCommitTrueAndLazyConnection() throws Exception {
public void testTransactionRollbackWithAutoCommitTrueAndLazyConnection() throws Exception {
doTestTransactionRollbackRestoringAutoCommit(true, true, false);
}
@Test
public void testTransactionRollbackWithAutoCommitFalseAndLazyConnection() throws Exception {
public void testTransactionRollbackWithAutoCommitFalseAndLazyConnection() throws Exception {
doTestTransactionRollbackRestoringAutoCommit(false, true, false);
}
@Test
public void testTransactionRollbackWithAutoCommitTrueAndLazyConnectionAndCreateStatement() throws Exception {
public void testTransactionRollbackWithAutoCommitTrueAndLazyConnectionAndCreateStatement() throws Exception {
doTestTransactionRollbackRestoringAutoCommit(true, true, true);
}
@Test
public void testTransactionRollbackWithAutoCommitFalseAndLazyConnectionAndCreateStatement() throws Exception {
public void testTransactionRollbackWithAutoCommitFalseAndLazyConnectionAndCreateStatement() throws Exception {
doTestTransactionRollbackRestoringAutoCommit(false, true, true);
}

View File

@@ -56,7 +56,7 @@ public class SQLExceptionCustomTranslatorTests {
@Test
public void dataAccessResourceException() {
SQLException dataAccessResourceEx = new SQLDataException("", "", 2);
SQLException dataAccessResourceEx = new SQLDataException("", "", 2);
DataAccessException dae = sext.translate("task", "SQL", dataAccessResourceEx);
assertThat(dae.getCause()).isEqualTo(dataAccessResourceEx);
assertThat(dae).isInstanceOf(TransientDataAccessResourceException.class);