aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2018-03-27 08:39:53 -0400
committerThomas Watson2018-03-27 08:39:53 -0400
commite6a6ae711af0f1e7de635df9521060623c4e9f12 (patch)
tree8bead934d332b48b2cdb802d2a5ebfdcd3184277
parent37ab4783e1a81f9fd8217da0c9ae36de69d6e62b (diff)
downloadrt.equinox.framework-e6a6ae711af0f1e7de635df9521060623c4e9f12.tar.gz
rt.equinox.framework-e6a6ae711af0f1e7de635df9521060623c4e9f12.tar.xz
rt.equinox.framework-e6a6ae711af0f1e7de635df9521060623c4e9f12.zip
on Java 9 Change-Id: Ia1becb00af4cf117ad6fea3f754b8354e53b6fec Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/URLHandlerTests.java10
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/debug.gifbin0 -> 581 bytes
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerFactoryImpl.java10
3 files changed, 16 insertions, 4 deletions
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/URLHandlerTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/URLHandlerTests.java
index 3751a22e0..d37277369 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/URLHandlerTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/URLHandlerTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 IBM Corporation and others.
+ * Copyright (c) 2015, 2018 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
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.osgi.tests.bundles;
+import java.awt.image.ImageProducer;
+import java.io.IOException;
import java.net.URL;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -31,4 +33,10 @@ public class URLHandlerTests extends AbstractBundleTests {
testURL.openConnection().connect();
}
+ public void testImageProducer() throws IOException {
+ URL testImage = getClass().getResource("debug.gif");
+ Object content = testImage.getContent();
+ assertTrue("Wrong content type: " + content.getClass().getName(), content instanceof ImageProducer);
+ }
+
}
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/debug.gif b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/debug.gif
new file mode 100644
index 000000000..518e8660e
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/debug.gif
Binary files differ
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 f83b6008c..c3bbabf3a 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2016 IBM Corporation and others.
+ * Copyright (c) 2003, 2018 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
@@ -14,7 +14,11 @@ package org.eclipse.osgi.internal.url;
import java.lang.reflect.Method;
import java.net.ContentHandler;
import java.net.URLConnection;
-import java.util.*;
+import java.util.Arrays;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
import org.eclipse.osgi.framework.log.FrameworkLogEntry;
import org.eclipse.osgi.internal.framework.EquinoxContainer;
import org.eclipse.osgi.internal.messages.Msg;
@@ -36,7 +40,7 @@ public class ContentHandlerFactoryImpl extends MultiplexingFactory implements ja
private static final String contentHandlerClazz = "java.net.ContentHandler"; //$NON-NLS-1$
private static final String CONTENT_HANDLER_PKGS = "java.content.handler.pkgs"; //$NON-NLS-1$
- private static final String DEFAULT_VM_CONTENT_HANDLERS = "sun.net.www.content"; //$NON-NLS-1$
+ private static final String DEFAULT_VM_CONTENT_HANDLERS = "sun.net.www.content|sun.awt.www.content"; //$NON-NLS-1$
private static final List<Class<?>> ignoredClasses = Arrays.asList(new Class<?>[] {MultiplexingContentHandler.class, ContentHandlerFactoryImpl.class, URLConnection.class});