Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2008-07-30 13:40:25 +0000
committerThomas Watson2008-07-30 13:40:25 +0000
commit54173ed74ae02b94639e270113ee99d920037251 (patch)
tree810b33207065ae03718deff42d8d46c125c88de3
parent9496f30129c1cec27694031ffba9ed1426988caf (diff)
downloadrt.equinox.framework-54173ed74ae02b94639e270113ee99d920037251.tar.gz
rt.equinox.framework-54173ed74ae02b94639e270113ee99d920037251.tar.xz
rt.equinox.framework-54173ed74ae02b94639e270113ee99d920037251.zip
Bug 242561 URLStreamHandlerProxy does not delegate new Java 5 method: openConnection(URL u, Proxy p);
-rw-r--r--bundles/org.eclipse.osgi/.classpath7
-rw-r--r--bundles/org.eclipse.osgi/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--bundles/org.eclipse.osgi/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.osgi/build.properties3
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/protocol/StreamHandlerFactory.java14
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/protocol/URLStreamHandlerFactoryProxyFor15.java40
-rw-r--r--bundles/org.eclipse.osgi/osgi/exceptions.jarbin96326 -> 96729 bytes
7 files changed, 62 insertions, 12 deletions
diff --git a/bundles/org.eclipse.osgi/.classpath b/bundles/org.eclipse.osgi/.classpath
index 66c14f41a..f47fc74de 100644
--- a/bundles/org.eclipse.osgi/.classpath
+++ b/bundles/org.eclipse.osgi/.classpath
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="lib" path="osgi/exceptions.jar"/>
+ <classpathentry kind="lib" path="osgi/xmlParserAPIs.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/OSGi%Minimum-1.1"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="console/src"/>
<classpathentry kind="src" path="supplement/src"/>
<classpathentry kind="src" path="osgi/src"/>
@@ -10,8 +14,5 @@
<classpathentry kind="src" path="resolver/src"/>
<classpathentry kind="src" path="jarverifier"/>
<classpathentry kind="src" path="security/src"/>
- <classpathentry kind="lib" path="osgi/exceptions.jar"/>
- <classpathentry kind="lib" path="osgi/ee.minimum.jar"/>
- <classpathentry kind="lib" path="osgi/xmlParserAPIs.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.osgi/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.osgi/.settings/org.eclipse.jdt.core.prefs
index d304116cd..b8d156f2e 100644
--- a/bundles/org.eclipse.osgi/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.osgi/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Thu Aug 16 11:00:59 EDT 2007
+#Mon Jul 21 13:59:36 CDT 2008
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -8,9 +8,9 @@ org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.1
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.3
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -62,7 +62,6 @@ org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
org.eclipse.jdt.core.compiler.problem.unusedImport=error
@@ -144,7 +143,6 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
diff --git a/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF
index 37bbf01e5..a0a44475d 100644
--- a/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF
@@ -64,5 +64,5 @@ Bundle-DocUrl: http://www.eclipse.org
Eclipse-ExtensibleAPI: true
Eclipse-SystemBundle: true
Main-Class: org.eclipse.core.runtime.adaptor.EclipseStarter
-Bundle-RequiredExecutionEnvironment: J2SE-1.4,
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
OSGi/Minimum-1.1
diff --git a/bundles/org.eclipse.osgi/build.properties b/bundles/org.eclipse.osgi/build.properties
index 734768372..69291d543 100644
--- a/bundles/org.eclipse.osgi/build.properties
+++ b/bundles/org.eclipse.osgi/build.properties
@@ -30,4 +30,5 @@ source.. = osgi/src,\
jarverifier/,\
security/src/
output.. = bin/
-jre.compilation.profile = J2SE-1.4
+jre.compilation.profile = CDC-1.0/Foundation-1.0
+bootClasspath=osgi/exceptions.jar;osgi/xmlParserAPIs.jar;${CDC-1.0/Foundation-1.0}
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/protocol/StreamHandlerFactory.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/protocol/StreamHandlerFactory.java
index b6658c9bc..46cd55ee6 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/protocol/StreamHandlerFactory.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/protocol/StreamHandlerFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 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
@@ -38,6 +38,16 @@ public class StreamHandlerFactory extends MultiplexingFactory implements URLStre
protected static final String INTERNAL_PROTOCOL_HANDLER_PKG = "org.eclipse.osgi.framework.internal.protocol"; //$NON-NLS-1$
private static final List ignoredClasses = Arrays.asList(new Class[] {MultiplexingURLStreamHandler.class, StreamHandlerFactory.class, URL.class});
+ private static final boolean useNetProxy;
+ static {
+ Class clazz = null;
+ try {
+ clazz = Class.forName("java.net.Proxy"); //$NON-NLS-1$
+ } catch (ClassNotFoundException e) {
+ // expected on JRE < 1.5
+ }
+ useNetProxy = clazz != null;
+ }
private Hashtable proxies;
private URLStreamHandlerFactory parentFactory;
@@ -134,7 +144,7 @@ public class StreamHandlerFactory extends MultiplexingFactory implements URLStre
String[] protocols = (String[]) prop;
for (int j = 0; j < protocols.length; j++)
if (protocols[j].equals(protocol)) {
- handler = new URLStreamHandlerProxy(protocol, serviceReferences[i], context);
+ handler = useNetProxy ? new URLStreamHandlerFactoryProxyFor15(protocol, serviceReferences[i], context) : new URLStreamHandlerProxy(protocol, serviceReferences[i], context);
proxies.put(protocol, handler);
return (handler);
}
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/protocol/URLStreamHandlerFactoryProxyFor15.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/protocol/URLStreamHandlerFactoryProxyFor15.java
new file mode 100644
index 000000000..ed8fe4fd6
--- /dev/null
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/protocol/URLStreamHandlerFactoryProxyFor15.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.osgi.framework.internal.protocol;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.*;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+public class URLStreamHandlerFactoryProxyFor15 extends URLStreamHandlerProxy {
+
+ public URLStreamHandlerFactoryProxyFor15(String protocol, ServiceReference reference, BundleContext context) {
+ super(protocol, reference, context);
+ }
+
+ protected URLConnection openConnection(URL u, Proxy p) throws IOException {
+ try {
+ Method openConn = realHandlerService.getClass().getMethod("openConnection", new Class[] {URL.class, Proxy.class}); //$NON-NLS-1$
+ return (URLConnection) openConn.invoke(realHandlerService, new Object[] {u, p});
+ } catch (InvocationTargetException e) {
+ if (e.getTargetException() instanceof IOException)
+ throw (IOException) e.getTargetException();
+ throw (RuntimeException) e.getTargetException();
+ } catch (Exception e) {
+ // expected on JRE < 1.5
+ throw new UnsupportedOperationException();
+ }
+ }
+}
diff --git a/bundles/org.eclipse.osgi/osgi/exceptions.jar b/bundles/org.eclipse.osgi/osgi/exceptions.jar
index 4eefebe28..6c2a795c4 100644
--- a/bundles/org.eclipse.osgi/osgi/exceptions.jar
+++ b/bundles/org.eclipse.osgi/osgi/exceptions.jar
Binary files differ

Back to the top