[tomcat] branch master updated: Clean-up. Remove unnecessary toString(). Better local variable name.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[tomcat] branch master updated: Clean-up. Remove unnecessary toString(). Better local variable name.

Mark Thomas-2
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new ce40920  Clean-up. Remove unnecessary toString(). Better local variable name.
ce40920 is described below

commit ce409206d14f22195a62414510ed4d8dc2c3b846
Author: Mark Thomas <[hidden email]>
AuthorDate: Mon Dec 2 20:55:14 2019 +0000

    Clean-up. Remove unnecessary toString(). Better local variable name.
---
 java/org/apache/catalina/realm/CombinedRealm.java | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/java/org/apache/catalina/realm/CombinedRealm.java b/java/org/apache/catalina/realm/CombinedRealm.java
index 6bbc238..b3b79de 100644
--- a/java/org/apache/catalina/realm/CombinedRealm.java
+++ b/java/org/apache/catalina/realm/CombinedRealm.java
@@ -347,22 +347,18 @@ public class CombinedRealm extends RealmBase {
     public Principal authenticate(GSSContext gssContext, boolean storeCred) {
         if (gssContext.isEstablished()) {
             Principal authenticatedUser = null;
-            String username = null;
-
-            GSSName name = null;
+            GSSName gssName = null;
             try {
-                name = gssContext.getSrcName();
+                gssName = gssContext.getSrcName();
             } catch (GSSException e) {
                 log.warn(sm.getString("realmBase.gssNameFail"), e);
                 return null;
             }
 
-            username = name.toString();
-
             for (Realm realm : realms) {
                 if (log.isDebugEnabled()) {
                     log.debug(sm.getString("combinedRealm.authStart",
-                            username, realm.getClass().getName()));
+                            gssName, realm.getClass().getName()));
                 }
 
                 authenticatedUser = realm.authenticate(gssContext, storeCred);
@@ -370,12 +366,12 @@ public class CombinedRealm extends RealmBase {
                 if (authenticatedUser == null) {
                     if (log.isDebugEnabled()) {
                         log.debug(sm.getString("combinedRealm.authFail",
-                                username, realm.getClass().getName()));
+                                gssName, realm.getClass().getName()));
                     }
                 } else {
                     if (log.isDebugEnabled()) {
                         log.debug(sm.getString("combinedRealm.authSuccess",
-                                username, realm.getClass().getName()));
+                                gssName, realm.getClass().getName()));
                     }
                     break;
                 }
@@ -393,12 +389,11 @@ public class CombinedRealm extends RealmBase {
     @Override
     public Principal authenticate(GSSName gssName, GSSCredential gssCredential) {
         Principal authenticatedUser = null;
-        String username = gssName.toString();
 
         for (Realm realm : realms) {
             if (log.isDebugEnabled()) {
                 log.debug(sm.getString("combinedRealm.authStart",
-                        username, realm.getClass().getName()));
+                        gssName, realm.getClass().getName()));
             }
 
             authenticatedUser = realm.authenticate(gssName, gssCredential);
@@ -406,12 +401,12 @@ public class CombinedRealm extends RealmBase {
             if (authenticatedUser == null) {
                 if (log.isDebugEnabled()) {
                     log.debug(sm.getString("combinedRealm.authFail",
-                            username, realm.getClass().getName()));
+                            gssName, realm.getClass().getName()));
                 }
             } else {
                 if (log.isDebugEnabled()) {
                     log.debug(sm.getString("combinedRealm.authSuccess",
-                            username, realm.getClass().getName()));
+                            gssName, realm.getClass().getName()));
                 }
                 break;
             }


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]