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 41118
Collapse All | Expand All

(-)src/org/netbeans/modules/masterfs/MasterFileSystem.java (-15 / +15 lines)
Lines 250-251 Link Here
250
            //int size = files.size();
250
            Set transformedSet = new Utils.LazySet(files);
251
            Set transformedSet = new HashSet();
252
--
Lines 254-256 Link Here
254
            MasterFileObject hfo = Utils.transformSet(files, transformedSet);
253
            FileSystem fs = getDelegFs(files);
255
            if (hfo != null) {
254
            if (fs != null) {
256
                FileSystem fs = hfo.getDelegateFileSystem();
257
--
Line 258 Link Here
257
            }
258
            return (retVal != null) ? retVal : icon;
259
        }
Lines 259-263 Link Here
259
                if (/*size == 1 && */fs != null && Delegate.get(hfo) == fs.getRoot()) {
262
        private FileSystem getDelegFs(Set files)  {
260
                    retVal = Utils.getRootIcon(iconType, fs);
263
            FileSystem retVal = null;
261
                } else {
264
            if (files.size() > 0) {
262
                    if (Delegate.hasMountAbleFlag(hfo)) {
265
                for (Iterator iterator = files.iterator(); iterator.hasNext();) {
263
                        retVal = ProviderCall.getIcon(hfo.getPath(), iconType);
266
                    Object o = iterator.next();
264
--
267
                    if (o instanceof MasterFileObject) {
268
                        retVal = ((MasterFileObject) o).getDelegateFileSystem();
269
                        break;
Line 265 Link Here
Line 268 Link Here
268
            return (retVal != null) ? retVal : icon;
273
            return retVal;
269
--
(-)src/org/netbeans/modules/masterfs/Utils.java (-5 / +69 lines)
Lines 23-26 Link Here
23
import java.util.MissingResourceException;
23
import java.util.*;
24
import java.util.Set;
25
import java.util.Iterator;
26
import java.util.HashSet;
27
--
Line 151 Link Here
148
    /** */
149
    final static class LazySet implements Set {
150
        private Set obj_files;
151
        private boolean initialized = false;
152
        LazySet(Set obj_files) {
153
            this.obj_files = obj_files;
154
        }
155
        synchronized private void lazyInitialization() {
156
            if (!initialized) {
157
                Set transformedSet = new HashSet();
158
                Utils.transformSet(obj_files, transformedSet);
159
                obj_files = transformedSet;
160
                initialized = true;
161
            }
162
        }
163
        public boolean add(Object o) {
164
            lazyInitialization();
165
            return obj_files.add(o);
166
        }
167
        public boolean addAll(Collection c) {
168
            lazyInitialization();
169
            return obj_files.addAll(c);
170
        }
171
        public void clear() {
172
            lazyInitialization();
173
            obj_files.clear();
174
        }
175
        public boolean contains(Object o) {
176
            lazyInitialization();
177
            return obj_files.contains(o);
178
        }
179
        public boolean containsAll(Collection c) {
180
            lazyInitialization();
181
            return obj_files.containsAll(c);
182
        }
183
        public boolean isEmpty() {
184
            lazyInitialization();
185
            return obj_files.isEmpty();
186
        }
187
        public Iterator iterator() {
188
            lazyInitialization();
189
            return obj_files.iterator();
190
        }
191
        public boolean remove(Object o) {
192
            lazyInitialization();
193
            return obj_files.remove(o);
194
        }
195
        public boolean removeAll(Collection c) {
196
            lazyInitialization();
197
            return obj_files.removeAll(c);
198
        }
199
        public boolean retainAll(Collection c) {
200
            lazyInitialization();
201
            return obj_files.retainAll(c);
202
        }
203
        public int size() {
204
            lazyInitialization();
205
            return obj_files.size();
206
        }
207
        public Object[] toArray() {
208
            lazyInitialization();
209
            return obj_files.toArray();
210
        }
211
        public Object[] toArray(Object[] a) {
212
            lazyInitialization();
213
            return obj_files.toArray(a);
214
        }
215
    }

Return to bug 41118