cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r889375 - in /cxf/branches/2.2.x-fixes: ./ parent/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/ rt/fron...
Date Thu, 10 Dec 2009 19:21:25 GMT
Author: sergeyb
Date: Thu Dec 10 19:21:19 2009
New Revision: 889375

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

........
  r889344 | sergeyb | 2009-12-10 17:38:54 +0000 (Thu, 10 Dec 2009) | 1 line
  
  Updating Jettison dependency to 1.2-SNAPSHOT plus few more fixes
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/parent/pom.xml
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONUtils.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriInfoImplTest.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/AegisJSONProviderTest.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 19:21:19 2009
@@ -1 +1 @@
-/cxf/trunk:887317,888400-888401
+/cxf/trunk:887317,888400-888401,889344

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

Modified: cxf/branches/2.2.x-fixes/parent/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/parent/pom.xml?rev=889375&r1=889374&r2=889375&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/parent/pom.xml (original)
+++ cxf/branches/2.2.x-fixes/parent/pom.xml Thu Dec 10 19:21:19 2009
@@ -528,7 +528,7 @@
             <dependency>
                 <groupId>org.codehaus.jettison</groupId>
                 <artifactId>jettison</artifactId>
-                <version>1.1</version>
+                <version>1.2-SNAPSHOT</version>
                 <exclusions>
                     <exclusion>
                         <groupId>stax</groupId>
@@ -1396,6 +1396,14 @@
             </build>
         </profile>
     </profiles>
+    <repositories>
+        <repository>
+            <id>Codehaus Snapshots</id>
+            <name>Codehaus Snapshots Repository</name>
+            <url>http://snapshots.repository.codehaus.org</url>
+        </repository> 
+    </repositories>
+
 
 </project>
 

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java?rev=889375&r1=889374&r2=889375&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
Thu Dec 10 19:21:19 2009
@@ -747,7 +747,7 @@
                     writtenUris.add(uri);
                 }
                 appendedElements.add(appendQName);
-                appendedIndexes.add(currentDepth - 2);
+                appendedIndexes.add(currentDepth - 1);
             }
             
             if (dropElements.contains(currentQName)) {

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONUtils.java?rev=889375&r1=889374&r2=889375&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONUtils.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONUtils.java
Thu Dec 10 19:21:19 2009
@@ -176,7 +176,9 @@
         
         private boolean writeXsiType;
         private QName ignoredQName;
-        
+        private boolean rootDropped;
+        private int index; 
+                
         public IgnoreContentJettisonWriter(XMLStreamWriter writer, boolean writeXsiType,
QName qname) {
             super(writer);
             this.writeXsiType = writeXsiType;
@@ -194,12 +196,23 @@
         
         @Override
         public void writeStartElement(String prefix, String local, String uri) throws XMLStreamException
{
+            index++;
             if (ignoredQName != null && ignoredQName.getLocalPart().equals(local)

                 && ignoredQName.getNamespaceURI().equals(uri)) {
+                rootDropped = true;
                 return;
             }
             super.writeStartElement(prefix, local, uri);
         }
+        
+        @Override
+        public void writeEndElement() throws XMLStreamException {
+            index--;
+            if (rootDropped && index == 0) {
+                return;
+            }
+            super.writeEndElement();
+        }
     }
     
     private static class IgnoreMixedContentWriter extends DelegatingXMLStreamWriter {

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java?rev=889375&r1=889374&r2=889375&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
Thu Dec 10 19:21:19 2009
@@ -221,10 +221,19 @@
                 for (int i = 0; i < args.length; i++) {
                     Type arg = args[i];
                     if (arg instanceof TypeVariable) {
-                        // give or take wildcards, this implies that the provider is generic,
and 
-                        // is willing to take whatever we throw at it. We could, I suppose,
-                        // do wildcard analysis. It would be more correct to look at the
bounds
-                        // and check that they are Object or compatible.
+                        TypeVariable var = (TypeVariable)arg;
+                        Type[] bounds = var.getBounds();
+                        boolean isResolved = false;
+                        for (int j = 0; j < bounds.length; j++) {
+                            Class<?> cls = InjectionUtils.getRawType(bounds[j]);
+                            if (cls != null && cls.isAssignableFrom(expectedType))
{
+                                isResolved = true;
+                                break;
+                            }
+                        }
+                        if (!isResolved) {
+                            return;
+                        }
                         if (m != null) {
                             InjectionUtils.injectContextFields(em.getProvider(), em, m);
                             InjectionUtils.injectContextMethods(em.getProvider(), em, m);

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java?rev=889375&r1=889374&r2=889375&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
Thu Dec 10 19:21:19 2009
@@ -923,7 +923,7 @@
                 } else {
                     value = values[1];
                 }
-                queries.add(values[0], value);
+                queries.add(HttpUtils.urlDecode(values[0]), value);
             }
         }
         return queries;

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriInfoImplTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriInfoImplTest.java?rev=889375&r1=889374&r2=889375&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriInfoImplTest.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriInfoImplTest.java
Thu Dec 10 19:21:19 2009
@@ -73,14 +73,15 @@
         assertEquals("Wrong query value", qps.getFirst("n"), "1%202");
         
         u = new UriInfoImpl(mockMessage("http://localhost:8080/baz", "/bar", 
-                                        "n=1%202&n=3&b=2"),
+                                        "n=1%202&n=3&b=2&a%2Eb=ab"),
                             null);
 
         qps = u.getQueryParameters();
-        assertEquals("Number of queiries is wrong", 2, qps.size());
+        assertEquals("Number of queiries is wrong", 3, qps.size());
         assertEquals("Wrong query value", qps.get("n").get(0), "1 2");
         assertEquals("Wrong query value", qps.get("n").get(1), "3");
         assertEquals("Wrong query value", qps.get("b").get(0), "2");
+        assertEquals("Wrong query value", qps.get("a.b").get(0), "ab");
     }
     
     @Test

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/AegisJSONProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/AegisJSONProviderTest.java?rev=889375&r1=889374&r2=889375&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/AegisJSONProviderTest.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/AegisJSONProviderTest.java
Thu Dec 10 19:21:19 2009
@@ -40,6 +40,7 @@
 import org.apache.cxf.jaxrs.resources.Tags;
 
 import org.junit.Assert;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class AegisJSONProviderTest extends Assert {
@@ -175,6 +176,7 @@
     }
     
     @Test
+    @Ignore
     public void testManyTags() throws Exception {
         AegisJSONProvider p = new AegisJSONProvider();
         p.setWriteXsiType(false);

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java?rev=889375&r1=889374&r2=889375&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
Thu Dec 10 19:21:19 2009
@@ -57,6 +57,7 @@
 
 public class JSONProviderTest extends Assert {
 
+    
     @Test
     public void testWriteCollectionWithoutXmlRootElement() 
         throws Exception {



Mime
View raw message