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.
package org.netbeans.core.projects.cache;
import java.io.*;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.URL;
import java.util.*;
public Object getAttribute(String attrName) {
initialize();
AttrImpl attr = (AttrImpl)attrs.get(attrName);
return attr == null ? null : attr.getValue(this, attrName);
if (attr != null) {
FileObject topFO = null;
try {
Class mfoClass = Class.forName("org.openide.filesystems.MultiFileObject"); //NOI18N
Field field = mfoClass.getDeclaredField("attrAskedFileObject"); //NOI18N
field.setAccessible(true);
ThreadLocal attrAskedFileObject = (ThreadLocal) field.get(null);
topFO = (FileObject) attrAskedFileObject.get();
attrAskedFileObject.set(null);
} catch (Exception e) {
ErrorManager.getDefault().notify(e);
}
return attr.getValue(topFO == null ? this : topFO, attrName);
} else {
return null;
/** Get all file attribute names for this file. */