Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerFactoryImpl.java')
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerFactoryImpl.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerFactoryImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerFactoryImpl.java
index c1166cba7..3afa85e77 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerFactoryImpl.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerFactoryImpl.java
@@ -110,19 +110,19 @@ public class ContentHandlerFactoryImpl extends MultiplexingFactory implements ja
}
ServiceReference<ContentHandler>[] serviceReferences = contentHandlerTracker.getServiceReferences();
if (serviceReferences != null) {
- for (int i = 0; i < serviceReferences.length; i++) {
- Object prop = serviceReferences[i].getProperty(URLConstants.URL_CONTENT_MIMETYPE);
+ for (ServiceReference<ContentHandler> serviceReference : serviceReferences) {
+ Object prop = serviceReference.getProperty(URLConstants.URL_CONTENT_MIMETYPE);
if (prop instanceof String)
prop = new String[] {(String) prop}; // TODO should this be a warning?
if (!(prop instanceof String[])) {
- String message = NLS.bind(Msg.URL_HANDLER_INCORRECT_TYPE, new Object[] {URLConstants.URL_CONTENT_MIMETYPE, contentHandlerClazz, serviceReferences[i].getBundle()});
+ String message = NLS.bind(Msg.URL_HANDLER_INCORRECT_TYPE, new Object[]{URLConstants.URL_CONTENT_MIMETYPE, contentHandlerClazz, serviceReference.getBundle()});
container.getLogServices().log(EquinoxContainer.NAME, FrameworkLogEntry.WARNING, message, null);
continue;
}
String[] contentHandler = (String[]) prop;
- for (int j = 0; j < contentHandler.length; j++) {
- if (contentHandler[j].equals(contentType)) {
- proxy = new ContentHandlerProxy(contentType, serviceReferences[i], context);
+ for (String typename : contentHandler) {
+ if (typename.equals(contentType)) {
+ proxy = new ContentHandlerProxy(contentType, serviceReference, context);
proxies.put(contentType, proxy);
return (proxy);
}

Back to the top