incubator-wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r1181292 - in /incubator/wink/trunk/wink-common/src: main/java/org/apache/wink/common/internal/providers/entity/xml/AbstractJAXBProvider.java test/java/org/apache/wink/common/internal/providers/entity/xml/AbstractJAXBProviderTest.java
Date Mon, 10 Oct 2011 23:10:34 GMT
Author: rfeng
Date: Mon Oct 10 23:10:34 2011
New Revision: 1181292

URL: http://svn.apache.org/viewvc?rev=1181292&view=rev
Log:
Apply the patch from Seshu Pasam for WINK-352. Thanks.

Modified:
    incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/providers/entity/xml/AbstractJAXBProvider.java
    incubator/wink/trunk/wink-common/src/test/java/org/apache/wink/common/internal/providers/entity/xml/AbstractJAXBProviderTest.java

Modified: incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/providers/entity/xml/AbstractJAXBProvider.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/providers/entity/xml/AbstractJAXBProvider.java?rev=1181292&r1=1181291&r2=1181292&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/providers/entity/xml/AbstractJAXBProvider.java
(original)
+++ incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/providers/entity/xml/AbstractJAXBProvider.java
Mon Oct 10 23:10:34 2011
@@ -71,7 +71,7 @@ import org.slf4j.LoggerFactory;
 
 public abstract class AbstractJAXBProvider {
 
-    private static final Logger                                      logger             
           =
+    protected static final Logger                                    logger             
           =
                                                                                         
               LoggerFactory
                                                                                         
                   .getLogger(AbstractJAXBProvider.class);
     private static final SoftConcurrentMap<Class<?>, JAXBContext>    jaxbDefaultContexts
           =
@@ -232,9 +232,8 @@ public abstract class AbstractJAXBProvid
      * @return Unmarshaller an unmarshaller for the context
      * @throws JAXBException
      */
-    protected final Unmarshaller getJAXBUnmarshaller(Class<?> type,
-                                                     JAXBContext context,
-                                                     MediaType mediaType) throws JAXBException
{
+    protected Unmarshaller getJAXBUnmarshaller(Class<?> type, JAXBContext context,
MediaType mediaType)
+        throws JAXBException {
         Unmarshaller unm = upool.get(context);
         if (unm == null) {
             if (logger.isTraceEnabled()) {
@@ -321,7 +320,7 @@ public abstract class AbstractJAXBProvid
      * @return
      * @throws XMLStreamException
      */
-    protected static XMLStreamReader getXMLStreamReader(InputStream entityStream)
+    protected XMLStreamReader getXMLStreamReader(InputStream entityStream)
         throws XMLStreamException {
         // NOTE: createFilteredReader may appear to be more convenient, but it
         // comes at the cost of
@@ -340,7 +339,7 @@ public abstract class AbstractJAXBProvid
      * @return
      * @throws XMLStreamException
      */
-    protected static XMLStreamReader getXMLStreamReader(InputStreamReader entityStreamReader)
+    protected XMLStreamReader getXMLStreamReader(InputStreamReader entityStreamReader)
         throws XMLStreamException {
         // NOTE: createFilteredReader may appear to be more convenient, but it
         // comes at the cost of

Modified: incubator/wink/trunk/wink-common/src/test/java/org/apache/wink/common/internal/providers/entity/xml/AbstractJAXBProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/test/java/org/apache/wink/common/internal/providers/entity/xml/AbstractJAXBProviderTest.java?rev=1181292&r1=1181291&r2=1181292&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/test/java/org/apache/wink/common/internal/providers/entity/xml/AbstractJAXBProviderTest.java
(original)
+++ incubator/wink/trunk/wink-common/src/test/java/org/apache/wink/common/internal/providers/entity/xml/AbstractJAXBProviderTest.java
Mon Oct 10 23:10:34 2011
@@ -125,7 +125,7 @@ public class AbstractJAXBProviderTest ex
         final String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
         ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
         try {
-            AbstractJAXBProvider.getXMLStreamReader(bais);
+            new TestAbstractJAXBProvider().getXMLStreamReader(bais);
             fail("should have got an exception");
         } catch (XMLStreamException e) {
             // any other exception type will cause test failure
@@ -143,7 +143,7 @@ public class AbstractJAXBProviderTest ex
         final String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><!--
comment -->";
         ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
         try {
-            AbstractJAXBProvider.getXMLStreamReader(bais);
+            new TestAbstractJAXBProvider().getXMLStreamReader(bais);
             fail("should have got an exception");
         } catch (XMLStreamException e) {
             // any other exception type will cause test failure
@@ -161,7 +161,7 @@ public class AbstractJAXBProviderTest ex
         final String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>
 <!-- comment -->";
         ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
         try {
-            AbstractJAXBProvider.getXMLStreamReader(bais);
+            new TestAbstractJAXBProvider().getXMLStreamReader(bais);
             fail("should have got an exception");
         } catch (XMLStreamException e) {
             // any other exception type will cause test failure
@@ -179,7 +179,7 @@ public class AbstractJAXBProviderTest ex
         final String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>
 <!-- comment -->   ";
         ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
         try {
-            AbstractJAXBProvider.getXMLStreamReader(bais);
+            new TestAbstractJAXBProvider().getXMLStreamReader(bais);
             fail("should have got an exception");
         } catch (XMLStreamException e) {
             // any other exception type will cause test failure
@@ -199,7 +199,7 @@ public class AbstractJAXBProviderTest ex
         "<message>&file;</message>";
         ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
         try {
-            AbstractJAXBProvider.getXMLStreamReader(bais);
+            new TestAbstractJAXBProvider().getXMLStreamReader(bais);
             fail("should have got an exception");
         } catch (XMLStreamException e) {
             // any other exception type will cause test failure
@@ -219,7 +219,7 @@ public class AbstractJAXBProviderTest ex
         "<!DOCTYPE data [<!ENTITY file SYSTEM \"file:"+ TEST_CLASSES_PATH +"/etc/ProvidersJAXBTest.txt\">]>"
+
         "<message><arg0>&file;</arg0></message>";
         ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
-        XMLStreamReader reader = AbstractJAXBProvider.getXMLStreamReader(bais);
+        XMLStreamReader reader = new TestAbstractJAXBProvider().getXMLStreamReader(bais);
         assertEquals("reader event should be start element", XMLStreamReader.START_ELEMENT,
reader.getEventType());
         
         JAXBContext context = JAXBContext.newInstance(Message.class);
@@ -229,4 +229,6 @@ public class AbstractJAXBProviderTest ex
         assertEquals("message object should contain text from ProvidersJAXBTest.txt file",
"99999999", message.getArg0().trim());
     }
     
+    private static class TestAbstractJAXBProvider extends AbstractJAXBProvider {
+    }
 }



Mime
View raw message