aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Pitschke2012-07-31 09:22:58 (EDT)
committerMichael Fiedler2012-07-31 09:30:14 (EDT)
commit8e1203967e33fa079cfad5c42f603fb554654dd0 (patch)
tree10c2fa06fdec4c5d490e6489f626158c785d07e4
parentc8c9ad41c336910c6eab192f200ce1923f05969b (diff)
downloadorg.eclipse.lyo.core-8e1203967e33fa079cfad5c42f603fb554654dd0.zip
org.eclipse.lyo.core-8e1203967e33fa079cfad5c42f603fb554654dd0.tar.gz
org.eclipse.lyo.core-8e1203967e33fa079cfad5c42f603fb554654dd0.tar.bz2
Bug 385784: Fall Back to QName Prefixrefs/changes/27/7027/2
If an extended property namespace is not in builtin prefix mappings use the prefix in the QName. Change-Id: Iee67d231d32854c935515634c3076ed8ad43a944 Signed-off-by: Steve Pitschke <pitschke@us.ibm.com>
-rw-r--r--OSLC4JJson4JProvider/src/org/eclipse/lyo/oslc4j/provider/json4j/JsonHelper.java8
1 files changed, 6 insertions, 2 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 b95489b..4ef1dbf 100644
--- a/OSLC4JJson4JProvider/src/org/eclipse/lyo/oslc4j/provider/json4j/JsonHelper.java
+++ b/OSLC4JJson4JProvider/src/org/eclipse/lyo/oslc4j/provider/json4j/JsonHelper.java
@@ -706,11 +706,15 @@ final class JsonHelper
}
else
{
- final String prefix = reverseNamespaceMappings.get(namespace);
+ String prefix = reverseNamespaceMappings.get(namespace);
if (prefix == null)
{
- throw new OslcCoreMissingNamespaceDeclarationException(namespace);
+ prefix = extendedProperty.getKey().getPrefix();
+
+ // Add the prefix to the JSON namespace mappings.
+ namespaceMappings.put(prefix, namespace);
+ reverseNamespaceMappings.put(namespace, prefix);
}
// Add the value to the JSON object.