Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2015-03-18 03:12:59 +0000
committerThomas Watson2015-03-18 03:12:59 +0000
commit71efa4e38f014cd6dcb7f9b564fd4483441fd596 (patch)
tree23c7d572a9e501e2719da0dbad68c09fb8cfadbc
parente084bbca47aca2b0d2db640b3707238615c26cb1 (diff)
downloadrt.equinox.framework-71efa4e38f014cd6dcb7f9b564fd4483441fd596.tar.gz
rt.equinox.framework-71efa4e38f014cd6dcb7f9b564fd4483441fd596.tar.xz
rt.equinox.framework-71efa4e38f014cd6dcb7f9b564fd4483441fd596.zip
Bug 462423 - URLStreamHandlerService registrations
- fix by checking for instanceof String Change-Id: I5cc6b9f791e6df19eb01bb41418788fc9b4a8127
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerProxy.java8
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerProxy.java8
2 files changed, 12 insertions, 4 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerProxy.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerProxy.java
index 5830da71c..f3b000242 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerProxy.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerProxy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2012 IBM Corporation and others.
+ * Copyright (c) 2003, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -71,8 +71,12 @@ public class ContentHandlerProxy extends ContentHandler implements ServiceTracke
public ServiceReference<ContentHandler> addingService(ServiceReference<ContentHandler> reference) {
//check to see if our contentType is being registered by another service
Object prop = reference.getProperty(URLConstants.URL_CONTENT_MIMETYPE);
- if (!(prop instanceof String[]))
+ if (prop instanceof String) {
+ prop = new String[] {(String) prop};
+ }
+ if (!(prop instanceof String[])) {
return null;
+ }
String[] contentTypes = (String[]) prop;
for (int i = 0; i < contentTypes.length; i++) {
if (contentTypes[i].equals(contentType)) {
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerProxy.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerProxy.java
index 757f10df9..d6351e1a3 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerProxy.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerProxy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2012 IBM Corporation and others.
+ * Copyright (c) 2003, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -156,8 +156,12 @@ public class URLStreamHandlerProxy extends URLStreamHandler implements ServiceTr
public ServiceReference<URLStreamHandlerService> addingService(ServiceReference<URLStreamHandlerService> reference) {
//check to see if our protocol is being registered by another service
Object prop = reference.getProperty(URLConstants.URL_HANDLER_PROTOCOL);
- if (!(prop instanceof String[]))
+ if (prop instanceof String) {
+ prop = new String[] {(String) prop};
+ }
+ if (!(prop instanceof String[])) {
return null;
+ }
String[] protocols = (String[]) prop;
for (int i = 0; i < protocols.length; i++) {
if (protocols[i].equals(protocol)) {

Back to the top