/* package */ IPropertyTester findTypeExtender(TypeExtensionManager manager, String namespace, String method, boolean staticMethod, boolean forcePluginActivation) throws CoreException {
if (fExtenders == null) {
fExtenders= manager.loadTesters(fType);
}
IPropertyTester result;
// handle extenders associated with this type extender
for (int i= 0; i < fExtenders.length; i++) {
IPropertyTester extender= fExtenders[i];
if (extender == null || !extender.handles(namespace, method))
continue;
if (extender.isInstantiated()) {
// There is no need to check for an active plug-in here. If a plug-in
// gets uninstalled we receive an registry event which will flush the whole
// type extender cache and will reinstantiate the testers. However Bundle#stop
// isn't handled by this. According to bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=130338
// we don't have to support stop in 3.2. If we have to in the future we have to
// reactivate the stopped plug-in if we are in forcePluginActivation mode.
return extender;
} else {
if (extender.isDeclaringPluginActive() || forcePluginActivation) {
try {
PropertyTesterDescriptor descriptor= (PropertyTesterDescriptor)extender;
IPropertyTester inst= descriptor.instantiate();
((PropertyTester)inst).internalInitialize(descriptor);
fExtenders[i]= extender= inst;
return extender;
} catch (CoreException e) {
fExtenders[i]= null;