diff options
author | Thomas Watson | 2020-03-10 21:08:48 +0000 |
---|---|---|
committer | Thomas Watson | 2020-03-10 21:08:48 +0000 |
commit | 7e8cf82be04083a749484b0f45d1924efa0a96d3 (patch) | |
tree | a232bffb08855e4781b5a093de4a7833fb8c9f91 | |
parent | b3e4c5548755b15efe8102bc881bc3fa92f5c1eb (diff) | |
download | rt.equinox.framework-7e8cf82be04083a749484b0f45d1924efa0a96d3.tar.gz rt.equinox.framework-7e8cf82be04083a749484b0f45d1924efa0a96d3.tar.xz rt.equinox.framework-7e8cf82be04083a749484b0f45d1924efa0a96d3.zip |
Bring back "Update OSGi R8 APIs""
This reverts commit e8778b43b41f312da055747ba3a06acbde9fdfae.
3 files changed, 17 insertions, 5 deletions
diff --git a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/FrameworkUtil.java b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/FrameworkUtil.java index 236ad75d7..a16ea2c25 100644 --- a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/FrameworkUtil.java +++ b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/FrameworkUtil.java @@ -983,11 +983,23 @@ public class FrameworkUtil { @SuppressWarnings("unchecked") MapAsDictionary(Map< ? extends K, ? extends V> map) { this.map = (Map<K,V>) requireNonNull(map); - if (map.containsKey(null)) { + boolean nullKey; + try { + nullKey = map.containsKey(null); + } catch (NullPointerException e) { + nullKey = false; // map does not allow null key + } + if (nullKey) { throw new NullPointerException( "a Dictionary cannot contain a null key"); } - if (map.containsValue(null)) { + boolean nullValue; + try { + nullValue = map.containsValue(null); + } catch (NullPointerException e) { + nullValue = false; // map does not allow null value + } + if (nullValue) { throw new NullPointerException( "a Dictionary cannot contain a null value"); } diff --git a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/connect/ConnectContent.java b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/connect/ConnectContent.java index 44ec66031..939194542 100644 --- a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/connect/ConnectContent.java +++ b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/connect/ConnectContent.java @@ -99,7 +99,7 @@ public interface ConnectContent { * again. This allows for a connect content to reuse or create a new class * loader each time the bundle revision is resolved. * - * @return a class loader for the module. + * @return a class loader for the content. */ Optional<ClassLoader> getClassLoader(); @@ -122,7 +122,7 @@ public interface ConnectContent { void close() throws IOException; /** - * Represents the entry of a connect module + * Represents the entry of a connect content */ public interface ConnectEntry { /** diff --git a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/connect/ModuleConnector.java b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/connect/ModuleConnector.java index 3f9a112c5..3ac13cb44 100644 --- a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/connect/ModuleConnector.java +++ b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/connect/ModuleConnector.java @@ -62,7 +62,7 @@ public interface ModuleConnector { /** * Connects a bundle location with a {@link ConnectModule}. If an - * {@link Optional#empty() empty} optional is returned the the framework + * {@link Optional#empty() empty} optional is returned then the framework * must handle reading the content of the bundle itself. If a value is * {@link Optional#isPresent() present} in the returned optional then the * <code>ConnectModule</code> {@link Optional#get() value} from the optional |