cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1296001 - in /cxf/branches/2.5.x-fixes: ./ common/common/src/main/java/org/apache/cxf/staxutils/transform/OutTransformWriter.java
Date Thu, 01 Mar 2012 23:54:35 GMT
Author: ay
Date: Thu Mar  1 23:54:34 2012
New Revision: 1296001

URL: http://svn.apache.org/viewvc?rev=1296001&view=rev
Log:
Merged revisions 1295952 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1295952 | ay | 2012-03-01 23:28:52 +0100 (Thu, 01 Mar 2012) | 1 line
  
  [CXF-4150] modified the previous fix to avoid jaxrs systests regression erros
........

Modified:
    cxf/branches/2.5.x-fixes/   (props changed)
    cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/transform/OutTransformWriter.java

Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar  1 23:54:34 2012
@@ -1 +1 @@
-/cxf/trunk:1295026,1295466,1295504,1295714
+/cxf/trunk:1295026,1295466,1295504,1295714,1295952

Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/transform/OutTransformWriter.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/transform/OutTransformWriter.java?rev=1296001&r1=1296000&r2=1296001&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/transform/OutTransformWriter.java
(original)
+++ cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/transform/OutTransformWriter.java
Thu Mar  1 23:54:34 2012
@@ -20,6 +20,8 @@ package org.apache.cxf.staxutils.transfo
 
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -41,6 +43,7 @@ public class OutTransformWriter extends 
     private QNamesMap attributesMap;
     private Map<QName, ElementProperty> appendMap = new HashMap<QName, ElementProperty>(5);
     private Map<String, String> nsMap = new HashMap<String, String>(5);
+    private List<Set<String>> writtenUris = new LinkedList<Set<String>>();
     
     private Set<QName> dropElements;
     private Stack<List<ParsingEvent>> pushedAheadEvents = new Stack<List<ParsingEvent>>();
@@ -93,7 +96,8 @@ public class OutTransformWriter extends 
         
         uri = value != null ? value : uri;
         
-        if (prefix.equals(getPrefix(uri))) {
+        if (writtenUris.get(0).contains(uri) 
+            && (prefix.length() == 0 || prefix.equals(getPrefix(uri)))) {
             return;
         }
         
@@ -105,6 +109,7 @@ public class OutTransformWriter extends 
             }
             super.writeNamespace(prefix, uri);
         }
+        writtenUris.get(0).add(uri);
     }
     
     @Override
@@ -113,6 +118,13 @@ public class OutTransformWriter extends 
         if (matchesDropped(false)) {
             return;
         }
+        Set<String> s;
+        if (writtenUris.isEmpty()) {
+            s = new HashSet<String>();
+        } else {
+            s = new HashSet<String>(writtenUris.get(0));
+        }
+        writtenUris.add(0, s);
         
         final QName theName = new QName(uri, local, prefix);
         final ElementProperty appendProp = appendMap.remove(theName);
@@ -232,7 +244,9 @@ public class OutTransformWriter extends 
         } else if (dropDepth > 0) {
             dropDepth = 0;
         }
-
+        if (!writtenUris.isEmpty()) {
+            writtenUris.remove(0);
+        }
         QName theName = elementsStack.pop();
         final boolean dropped = dropElements.contains(theName);
         if (!dropped) {



Mime
View raw message