tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Schumacher <felix.schumac...@internetallee.de>
Subject Re: svn commit: r935510 - /tomcat/trunk/java/org/apache/catalina/ha/session/BackupManager.java
Date Mon, 19 Apr 2010 14:53:43 GMT
Hi,
if sessions is an instance of something, it can't be null. So the check for null can be eliminated.

Felix


kfujino@apache.org schrieb:

>Author: kfujino
>Date: Mon Apr 19 10:12:02 2010
>New Revision: 935510
>
>URL: http://svn.apache.org/viewvc?rev=935510&view=rev
>Log:
>Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49151
>
>Modified:
>    tomcat/trunk/java/org/apache/catalina/ha/session/BackupManager.java
>
>Modified: tomcat/trunk/java/org/apache/catalina/ha/session/BackupManager.java
>URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/session/BackupManager.java?rev=935510&r1=935509&r2=935510&view=diff
>==============================================================================
>--- tomcat/trunk/java/org/apache/catalina/ha/session/BackupManager.java (original)
>+++ tomcat/trunk/java/org/apache/catalina/ha/session/BackupManager.java Mon Apr 19 10:12:02
2010
>@@ -248,9 +248,11 @@ public class BackupManager extends Stand
> 
>         setState(LifecycleState.STOPPING);
> 
>-        LazyReplicatedMap map = (LazyReplicatedMap)sessions;
>-        if ( map!=null ) {
>-            map.breakdown();
>+        if (sessions instanceof LazyReplicatedMap) {
>+            LazyReplicatedMap map = (LazyReplicatedMap)sessions;
>+            if ( map!=null ) {
>+                map.breakdown();
>+            }
>         }
> 
>         cluster.removeManager(this);
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: dev-help@tomcat.apache.org
>
Mime
View raw message