Skip to content

Commit 1ab9e2c

Browse files
committed
Polishing
1 parent a1d35c2 commit 1ab9e2c

File tree

12 files changed

+53
-45
lines changed

12 files changed

+53
-45
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 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.
@@ -41,6 +41,7 @@ public class DefaultParameterNameDiscoverer extends PrioritizedParameterNameDisc
4141
private static final boolean kotlinPresent =
4242
ClassUtils.isPresent("kotlin.Unit", DefaultParameterNameDiscoverer.class.getClassLoader());
4343

44+
4445
public DefaultParameterNameDiscoverer() {
4546
if (kotlinPresent) {
4647
addDiscoverer(new KotlinReflectionParameterNameDiscoverer());

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 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.
@@ -25,9 +25,9 @@
2525
import org.springframework.util.Assert;
2626

2727
/**
28-
* Connection holder, wrapping a JDBC Connection.
28+
* Resource holder wrapping a JDBC {@link Connection}.
2929
* {@link DataSourceTransactionManager} binds instances of this class
30-
* to the thread, for a specific DataSource.
30+
* to the thread, for a specific {@link javax.sql.DataSource}.
3131
*
3232
* <p>Inherits rollback-only support for nested JDBC transactions
3333
* and reference count functionality from the base class.
@@ -41,6 +41,9 @@
4141
*/
4242
public class ConnectionHolder extends ResourceHolderSupport {
4343

44+
/**
45+
* Prefix for savepoint names.
46+
*/
4447
public static final String SAVEPOINT_NAME_PREFIX = "SAVEPOINT_";
4548

4649

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
import org.springframework.util.ReflectionUtils;
3939

4040
/**
41-
* JMS resource holder, wrapping a JMS Connection and a JMS Session.
42-
* JmsTransactionManager binds instances of this class to the thread,
43-
* for a given JMS ConnectionFactory.
41+
* Resource holder wrapping a JMS {@link Connection} and a JMS {@link Session}.
42+
* {@link JmsTransactionManager} binds instances of this class to the thread,
43+
* for a given JMS {@link ConnectionFactory}.
4444
*
4545
* <p>Note: This is an SPI class, not intended to be used by applications.
4646
*

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 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.
@@ -21,7 +21,7 @@
2121
import org.springframework.jms.connection.JmsResourceHolder;
2222

2323
/**
24-
* JmsResourceHolder marker subclass that indicates local exposure,
24+
* {@link JmsResourceHolder} marker subclass that indicates local exposure,
2525
* i.e. that does not indicate an externally managed transaction.
2626
*
2727
* @author Juergen Hoeller

spring-orm/src/main/java/org/springframework/orm/hibernate5/HibernateTemplate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
*
7070
* <p><b>NOTE: Hibernate access code can also be coded against the native Hibernate
7171
* {@link Session}. Hence, for newly started projects, consider adopting the standard
72-
* Hibernate style of coding against {@link SessionFactory#getCurrentSession()}.</b>
72+
* Hibernate style of coding against {@link SessionFactory#getCurrentSession()}.
7373
* Alternatively, use {@link #execute(HibernateCallback)} with Java 8 lambda code blocks
7474
* against the callback-provided {@code Session} which results in elegant code as well,
7575
* decoupled from the Hibernate Session lifecycle. The remaining operations on this

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 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.
@@ -203,7 +203,7 @@ protected final SessionFactory obtainSessionFactory() {
203203
* @see org.springframework.jdbc.core.JdbcTemplate
204204
*/
205205
public void setDataSource(@Nullable DataSource dataSource) {
206-
if (dataSource != null && dataSource instanceof TransactionAwareDataSourceProxy) {
206+
if (dataSource instanceof TransactionAwareDataSourceProxy) {
207207
// If we got a TransactionAwareDataSourceProxy, we need to perform transactions
208208
// for its underlying target DataSource, else data access code won't see
209209
// properly exposed transactions (i.e. transactions for the target DataSource).
@@ -336,7 +336,7 @@ public void setEntityInterceptor(@Nullable Interceptor entityInterceptor) {
336336
@Nullable
337337
public Interceptor getEntityInterceptor() throws IllegalStateException, BeansException {
338338
if (this.entityInterceptor instanceof Interceptor) {
339-
return (Interceptor) entityInterceptor;
339+
return (Interceptor) this.entityInterceptor;
340340
}
341341
else if (this.entityInterceptor instanceof String) {
342342
if (this.beanFactory == null) {
@@ -777,7 +777,7 @@ protected boolean isPhysicallyConnected(Session session) {
777777
* from the {@code org.springframework.dao} hierarchy.
778778
* <p>Will automatically apply a specified SQLExceptionTranslator to a
779779
* Hibernate JDBCException, else rely on Hibernate's default translation.
780-
* @param ex HibernateException that occurred
780+
* @param ex the HibernateException that occurred
781781
* @return a corresponding DataAccessException
782782
* @see SessionFactoryUtils#convertHibernateAccessException
783783
*/

spring-orm/src/main/java/org/springframework/orm/hibernate5/SessionHolder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 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.
@@ -25,9 +25,9 @@
2525
import org.springframework.util.Assert;
2626

2727
/**
28-
* Session holder, wrapping a Hibernate Session and a Hibernate Transaction.
29-
* HibernateTransactionManager binds instances of this class to the thread,
30-
* for a given SessionFactory.
28+
* Resource holder wrapping a Hibernate {@link Session} (plus an optional {@link Transaction}).
29+
* {@link HibernateTransactionManager} binds instances of this class to the thread,
30+
* for a given {@link org.hibernate.SessionFactory}.
3131
*
3232
* <p>Note: This is an SPI class, not intended to be used by applications.
3333
*

spring-orm/src/main/java/org/springframework/orm/hibernate5/SpringSessionContext.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 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.
@@ -32,9 +32,9 @@
3232
import org.springframework.transaction.support.TransactionSynchronizationManager;
3333

3434
/**
35-
* Implementation of Hibernate 3.1's CurrentSessionContext interface
36-
* that delegates to Spring's SessionFactoryUtils for providing a
37-
* Spring-managed current Session.
35+
* Implementation of Hibernate 3.1's {@link CurrentSessionContext} interface
36+
* that delegates to Spring's {@link SessionFactoryUtils} for providing a
37+
* Spring-managed current {@link Session}.
3838
*
3939
* <p>This CurrentSessionContext implementation can also be specified in custom
4040
* SessionFactory setup through the "hibernate.current_session_context_class"
@@ -110,7 +110,8 @@ else if (value instanceof SessionHolder) {
110110
if (this.transactionManager.getStatus() == Status.STATUS_ACTIVE) {
111111
Session session = this.jtaSessionContext.currentSession();
112112
if (TransactionSynchronizationManager.isSynchronizationActive()) {
113-
TransactionSynchronizationManager.registerSynchronization(new SpringFlushSynchronization(session));
113+
TransactionSynchronizationManager.registerSynchronization(
114+
new SpringFlushSynchronization(session));
114115
}
115116
return session;
116117
}

spring-orm/src/main/java/org/springframework/orm/jpa/EntityManagerHolder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 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,9 +24,9 @@
2424
import org.springframework.util.Assert;
2525

2626
/**
27-
* Holder wrapping a JPA EntityManager.
28-
* JpaTransactionManager binds instances of this class to the thread,
29-
* for a given EntityManagerFactory.
27+
* Resource holder wrapping a JPA {@link EntityManager}.
28+
* {@link JpaTransactionManager} binds instances of this class to the thread,
29+
* for a given {@link javax.persistence.EntityManagerFactory}.
3030
*
3131
* <p>Note: This is an SPI class, not intended to be used by applications.
3232
*

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 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.
@@ -138,7 +138,7 @@ public JpaTransactionManager() {
138138

139139
/**
140140
* Create a new JpaTransactionManager instance.
141-
* @param emf EntityManagerFactory to manage transactions for
141+
* @param emf the EntityManagerFactory to manage transactions for
142142
*/
143143
public JpaTransactionManager(EntityManagerFactory emf) {
144144
this();
@@ -255,7 +255,7 @@ public Map<String, Object> getJpaPropertyMap() {
255255
* @see org.springframework.jdbc.core.JdbcTemplate
256256
*/
257257
public void setDataSource(@Nullable DataSource dataSource) {
258-
if (dataSource != null && dataSource instanceof TransactionAwareDataSourceProxy) {
258+
if (dataSource instanceof TransactionAwareDataSourceProxy) {
259259
// If we got a TransactionAwareDataSourceProxy, we need to perform transactions
260260
// for its underlying target DataSource, else data access code won't see
261261
// properly exposed transactions (i.e. transactions for the target DataSource).

0 commit comments

Comments
 (0)