You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2013/12/09 22:17:30 UTC
svn commit: r1549684 -
/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java
Author: desruisseaux
Date: Mon Dec 9 21:17:30 2013
New Revision: 1549684
URL: http://svn.apache.org/r1549684
Log:
Bug fix: the flag telling whether XML namespaces should be replaced needs to be copied to (un)marshallers.
Modified:
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java?rev=1549684&r1=1549683&r2=1549684&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java [UTF-8] Mon Dec 9 21:17:30 2013
@@ -122,7 +122,7 @@ abstract class Pooled {
* Whether {@link FilteredNamespaces} shall be used of not. Values can be:
*
* <ul>
- * <li>0 for the default behavior, which is apply namespace replacements only if the {@link XML#GML_VERSION}
+ * <li>0 for the default behavior, which applies namespace replacements only if the {@link XML#GML_VERSION}
* property is set to an older value than the one supported natively by SIS.</li>
* <li>1 for forcing namespace replacements at unmarshalling time. This is useful for reading a XML document
* of unknown GML version.</li>
@@ -132,7 +132,7 @@ abstract class Pooled {
*
* @see LegacyNamespaces#APPLY_NAMESPACE_REPLACEMENTS
*/
- private byte applyNamespaceReplacements;
+ private byte xmlnsReplaceCode;
/**
* The GML version to be marshalled or unmarshalled, or {@code null} if unspecified.
@@ -217,15 +217,16 @@ abstract class Pooled {
reset(entry.getKey(), entry.getValue());
}
initialProperties.clear();
- bitMasks = template.bitMasks;
- locale = template.locale;
- timezone = template.timezone;
- schemas = template.schemas;
- gmlVersion = template.gmlVersion;
- resolver = template.resolver;
- converter = template.converter;
- warningListener = template.warningListener;
- resetTime = System.nanoTime();
+ bitMasks = template.bitMasks;
+ locale = template.locale;
+ timezone = template.timezone;
+ schemas = template.schemas;
+ xmlnsReplaceCode = template.xmlnsReplaceCode;
+ gmlVersion = template.gmlVersion;
+ resolver = template.resolver;
+ converter = template.converter;
+ warningListener = template.warningListener;
+ resetTime = System.nanoTime();
if (this instanceof Marshaller) {
bitMasks |= Context.MARSHALLING;
}
@@ -254,7 +255,7 @@ abstract class Pooled {
* @see FilteredNamespaces
*/
final FilterVersion getFilterVersion() {
- switch (applyNamespaceReplacements) {
+ switch (xmlnsReplaceCode) {
case 0: {
// Apply namespace replacements only for older versions than the one supported natively by SIS.
if (gmlVersion != null) {
@@ -389,9 +390,9 @@ abstract class Pooled {
return;
}
case LegacyNamespaces.APPLY_NAMESPACE_REPLACEMENTS: {
- applyNamespaceReplacements = 0;
+ xmlnsReplaceCode = 0;
if (value != null) {
- applyNamespaceReplacements = ((Boolean) value) ? (byte) 1 : (byte) 2;
+ xmlnsReplaceCode = ((Boolean) value) ? (byte) 1 : (byte) 2;
}
return;
}
@@ -436,7 +437,7 @@ abstract class Pooled {
return (n != 0) ? ArraysExt.resize(substitutes, n) : null;
}
case LegacyNamespaces.APPLY_NAMESPACE_REPLACEMENTS: {
- switch (applyNamespaceReplacements) {
+ switch (xmlnsReplaceCode) {
case 1: return Boolean.TRUE;
case 2: return Boolean.FALSE;
default: return null;