@@ -, +, @@ method to simplify calling method. --- .../catalina/session/PersistentManagerBase.java | 34 +++++++++++++--------- 1 file changed, 20 insertions(+), 14 deletions(-) --- a/java/org/apache/catalina/session/PersistentManagerBase.java +++ a/java/org/apache/catalina/session/PersistentManagerBase.java @@ -709,20 +709,7 @@ public abstract class PersistentManagerBase extends ManagerBase if (session == null) { try { if (SecurityUtil.isPackageProtectionEnabled()){ - try { - session = AccessController.doPrivileged( - new PrivilegedStoreLoad(id)); - } catch (PrivilegedActionException ex) { - Exception e = ex.getException(); - log.error(sm.getString( - "persistentManager.swapInException", id), - e); - if (e instanceof IOException){ - throw (IOException)e; - } else if (e instanceof ClassNotFoundException) { - throw (ClassNotFoundException)e; - } - } + session = securedStoreLoad(id); } else { session = store.load(id); } @@ -769,6 +756,25 @@ public abstract class PersistentManagerBase extends ManagerBase } + private Session securedStoreLoad(String id) throws IOException, ClassNotFoundException { + try { + return AccessController.doPrivileged( + new PrivilegedStoreLoad(id)); + } catch (PrivilegedActionException ex) { + Exception e = ex.getException(); + log.error(sm.getString( + "persistentManager.swapInException", id), + e); + if (e instanceof IOException){ + throw (IOException)e; + } else if (e instanceof ClassNotFoundException) { + throw (ClassNotFoundException)e; + } + } + return null; + } + + /** * Remove the session from the Manager's list of active * sessions and write it out to the Store. If the session --