From: fhanik Date: Thu, 9 Aug 2007 19:45:53 +0000 (+0000) Subject: If there is no primary node, then let the expiration time apply to the backup node X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=6a473f69189cce18379674a0e6653e2b475c6239;p=tomcat7.0 If there is no primary node, then let the expiration time apply to the backup node git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@564356 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java b/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java index 9a1df18f7..fb655a2bc 100644 --- a/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java +++ b/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java @@ -978,7 +978,8 @@ public abstract class AbstractReplicatedMap extends ConcurrentHashMap implements Map.Entry e = (Map.Entry)i.next(); Object key = e.getKey(); MapEntry entry = (MapEntry)super.get(key); - if ( entry.isPrimary() ) set.add(entry.getValue()); + if ( entry != null && entry.isPrimary() ) set.add(entry.getValue()); + else if ( entry != null && entry.getPrimary() == null && entry.isBackup() ) set.add(entry.getValue()); } return Collections.unmodifiableSet(set); } @@ -992,7 +993,8 @@ public abstract class AbstractReplicatedMap extends ConcurrentHashMap implements Map.Entry e = (Map.Entry)i.next(); Object key = e.getKey(); MapEntry entry = (MapEntry)super.get(key); - if ( entry.isPrimary() ) set.add(key); + if ( entry!=null && entry.isPrimary() ) set.add(key); + else if ( entry != null && entry.getPrimary() == null && entry.isBackup() ) set.add(key); } return Collections.unmodifiableSet(set); @@ -1009,6 +1011,7 @@ public abstract class AbstractReplicatedMap extends ConcurrentHashMap implements if ( e != null ) { MapEntry entry = (MapEntry) super.get(e.getKey()); if (entry!=null && entry.isPrimary() && entry.getValue() != null) counter++; + else if ( entry != null && entry.getPrimary() == null && entry.isBackup() ) counter++; } } return counter;