ahgittin commented on a change in pull request #1157:
URL: https://github.com/apache/brooklyn-server/pull/1157#discussion_r604698326



##########
File path: 
rest/rest-resources/src/main/java/org/apache/brooklyn/rest/util/MultiSessionAttributeAdapter.java
##########
@@ -638,12 +638,22 @@ public MultiSessionAttributeAdapter resetExpiration() {
         Handler[] hh = getSessionHandlers();
         if (hh!=null) {
             for (Handler h: hh) {
-                Session ss = ((SessionHandler)h).getSession(getId());
-                if (ss!=null) {
+                Session ss = getSessionSafely(h, getId());
+                if (ss != null) {
                     ss.setMaxInactiveInterval(maxInativeInterval);
                 }
             }
         }
         return this;
     }
+
+    private static Session getSessionSafely(Handler h, String id) {

Review comment:
       compiler will spot that as an optimization; in terms of method behaviour 
it's not a big deal if the method changes so the variables are non-final so not 
worth marking IMO




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to