markt-asf commented on code in PR #660:
URL: https://github.com/apache/tomcat/pull/660#discussion_r1316890952


##########
java/org/apache/catalina/util/SessionConfig.java:
##########
@@ -49,38 +42,30 @@ public static String getSessionCookieName(Context context) {
      * @return the parameter name for the session
      */
     public static String getSessionUriParamName(Context context) {
-
-        String result = getConfiguredSessionCookieName(context);
-
-        if (result == null) {
-            result = DEFAULT_SESSION_PARAMETER_NAME;
-        }
-
-        return result;
+        return getConfiguredSessionCookieName(context, 
DEFAULT_SESSION_PARAMETER_NAME);
     }
 
 
-    private static String getConfiguredSessionCookieName(Context context) {
-
+    private static String getConfiguredSessionCookieName(Context context, 
String defaultName) {
+        if (context == null) {
+            return defaultName;
+        }
         // Priority is:
         // 1. Cookie name defined in context
         // 2. Cookie name configured for app
         // 3. Default defined by spec
-        if (context != null) {
-            String cookieName = context.getSessionCookieName();

Review Comment:
   The code will be cleaner if you keep the original null check. That will also 
keep the code better aligned with the documented priority order.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to