You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by GitBox <gi...@apache.org> on 2021/03/22 19:57:18 UTC

[GitHub] [shiro] bdemers commented on a change in pull request #287: Fixed a bug, removed the boxing to long.

bdemers commented on a change in pull request #287:
URL: https://github.com/apache/shiro/pull/287#discussion_r599032232



##########
File path: web/src/main/java/org/apache/shiro/web/session/HttpServletSession.java
##########
@@ -83,7 +83,8 @@ public long getTimeout() throws InvalidSessionException {
 
     public void setTimeout(long maxIdleTimeInMillis) throws InvalidSessionException {
         try {
-            int timeout = Long.valueOf(maxIdleTimeInMillis / 1000).intValue();
+        	long ltimeout = maxIdleTimeInMillis / 1000;
+        	int timeout = (int)ltimeout; 

Review comment:
       Thanks @pitjazz 
   This could probably just be something like:
   ```java
   int timeout = (int) (maxIdleTimeInMillis / 1000);
   ```
   
   Can also clean up the commit and PR comment.  This isn't really a "bug" it's more code cleanup, maybe something like: 
   > Removed unnecessary boxing in HttpServletSession




-- 
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:
users@infra.apache.org