abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r600217 - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/model/ core/src/test/java/org/apache/abdera/test/core/ parser/src/main/java/org/apache/abdera/parser/stax/
Date Sat, 01 Dec 2007 23:58:37 GMT
Author: jmsnell
Date: Sat Dec  1 15:58:37 2007
New Revision: 600217

URL: http://svn.apache.org/viewvc?rev=600217&view=rev
Log:
Fix NPE

Modified:
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java
    incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java?rev=600217&r1=600216&r2=600217&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java Sat
Dec  1 15:58:37 2007
@@ -184,6 +184,12 @@
   void removeAttribute(QName qname);
   
   /**
+   * Remove the named attribute
+   * @param name The name of the attribute to remove
+   */
+  void removeAttribute(String name);
+  
+  /**
    * Sets the value of the named attribute
    * @param name The name of the attribute
    * @param value The value of the attribute

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java?rev=600217&r1=600216&r2=600217&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java
Sat Dec  1 15:58:37 2007
@@ -167,6 +167,10 @@
     internal.removeAttribute(qname);
   }
 
+  public void removeAttribute(String name) {
+    internal.removeAttribute(name);
+  }
+  
   public void setAttributeValue(QName qname, String value) {
     internal.setAttributeValue(qname, value);
   }

Modified: incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java?rev=600217&r1=600216&r2=600217&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java
(original)
+++ incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java
Sat Dec  1 15:58:37 2007
@@ -745,6 +745,8 @@
 
     public void writeTo(String writer, Writer out, WriterOptions options)
         throws IOException {}
+
+    public void removeAttribute(String name) {}
     
   }
   
@@ -1410,6 +1412,8 @@
 
     public void writeTo(String writer, Writer out, WriterOptions options)
         throws IOException {}
+
+    public void removeAttribute(String name) {}
     
   }
 }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java?rev=600217&r1=600216&r2=600217&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
Sat Dec  1 15:58:37 2007
@@ -582,7 +582,8 @@
   }
   
   public void removeAttribute(String name) {
-    removeAttribute(getAttribute(new QName(name)));
+    OMAttribute attr = getAttribute(new QName(name));
+    if (attr != null) getAttribute(new QName(name));
   }
   
   protected void _removeChildren(QName qname, boolean many) {



Mime
View raw message