Author: kkolinko Date: Mon Dec 21 13:26:52 2009 New Revision: 892814 URL: http://svn.apache.org/viewvc?rev=892814&view=rev Log: First followup to r892341 Replace tabs with spaces in the lines changed in that revision. No functional change.
Modified: tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java Modified: tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java?rev=892814&r1=892813&r2=892814&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java (original) +++ tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java Mon Dec 21 13:26:52 2009 @@ -790,7 +790,7 @@ return null; Object swapInLock = null; - + /* * The purpose of this sync and these locks is to make sure that a * session is only loaded once. It doesn't matter if the lock is removed @@ -800,78 +800,78 @@ * carry on. */ synchronized (this) { - if (sessionSwapInLocks.containsKey(id)) { - swapInLock = sessionSwapInLocks.get(id); - } else { - swapInLock = new Object(); - sessionSwapInLocks.put(id, swapInLock); - } - } + if (sessionSwapInLocks.containsKey(id)) { + swapInLock = sessionSwapInLocks.get(id); + } else { + swapInLock = new Object(); + sessionSwapInLocks.put(id, swapInLock); + } + } Session session = null; synchronized (swapInLock) { - // First check to see if another thread has loaded the session into - // the manager - session = sessions.get(id); - - 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; - } - } - } else { - session = store.load(id); - } - } catch (ClassNotFoundException e) { - String msg = sm.getString( - "persistentManager.deserializeError", id); - log.error(msg, e); - throw new IllegalStateException(msg, e); - } - - if (session != null && !session.isValid()) { - log.error(sm.getString( - "persistentManager.swapInInvalid", id)); - session.expire(); - removeSession(id); - session = null; - } - - if (session != null) { - if(log.isDebugEnabled()) - log.debug(sm.getString("persistentManager.swapIn", id)); - - session.setManager(this); - // make sure the listeners know about it. - ((StandardSession)session).tellNew(); - add(session); - ((StandardSession)session).activate(); - // endAccess() to ensure timeouts happen correctly. - // access() to keep access count correct or it will end up - // negative - session.access(); - session.endAccess(); - } - } + // First check to see if another thread has loaded the session into + // the manager + session = sessions.get(id); + + 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; + } + } + } else { + session = store.load(id); + } + } catch (ClassNotFoundException e) { + String msg = sm.getString( + "persistentManager.deserializeError", id); + log.error(msg, e); + throw new IllegalStateException(msg, e); + } + + if (session != null && !session.isValid()) { + log.error(sm.getString( + "persistentManager.swapInInvalid", id)); + session.expire(); + removeSession(id); + session = null; + } + + if (session != null) { + if(log.isDebugEnabled()) + log.debug(sm.getString("persistentManager.swapIn", id)); + + session.setManager(this); + // make sure the listeners know about it. + ((StandardSession)session).tellNew(); + add(session); + ((StandardSession)session).activate(); + // endAccess() to ensure timeouts happen correctly. + // access() to keep access count correct or it will end up + // negative + session.access(); + session.endAccess(); + } + } } // Make sure the lock is removed synchronized (this) { - sessionSwapInLocks.remove(id); - } + sessionSwapInLocks.remove(id); + } return (session); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org