From b21e1ee669876c07188e8f970b4b360f6c9e010b Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 11 Nov 2011 09:57:34 +0000 Subject: [PATCH] polishing --- .../jdbc/datasource/WebSphereDataSourceAdapter.java | 13 ++++++------- .../transaction/jta/JtaTransactionManager.java | 7 ++++--- .../web/servlet/FlashMapManager.java | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/WebSphereDataSourceAdapter.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/WebSphereDataSourceAdapter.java index 849c1065fca..af04d4f957f 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/WebSphereDataSourceAdapter.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/WebSphereDataSourceAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2011 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. @@ -19,7 +19,6 @@ package org.springframework.jdbc.datasource; import java.lang.reflect.Method; import java.sql.Connection; import java.sql.SQLException; - import javax.sql.DataSource; import org.apache.commons.logging.Log; @@ -141,7 +140,7 @@ public class WebSphereDataSourceAdapter extends IsolationLevelDataSourceAdapter } // Create Connection through invoking WSDataSource.getConnection(JDBCConnectionSpec) return (Connection) ReflectionUtils.invokeJdbcMethod( - this.wsDataSourceGetConnectionMethod, getTargetDataSource(), new Object[] {connSpec}); + this.wsDataSourceGetConnectionMethod, getTargetDataSource(), connSpec); } /** @@ -162,16 +161,16 @@ public class WebSphereDataSourceAdapter extends IsolationLevelDataSourceAdapter Object connSpec = ReflectionUtils.invokeJdbcMethod(this.newJdbcConnSpecMethod, null); if (isolationLevel != null) { - ReflectionUtils.invokeJdbcMethod(this.setTransactionIsolationMethod, connSpec, new Object[] {isolationLevel}); + ReflectionUtils.invokeJdbcMethod(this.setTransactionIsolationMethod, connSpec, isolationLevel); } if (readOnlyFlag != null) { - ReflectionUtils.invokeJdbcMethod(this.setReadOnlyMethod, connSpec, new Object[] {readOnlyFlag}); + ReflectionUtils.invokeJdbcMethod(this.setReadOnlyMethod, connSpec, readOnlyFlag); } // If the username is empty, we'll simply let the target DataSource // use its default credentials. if (StringUtils.hasLength(username)) { - ReflectionUtils.invokeJdbcMethod(this.setUserNameMethod, connSpec, new Object[] {username}); - ReflectionUtils.invokeJdbcMethod(this.setPasswordMethod, connSpec, new Object[] {password}); + ReflectionUtils.invokeJdbcMethod(this.setUserNameMethod, connSpec, username); + ReflectionUtils.invokeJdbcMethod(this.setPasswordMethod, connSpec, password); } return connSpec; } diff --git a/org.springframework.transaction/src/main/java/org/springframework/transaction/jta/JtaTransactionManager.java b/org.springframework.transaction/src/main/java/org/springframework/transaction/jta/JtaTransactionManager.java index 2efda302864..6929ef5aeeb 100644 --- a/org.springframework.transaction/src/main/java/org/springframework/transaction/jta/JtaTransactionManager.java +++ b/org.springframework.transaction/src/main/java/org/springframework/transaction/jta/JtaTransactionManager.java @@ -396,7 +396,8 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager *

Default is "false", throwing an exception if a non-default isolation level * is specified for a transaction. Turn this flag on if affected resource adapters * check the thread-bound transaction context and apply the specified isolation - * levels individually (e.g. through a IsolationLevelDataSourceRouter). + * levels individually (e.g. through an IsolationLevelDataSourceAdapter). + * @see org.springframework.jdbc.datasource.IsolationLevelDataSourceAdapter * @see org.springframework.jdbc.datasource.lookup.IsolationLevelDataSourceRouter */ public void setAllowCustomIsolationLevels(boolean allowCustomIsolationLevels) { @@ -878,12 +879,12 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager * @see #getTransactionManager() */ protected void applyIsolationLevel(JtaTransactionObject txObject, int isolationLevel) - throws InvalidIsolationLevelException, SystemException { + throws InvalidIsolationLevelException, SystemException { if (!this.allowCustomIsolationLevels && isolationLevel != TransactionDefinition.ISOLATION_DEFAULT) { throw new InvalidIsolationLevelException( "JtaTransactionManager does not support custom isolation levels by default - " + - "switch 'allowCustomIsolationLevels' to 'true'"); + "switch 'allowCustomIsolationLevels' to 'true'"); } } diff --git a/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/FlashMapManager.java b/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/FlashMapManager.java index 96f3cdc0de2..066da4231d8 100644 --- a/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/FlashMapManager.java +++ b/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/FlashMapManager.java @@ -44,14 +44,14 @@ public interface FlashMapManager { * {@code Map} with "input" flash attributes if any. * @see org.springframework.web.servlet.support.RequestContextUtils#getInputFlashMap(HttpServletRequest) */ - public static final String INPUT_FLASH_MAP_ATTRIBUTE = FlashMapManager.class.getName() + ".INPUT_FLASH_MAP"; + String INPUT_FLASH_MAP_ATTRIBUTE = FlashMapManager.class.getName() + ".INPUT_FLASH_MAP"; /** * Name of request attribute that holds the "output" {@link FlashMap} with * attributes to save for a subsequent request. * @see org.springframework.web.servlet.support.RequestContextUtils#getOutputFlashMap(HttpServletRequest) */ - public static final String OUTPUT_FLASH_MAP_ATTRIBUTE = FlashMapManager.class.getName() + ".OUTPUT_FLASH_MAP"; + String OUTPUT_FLASH_MAP_ATTRIBUTE = FlashMapManager.class.getName() + ".OUTPUT_FLASH_MAP"; /** * Perform the following tasks unless the {@link #OUTPUT_FLASH_MAP_ATTRIBUTE}