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) { |