Bug 45212

Summary: AbstractReplicatedMap.entrySet returns values not entries.
Product: Tomcat 6 Reporter: Robert Newson <robert.newson>
Component: ClusterAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 6.0.16   
Target Milestone: default   
Hardware: PC   
OS: Linux   

Description Robert Newson 2008-06-16 08:09:43 UTC
AbstractReplicatedMap implements entrySet() as follows;

        public Set entrySet() {
            LinkedHashSet set = new LinkedHashSet(super.size());
            Iterator i = super.entrySet().iterator();
            while ( i.hasNext() ) {
                Map.Entry e = (Map.Entry)i.next();
                Object key = e.getKey();
                MapEntry entry = (MapEntry)super.get(key);
                if ( entry != null && entry.isPrimary() ) set.add(entry.getValue());
            }
            return Collections.unmodifiableSet(set);
        }

this returns a set of all the *values*, the line set.add(entry.getValue()) should be set.add(entry);
Comment 1 Mark Thomas 2008-06-16 10:27:54 UTC
Thanks for the report. This is fixed in trunk and proposed for 6.0.x
Comment 2 Mark Thomas 2008-07-04 06:32:39 UTC
This has been fixed in 6.0.x and will be included in 6.0.17 onwards.