Index: src/org/netbeans/modules/masterfs/MasterFileSystem.java =================================================================== RCS file: /cvs/openide/masterfs/src/org/netbeans/modules/masterfs/MasterFileSystem.java,v retrieving revision 1.5 diff -r1.5 MasterFileSystem.java 250,251c250 < //int size = files.size(); < Set transformedSet = new HashSet(); --- > Set transformedSet = new Utils.LazySet(files); 254,256c253,255 < MasterFileObject hfo = Utils.transformSet(files, transformedSet); < if (hfo != null) { < FileSystem fs = hfo.getDelegateFileSystem(); --- > FileSystem fs = getDelegFs(files); > > if (fs != null) { 257a257,260 > } > > return (retVal != null) ? retVal : icon; > } 259,263c262,269 < if (/*size == 1 && */fs != null && Delegate.get(hfo) == fs.getRoot()) { < retVal = Utils.getRootIcon(iconType, fs); < } else { < if (Delegate.hasMountAbleFlag(hfo)) { < retVal = ProviderCall.getIcon(hfo.getPath(), iconType); --- > private FileSystem getDelegFs(Set files) { > FileSystem retVal = null; > if (files.size() > 0) { > for (Iterator iterator = files.iterator(); iterator.hasNext();) { > Object o = iterator.next(); > if (o instanceof MasterFileObject) { > retVal = ((MasterFileObject) o).getDelegateFileSystem(); > break; 265d270 < 268c273 < return (retVal != null) ? retVal : icon; --- > return retVal; Index: src/org/netbeans/modules/masterfs/Utils.java =================================================================== RCS file: /cvs/openide/masterfs/src/org/netbeans/modules/masterfs/Utils.java,v retrieving revision 1.1 diff -r1.1 Utils.java 23,26c23 < import java.util.MissingResourceException; < import java.util.Set; < import java.util.Iterator; < import java.util.HashSet; --- > import java.util.*; 150a148,231 > /** */ > final static class LazySet implements Set { > private Set obj_files; > private boolean initialized = false; > > LazySet(Set obj_files) { > this.obj_files = obj_files; > } > > synchronized private void lazyInitialization() { > if (!initialized) { > Set transformedSet = new HashSet(); > Utils.transformSet(obj_files, transformedSet); > obj_files = transformedSet; > initialized = true; > } > } > > public boolean add(Object o) { > lazyInitialization(); > return obj_files.add(o); > } > > public boolean addAll(Collection c) { > lazyInitialization(); > return obj_files.addAll(c); > } > > public void clear() { > lazyInitialization(); > obj_files.clear(); > } > > public boolean contains(Object o) { > lazyInitialization(); > return obj_files.contains(o); > } > > public boolean containsAll(Collection c) { > lazyInitialization(); > return obj_files.containsAll(c); > } > > public boolean isEmpty() { > lazyInitialization(); > return obj_files.isEmpty(); > } > > public Iterator iterator() { > lazyInitialization(); > return obj_files.iterator(); > } > > public boolean remove(Object o) { > lazyInitialization(); > return obj_files.remove(o); > } > > public boolean removeAll(Collection c) { > lazyInitialization(); > return obj_files.removeAll(c); > } > > public boolean retainAll(Collection c) { > lazyInitialization(); > return obj_files.retainAll(c); > } > > public int size() { > lazyInitialization(); > return obj_files.size(); > } > > public Object[] toArray() { > lazyInitialization(); > return obj_files.toArray(); > } > > public Object[] toArray(Object[] a) { > lazyInitialization(); > return obj_files.toArray(a); > } > } >