This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 34961
Collapse All | Expand All

(-)openide/src/org/openide/util/Lookup.java (-2 / +2 lines)
Lines 295-301 Link Here
295
         * @since 1.8
295
         * @since 1.8
296
         */
296
         */
297
        public java.util.Collection allItems () {
297
        public java.util.Collection allItems () {
298
            return java.util.Collections.EMPTY_LIST;
298
            return java.util.Collections.EMPTY_SET;
299
        }
299
        }
300
    }
300
    }
301
    
301
    
Lines 382-388 Link Here
382
             * @return collection of all instances
382
             * @return collection of all instances
383
             */
383
             */
384
            public java.util.Collection allInstances () {
384
            public java.util.Collection allInstances () {
385
                return java.util.Collections.EMPTY_LIST;
385
                return java.util.Collections.EMPTY_SET;
386
            }
386
            }
387
        };
387
        };
388
        
388
        
(-)openide/src/org/openide/util/lookup/SimpleProxyLookup.java (+12 lines)
Lines 137-142 Link Here
137
            
137
            
138
            Collection newPairs = delegate.allItems ();
138
            Collection newPairs = delegate.allItems ();
139
            
139
            
140
            // See #34961 for explanation.
141
            if (!(oldPairs instanceof List)) {
142
                if (oldPairs == Collections.EMPTY_SET) {
143
                    // avoid allocation
144
                    oldPairs = Collections.EMPTY_LIST;
145
                } else {
146
                    oldPairs = new ArrayList(oldPairs);
147
                }
148
            }
149
            if (!(newPairs instanceof List)) {
150
                newPairs = new ArrayList(newPairs);
151
            }
140
            return !oldPairs.equals (newPairs);
152
            return !oldPairs.equals (newPairs);
141
        }
153
        }
142
        
154
        

Return to bug 34961