Browse Source

Polishing

pull/1870/head
Juergen Hoeller 8 years ago
parent
commit
5dc8b5de6d
  1. 3
      spring-core/src/main/java/org/springframework/core/DefaultParameterNameDiscoverer.java
  2. 4
      spring-jdbc/src/main/java/org/springframework/jdbc/datasource/ConnectionHolder.java
  3. 6
      spring-jms/src/main/java/org/springframework/jms/connection/JmsResourceHolder.java
  4. 4
      spring-jms/src/main/java/org/springframework/jms/listener/LocallyExposedJmsResourceHolder.java
  5. 2
      spring-orm/src/main/java/org/springframework/orm/hibernate5/HibernateTransactionManager.java
  6. 2
      spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java
  7. 11
      spring-tx/src/main/java/org/springframework/jca/cci/connection/ConnectionHolder.java

3
spring-core/src/main/java/org/springframework/core/DefaultParameterNameDiscoverer.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 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.
@ -41,6 +41,7 @@ public class DefaultParameterNameDiscoverer extends PrioritizedParameterNameDisc @@ -41,6 +41,7 @@ public class DefaultParameterNameDiscoverer extends PrioritizedParameterNameDisc
private static final boolean kotlinPresent =
ClassUtils.isPresent("kotlin.Unit", DefaultParameterNameDiscoverer.class.getClassLoader());
public DefaultParameterNameDiscoverer() {
if (kotlinPresent) {
addDiscoverer(new KotlinReflectionParameterNameDiscoverer());

4
spring-jdbc/src/main/java/org/springframework/jdbc/datasource/ConnectionHolder.java

@ -25,9 +25,9 @@ import org.springframework.transaction.support.ResourceHolderSupport; @@ -25,9 +25,9 @@ import org.springframework.transaction.support.ResourceHolderSupport;
import org.springframework.util.Assert;
/**
* Connection holder, wrapping a JDBC Connection.
* Resource holder wrapping a JDBC {@link Connection}.
* {@link DataSourceTransactionManager} binds instances of this class
* to the thread, for a specific DataSource.
* to the thread, for a specific {@link javax.sql.DataSource}.
*
* <p>Inherits rollback-only support for nested JDBC transactions
* and reference count functionality from the base class.

6
spring-jms/src/main/java/org/springframework/jms/connection/JmsResourceHolder.java

@ -38,9 +38,9 @@ import org.springframework.util.CollectionUtils; @@ -38,9 +38,9 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.ReflectionUtils;
/**
* JMS resource holder, wrapping a JMS Connection and a JMS Session.
* JmsTransactionManager binds instances of this class to the thread,
* for a given JMS ConnectionFactory.
* Resource holder wrapping a JMS {@link Connection} and a JMS {@link Session}.
* {@link JmsTransactionManager} binds instances of this class to the thread,
* for a given JMS {@link ConnectionFactory}.
*
* <p>Note: This is an SPI class, not intended to be used by applications.
*

4
spring-jms/src/main/java/org/springframework/jms/listener/LocallyExposedJmsResourceHolder.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 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.
@ -21,7 +21,7 @@ import javax.jms.Session; @@ -21,7 +21,7 @@ import javax.jms.Session;
import org.springframework.jms.connection.JmsResourceHolder;
/**
* JmsResourceHolder marker subclass that indicates local exposure,
* {@link JmsResourceHolder} marker subclass that indicates local exposure,
* i.e. that does not indicate an externally managed transaction.
*
* @author Juergen Hoeller

2
spring-orm/src/main/java/org/springframework/orm/hibernate5/HibernateTransactionManager.java

@ -203,7 +203,7 @@ public class HibernateTransactionManager extends AbstractPlatformTransactionMana @@ -203,7 +203,7 @@ public class HibernateTransactionManager extends AbstractPlatformTransactionMana
* @see org.springframework.jdbc.core.JdbcTemplate
*/
public void setDataSource(@Nullable DataSource dataSource) {
if (dataSource != null && dataSource instanceof TransactionAwareDataSourceProxy) {
if (dataSource instanceof TransactionAwareDataSourceProxy) {
// If we got a TransactionAwareDataSourceProxy, we need to perform transactions
// for its underlying target DataSource, else data access code won't see
// properly exposed transactions (i.e. transactions for the target DataSource).

2
spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java

@ -255,7 +255,7 @@ public class JpaTransactionManager extends AbstractPlatformTransactionManager @@ -255,7 +255,7 @@ public class JpaTransactionManager extends AbstractPlatformTransactionManager
* @see org.springframework.jdbc.core.JdbcTemplate
*/
public void setDataSource(@Nullable DataSource dataSource) {
if (dataSource != null && dataSource instanceof TransactionAwareDataSourceProxy) {
if (dataSource instanceof TransactionAwareDataSourceProxy) {
// If we got a TransactionAwareDataSourceProxy, we need to perform transactions
// for its underlying target DataSource, else data access code won't see
// properly exposed transactions (i.e. transactions for the target DataSource).

11
spring-tx/src/main/java/org/springframework/jca/cci/connection/ConnectionHolder.java

@ -1,5 +1,5 @@ @@ -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.
@ -21,10 +21,9 @@ import javax.resource.cci.Connection; @@ -21,10 +21,9 @@ import javax.resource.cci.Connection;
import org.springframework.transaction.support.ResourceHolderSupport;
/**
* Connection holder, wrapping a CCI Connection.
*
* <p>CciLocalTransactionManager binds instances of this class
* to the thread, for a given ConnectionFactory.
* Resource holder wrapping a CCI {@link Connection}.
* {@link CciLocalTransactionManager} binds instances of this class to the thread,
* for a given {@link javax.resource.cci.ConnectionFactory}.
*
* <p>Note: This is an SPI class, not intended to be used by applications.
*
@ -38,10 +37,12 @@ public class ConnectionHolder extends ResourceHolderSupport { @@ -38,10 +37,12 @@ public class ConnectionHolder extends ResourceHolderSupport {
private final Connection connection;
public ConnectionHolder(Connection connection) {
this.connection = connection;
}
public Connection getConnection() {
return this.connection;
}

Loading…
Cancel
Save