From 6ca2cb591781fab27714dd5d8a2f28b8cc65847c Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 12 Dec 2018 13:21:06 +0100 Subject: [PATCH] Polishing (cherry picked from commit 106ae0cc5bcff7dd705c1719053056948ad23828) --- .../datasource/UserCredentialsDataSourceAdapter.java | 9 +++++---- .../UserCredentialsConnectionFactoryAdapter.java | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/UserCredentialsDataSourceAdapter.java b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/UserCredentialsDataSourceAdapter.java index 8e7f58c88bd..e707d6f49ad 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/UserCredentialsDataSourceAdapter.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/UserCredentialsDataSourceAdapter.java @@ -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. @@ -148,9 +148,10 @@ public class UserCredentialsDataSourceAdapter extends DelegatingDataSource { /** * Determine whether there are currently thread-bound credentials, * using them if available, falling back to the statically specified - * username and password (i.e. values of the bean properties) else. + * username and password (i.e. values of the bean properties) otherwise. *

Delegates to {@link #doGetConnection(String, String)} with the * determined credentials as parameters. + * @see #doGetConnection */ @Override public Connection getConnection() throws SQLException { @@ -202,13 +203,13 @@ public class UserCredentialsDataSourceAdapter extends DelegatingDataSource { /** * Inner class used as ThreadLocal value. */ - private static class JdbcUserCredentials { + private static final class JdbcUserCredentials { public final String username; public final String password; - private JdbcUserCredentials(String username, String password) { + public JdbcUserCredentials(String username, String password) { this.username = username; this.password = password; } diff --git a/spring-jms/src/main/java/org/springframework/jms/connection/UserCredentialsConnectionFactoryAdapter.java b/spring-jms/src/main/java/org/springframework/jms/connection/UserCredentialsConnectionFactoryAdapter.java index 70239488524..171032a4e32 100644 --- a/spring-jms/src/main/java/org/springframework/jms/connection/UserCredentialsConnectionFactoryAdapter.java +++ b/spring-jms/src/main/java/org/springframework/jms/connection/UserCredentialsConnectionFactoryAdapter.java @@ -149,7 +149,7 @@ public class UserCredentialsConnectionFactoryAdapter /** * Determine whether there are currently thread-bound credentials, * using them if available, falling back to the statically specified - * username and password (i.e. values of the bean properties) else. + * username and password (i.e. values of the bean properties) otherwise. * @see #doCreateConnection */ @Override @@ -331,7 +331,7 @@ public class UserCredentialsConnectionFactoryAdapter public final String password; - private JmsUserCredentials(String username, String password) { + public JmsUserCredentials(String username, String password) { this.username = username; this.password = password; }