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

(-)a/masterfs/src/org/netbeans/modules/masterfs/ProvidedExtensionsProxy.java (-2 / +20 lines)
Lines 45-50 Link Here
45
import java.io.IOException;
45
import java.io.IOException;
46
import java.util.Collection;
46
import java.util.Collection;
47
import java.util.Iterator;
47
import java.util.Iterator;
48
import java.util.concurrent.atomic.AtomicReference;
48
import java.util.logging.Level;
49
import java.util.logging.Level;
49
import java.util.logging.Logger;
50
import java.util.logging.Logger;
50
import org.netbeans.modules.masterfs.providers.AnnotationProvider;
51
import org.netbeans.modules.masterfs.providers.AnnotationProvider;
Lines 58-64 Link Here
58
 * @author Radek Matous
59
 * @author Radek Matous
59
 */
60
 */
60
public class ProvidedExtensionsProxy extends ProvidedExtensions {
61
public class ProvidedExtensionsProxy extends ProvidedExtensions {
61
    private Collection/*AnnotationProvider*/ annotationProviders;
62
    private Collection<AnnotationProvider> annotationProviders;
62
    private static ThreadLocal  reentrantCheck = new ThreadLocal();
63
    private static ThreadLocal  reentrantCheck = new ThreadLocal();
63
    
64
    
64
    /** Creates a new instance of ProvidedExtensionsProxy */
65
    /** Creates a new instance of ProvidedExtensionsProxy */
Lines 247-253 Link Here
247
                });                
248
                });                
248
            }
249
            }
249
        }
250
        }
250
    }        
251
    }
252
253
    @Override
254
    public Object getAttribute(final File file, final String attrName) {
255
        final AtomicReference<Object> value = new AtomicReference();
256
        for (AnnotationProvider provider : annotationProviders) {
257
            final InterceptionListener iListener = (provider != null) ? provider.getInterceptionListener() : null;
258
            if (iListener instanceof ProvidedExtensions) {
259
                runCheckCode(new Runnable() {
260
                    public void run() {
261
                        value.set(((ProvidedExtensions) iListener).getAttribute(file, attrName));
262
                    }
263
                });
264
            }
265
            if(value.get() != null) break;
266
        }
267
        return value.get();
268
    }
251
    
269
    
252
    public static void checkReentrancy() {
270
    public static void checkReentrancy() {
253
        if (reentrantCheck.get() != null) {            
271
        if (reentrantCheck.get() != null) {            
(-)a/masterfs/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/BaseFileObj.java (-2 / +6 lines)
Lines 358-365 Link Here
358
            }
358
            }
359
        } else if (attrName.equals("ExistsParentNoPublicAPI")) {
359
        } else if (attrName.equals("ExistsParentNoPublicAPI")) {
360
            return getExistingParent() != null;
360
            return getExistingParent() != null;
361
        } 
361
        } else if (attrName.startsWith("ProvidedExtensions")) {  //NOI18N
362
                
362
            // #158600 - delegate to ProvidedExtensions if attrName starts with ProvidedExtensions prefix
363
            ProvidedExtensions extension = getProvidedExtensions();
364
            return extension.getAttribute(getFileName().getFile(), attrName);
365
        }
366
   
363
        return BaseFileObj.attribs.readAttribute(getFileName().getFile().getAbsolutePath().replace('\\', '/'), attrName);//NOI18N
367
        return BaseFileObj.attribs.readAttribute(getFileName().getFile().getAbsolutePath().replace('\\', '/'), attrName);//NOI18N
364
    }
368
    }
365
369
(-)a/masterfs/src/org/netbeans/modules/masterfs/providers/ProvidedExtensions.java (-1 / +12 lines)
Lines 175-179 Link Here
175
     * @param fo file which <code>FileLock</code> was released
175
     * @param fo file which <code>FileLock</code> was released
176
     * @since 1.11
176
     * @since 1.11
177
     */                
177
     */                
178
    public void fileUnlocked(FileObject fo) {}        
178
    public void fileUnlocked(FileObject fo) {}
179
180
    /**
181
     * Called by {@code MasterFileSystem} when {@code FileObject} is
182
     * queried for attribute and attribute's name starts with {@code ProvidedExtensions}
183
     * prefix.
184
     * @param attrName name of attribute
185
     * @return value of attribute
186
     */
187
    public Object getAttribute(File file, String attrName) {
188
        return null;
189
    }
179
}
190
}

Return to bug 158681