Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 302487 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/wst/server/discovery/internal/ExtensionUtility.java (-4 / +10 lines)
Lines 14-19 Link Here
14
import java.net.URL;
14
import java.net.URL;
15
import java.util.*;
15
import java.util.*;
16
import org.eclipse.core.runtime.*;
16
import org.eclipse.core.runtime.*;
17
import org.eclipse.equinox.p2.core.IProvisioningAgent;
17
import org.eclipse.equinox.p2.engine.IProfile;
18
import org.eclipse.equinox.p2.engine.IProfile;
18
import org.eclipse.equinox.p2.engine.IProfileRegistry;
19
import org.eclipse.equinox.p2.engine.IProfileRegistry;
19
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
20
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
Lines 240-250 Link Here
240
	public static Object getService(BundleContext context, String name) {
241
	public static Object getService(BundleContext context, String name) {
241
		if (context == null)
242
		if (context == null)
242
			return null;
243
			return null;
243
		ServiceReference reference = context.getServiceReference(name);
244
		ServiceReference reference = context.getServiceReference(IProvisioningAgent.SERVICE_NAME);
244
		if (reference == null)
245
		if (reference == null)
245
			return null;
246
			return null;
246
		Object result = context.getService(reference);
247
		IProvisioningAgent result = (IProvisioningAgent) context.getService(reference);
247
		context.ungetService(reference);
248
		if (result == null)
248
		return result;
249
			return null;
250
		try {
251
			return result.getService(name);
252
		} finally {
253
			context.ungetService(reference);
254
		}
249
	}
255
	}
250
}
256
}

Return to bug 302487