Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2020-03-10 17:28:37 +0000
committerThomas Watson2020-03-10 17:28:37 +0000
commitcee7c1437cc402597ea9120c8631e7594164783a (patch)
treea232bffb08855e4781b5a093de4a7833fb8c9f91
parentbf506346ff2c91a60986226f0f26f5c2e7866548 (diff)
downloadrt.equinox.framework-cee7c1437cc402597ea9120c8631e7594164783a.tar.gz
rt.equinox.framework-cee7c1437cc402597ea9120c8631e7594164783a.tar.xz
rt.equinox.framework-cee7c1437cc402597ea9120c8631e7594164783a.zip
Update OSGi R8 APIs
-rw-r--r--bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/FrameworkUtil.java16
-rw-r--r--bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/connect/ConnectContent.java4
-rw-r--r--bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/connect/ModuleConnector.java2
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

Back to the top