ws-commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r792250 - in /webservices/commons/trunk/modules/axiom/modules/axiom-api/src: main/java/org/apache/axiom/om/impl/OMStAXWrapper.java test/java/org/apache/axiom/stax/XMLStreamReaderComparator.java
Date Wed, 08 Jul 2009 18:29:54 GMT
Author: veithen
Date: Wed Jul  8 18:29:54 2009
New Revision: 792250

URL: http://svn.apache.org/viewvc?rev=792250&view=rev
Log:
Let OMStAXWrapper#isAttributeSpecified return true by default. This is more reasonable than
the current behavior (of returning false by default).

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OMStAXWrapper.java
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/stax/XMLStreamReaderComparator.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OMStAXWrapper.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OMStAXWrapper.java?rev=792250&r1=792249&r2=792250&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OMStAXWrapper.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OMStAXWrapper.java
Wed Jul  8 18:29:54 2009
@@ -542,19 +542,18 @@
      * @see javax.xml.stream.XMLStreamReader#isAttributeSpecified
      */
     public boolean isAttributeSpecified(int i) {
-        boolean returnValue = false;
         if (parser != null) {
-            returnValue = parser.isAttributeSpecified(i);
+            return parser.isAttributeSpecified(i);
         } else {
             if (isStartElement() || (currentEvent == ATTRIBUTE)) {
-
-                // theres nothing to be returned here
+                // The Axiom object model doesn't store this information,
+                // but returning true is a reasonable default.
+                return true;
             } else {
                 throw new IllegalStateException(
                         "attribute type accessed in illegal event!");
             }
         }
-        return returnValue;
     }
 
     /**

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/stax/XMLStreamReaderComparator.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/stax/XMLStreamReaderComparator.java?rev=792250&r1=792249&r2=792250&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/stax/XMLStreamReaderComparator.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/stax/XMLStreamReaderComparator.java
Wed Jul  8 18:29:54 2009
@@ -147,6 +147,7 @@
                     prefixes.add(assertSameResult("getAttributePrefix", paramTypes, args));
                     assertSameResult("getAttributeType", paramTypes, args);
                     assertSameResult("getAttributeValue", paramTypes, args);
+                    assertSameResult("isAttributeSpecified", paramTypes, args);
                 }
             }
             assertSameResult("getLocalName");



Mime
View raw message