aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Pitschke2012-07-23 16:22:39 (EDT)
committerMichael Fiedler2012-07-31 08:36:37 (EDT)
commit5ad66ded63074aca26db9234ec3b8881cdecfe22 (patch)
treeacaabd856de2796277e8e334c5e7b02c0b287186
parent70d7b302803b82003e2d481293ef3ab5fd8f7ba9 (diff)
downloadorg.eclipse.lyo.core-5ad66ded63074aca26db9234ec3b8881cdecfe22.zip
org.eclipse.lyo.core-5ad66ded63074aca26db9234ec3b8881cdecfe22.tar.gz
org.eclipse.lyo.core-5ad66ded63074aca26db9234ec3b8881cdecfe22.tar.bz2
Bug 385784: Use Package Base Prefixes for Extended Properties in JSONrefs/changes/27/6927/2
Change-Id: Ib0744af985c56db11daf5a628d38d1eb008bb615 Signed-off-by: Steve Pitschke <pitschke@us.ibm.com>
-rw-r--r--OSLC4JJson4JProvider/src/org/eclipse/lyo/oslc4j/provider/json4j/JsonHelper.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/OSLC4JJson4JProvider/src/org/eclipse/lyo/oslc4j/provider/json4j/JsonHelper.java b/OSLC4JJson4JProvider/src/org/eclipse/lyo/oslc4j/provider/json4j/JsonHelper.java
index 4d59e76..826252a 100644
--- a/OSLC4JJson4JProvider/src/org/eclipse/lyo/oslc4j/provider/json4j/JsonHelper.java
+++ b/OSLC4JJson4JProvider/src/org/eclipse/lyo/oslc4j/provider/json4j/JsonHelper.java
@@ -698,11 +698,12 @@ final class JsonHelper
}
else
{
- final String prefix = extendedProperty.getKey().getPrefix();
-
- // Add the prefix to the JSON namespace mappings.
- namespaceMappings.put(prefix, namespace);
- reverseNamespaceMappings.put(namespace, prefix);
+ final String prefix = reverseNamespaceMappings.get(namespace);
+
+ if (prefix == null)
+ {
+ throw new OslcCoreMissingNamespaceDeclarationException(namespace);
+ }
// Add the value to the JSON object.
jsonObject.put(prefix + JSON_PROPERTY_DELIMITER + localName, value);