File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
src/main/java/com/radiadesign/catalina/session Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,13 @@ public byte[] serializeFrom(HttpSession session) throws IOException {
3131 public HttpSession deserializeInto (byte [] data , HttpSession session ) throws IOException , ClassNotFoundException {
3232
3333 RedisSession redisSession = (RedisSession ) session ;
34-
35- BufferedInputStream bis = new BufferedInputStream (new ByteArrayInputStream (data ));
36-
37- ObjectInputStream ois = new CustomObjectInputStream ( bis , loader );
38- redisSession .setCreationTime (ois .readLong ());
39- redisSession .readObjectData (ois );
40-
41- return session ;
34+ try (
35+ BufferedInputStream bis = new BufferedInputStream (new ByteArrayInputStream (data ));
36+ ObjectInputStream ois = new CustomObjectInputStream ( bis , loader );
37+ ) {
38+ redisSession .setCreationTime (ois .readLong ());
39+ redisSession .readObjectData (ois );
40+ return session ;
41+ }
4242 }
4343}
You can’t perform that action at this time.
0 commit comments