cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r985060 - in /cxf/branches/2.2.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/ rt/front...
Date Fri, 13 Aug 2010 01:19:26 GMT
Author: dkulp
Date: Fri Aug 13 01:19:26 2010
New Revision: 985060

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

........
  r985059 | dkulp | 2010-08-12 21:18:08 -0400 (Thu, 12 Aug 2010) | 3 lines
  
  [CXF-2939] Hold onto the JAXBContexts so the PermGen space doesn't go
  nuts.
  Do some test cleanups and other minor tweeks in jaxrs
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/CodeGeneratorProvider.java
    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/AtomPojoProvider.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/URITemplateTest.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/AtomPojoProviderTest.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/FormEncodingProviderTest.java
    cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/GenericHandlerWriter.java

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

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/CodeGeneratorProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/CodeGeneratorProvider.java?rev=985060&r1=985059&r2=985060&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/CodeGeneratorProvider.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/CodeGeneratorProvider.java
Fri Aug 13 01:19:26 2010
@@ -782,10 +782,6 @@ public class CodeGeneratorProvider imple
             throw new IllegalStateException("Unable to write generated Java files for schemas:
"
                                             + e.getMessage(), e);
         }
-        List<File> srcFiles = FileUtils.getFilesRecurse(src, ".+\\.java$");
-        for (File f : srcFiles) {
-            System.out.println(f.getAbsolutePath());
-        }
     }
 
     private List<Element> getSchemaElements(Element appElement) {

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=985060&r1=985059&r2=985060&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
Fri Aug 13 01:19:26 2010
@@ -37,7 +37,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.ResourceBundle;
 import java.util.Set;
-import java.util.WeakHashMap;
 import java.util.logging.Logger;
 
 import javax.ws.rs.WebApplicationException;
@@ -85,16 +84,17 @@ public abstract class AbstractJAXBProvid
     implements MessageBodyReader<Object>, MessageBodyWriter<Object> {
     
     protected static final ResourceBundle BUNDLE = BundleUtils.getBundle(AbstractJAXBProvider.class);
+
     private static final Logger LOG = LogUtils.getL7dLogger(AbstractJAXBProvider.class);
-   
     private static final String JAXB_DEFAULT_NAMESPACE = "##default";
     private static final String JAXB_DEFAULT_NAME = "##default";
     
-    private static Map<String, JAXBContext> packageContexts = new WeakHashMap<String,
JAXBContext>();
-    private static Map<Class<?>, JAXBContext> classContexts = new WeakHashMap<Class<?>,
JAXBContext>();
+    private static Map<String, JAXBContext> packageContexts = new HashMap<String,
JAXBContext>();
+    private static Map<Class<?>, JAXBContext> classContexts = new HashMap<Class<?>,
JAXBContext>();
+
    
-    private static Set<Class<?>> collectionContextClasses = new HashSet<Class<?>>();
-    private static JAXBContext collectionContext; 
+    protected Set<Class<?>> collectionContextClasses = new HashSet<Class<?>>();
+    protected JAXBContext collectionContext; 
     
     protected Map<String, String> jaxbElementClassMap;
     protected boolean unmarshalAsJaxbElement;

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AtomPojoProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AtomPojoProvider.java?rev=985060&r1=985059&r2=985060&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AtomPojoProvider.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AtomPojoProvider.java
Fri Aug 13 01:19:26 2010
@@ -514,7 +514,7 @@ public class AtomPojoProvider extends Ab
         }
         try {
             Unmarshaller um = 
-                new JAXBElementProvider().getJAXBContext(cls, cls).createUnmarshaller();
+                jaxbProvider.getJAXBContext(cls, cls).createUnmarshaller();
             return um.unmarshal(new StringReader(entry.getContent()));
         } catch (Exception ex) {
             reportError("Object of type " + cls.getName() + " can not be deserialized from
Entry", ex);

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java?rev=985060&r1=985059&r2=985060&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
Fri Aug 13 01:19:26 2010
@@ -79,6 +79,10 @@ public class JAXBElementProvider extends
     private boolean enableStreaming;
     private ValidationEventHandler eventHandler;
     
+    public JAXBElementProvider() {
+        
+    }
+    
     @Override
     public boolean isReadable(Class<?> type, Type genericType, Annotation[] anns, MediaType
mt) {
         

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/URITemplateTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/URITemplateTest.java?rev=985060&r1=985059&r2=985060&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/URITemplateTest.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/URITemplateTest.java
Fri Aug 13 01:19:26 2010
@@ -477,7 +477,7 @@ public class URITemplateTest extends Ass
     @Test
     public void testEncodeLiteralCharactersNotVariable() {
         URITemplate ut = new URITemplate("a {digit:[0-9]} b");
-        System.out.println(ut.encodeLiteralCharacters());
+        //System.out.println(ut.encodeLiteralCharacters());
         assertEquals("a%20{digit:[0-9]}%20b", ut.encodeLiteralCharacters());
     }
 }

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/AtomPojoProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/AtomPojoProviderTest.java?rev=985060&r1=985059&r2=985060&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/AtomPojoProviderTest.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/AtomPojoProviderTest.java
Fri Aug 13 01:19:26 2010
@@ -107,7 +107,7 @@ public class AtomPojoProviderTest extend
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         MediaType mt = MediaType.valueOf("application/atom+xml;type=entry");
         provider.writeTo(new Book("a"), Book.class, Book.class, new Annotation[]{}, mt, null,
bos);
-        System.out.println(bos.toString());
+        //System.out.println(bos.toString());
         ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
         Book book = (Book)provider.readFrom((Class)Book.class, Book.class, 
                                             new Annotation[]{}, mt, null, bis);

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/FormEncodingProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/FormEncodingProviderTest.java?rev=985060&r1=985059&r2=985060&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/FormEncodingProviderTest.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/FormEncodingProviderTest.java
Fri Aug 13 01:19:26 2010
@@ -215,17 +215,13 @@ public class FormEncodingProviderTest ex
         byte[] iso88591bytes = helloStringUTF16.getBytes("ISO-8859-1");
         String helloStringISO88591 = new String(iso88591bytes, "ISO-8859-1");
         
-        System.out.println(helloStringISO88591);
-        
         MultivaluedMap<String, String> mvMap = 
             (MultivaluedMap<String, String>)ferp.readFrom((Class)MultivaluedMap.class,
null,
                 new Annotation[]{}, 
                 MediaType.valueOf(MediaType.APPLICATION_FORM_URLENCODED + ";charset=ISO-8859-1"),
null, 
                 new ByteArrayInputStream(iso88591bytes));
         String value = mvMap.getFirst("name");
-
-        System.out.println(value);
-
+        assertEquals(helloStringISO88591, "name=" + value);
     }
 
     @Test

Modified: cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/GenericHandlerWriter.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/GenericHandlerWriter.java?rev=985060&r1=985059&r2=985060&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/GenericHandlerWriter.java
(original)
+++ cxf/branches/2.2.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/GenericHandlerWriter.java
Fri Aug 13 01:19:26 2010
@@ -32,6 +32,11 @@ import org.apache.cxf.jaxrs.provider.JAX
 import org.apache.cxf.jaxrs.utils.InjectionUtils;
 
 public class GenericHandlerWriter implements MessageBodyWriter<GenericHandler<Book>>
{
+    JAXBElementProvider jaxb = new JAXBElementProvider();
+    
+    public GenericHandlerWriter() {
+        
+    }
 
     public long getSize(GenericHandler<Book> t, Class<?> type, Type genericType,
Annotation[] annotations, 
                         MediaType mediaType) {        
@@ -46,7 +51,6 @@ public class GenericHandlerWriter implem
     public void writeTo(GenericHandler<Book> o, Class<?> c, Type t, Annotation[]
anns, MediaType m,
                         MultivaluedMap<String, Object> headers, OutputStream os) 
         throws IOException, WebApplicationException {
-        JAXBElementProvider jaxb = new JAXBElementProvider();
         jaxb.writeTo(o.getEntity(), o.getEntity().getClass(), InjectionUtils.getActualType(t),

                      anns, m, headers, os);
     }



Mime
View raw message