harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r465986 - /incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/html/parser/AttributeList.java
Date Fri, 20 Oct 2006 04:36:32 GMT
Author: mloenko
Date: Thu Oct 19 21:36:29 2006
New Revision: 465986

URL: http://svn.apache.org/viewvc?view=rev&rev=465986
Log:
fixed HARMONY-1413, HARMONY-1414
[classlib][html] javax.swing.text.html.parser.AttributeList.getValues() throws NullPointerException
[classlib][html] javax.swing.text.html.parser.Element.getAttributeByValue(String) throws NullPointerException

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/html/parser/AttributeList.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/html/parser/AttributeList.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/html/parser/AttributeList.java?view=diff&rev=465986&r1=465985&r2=465986
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/html/parser/AttributeList.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/html/parser/AttributeList.java
Thu Oct 19 21:36:29 2006
@@ -138,7 +138,8 @@
     }
 
     public Enumeration<?> getValues() {
-        return values.elements();
+        // avoids a NullPointerException if values is null (same as RI)
+        return values == null ? null : values.elements();
     }
 
     public int getModifier() {
@@ -177,13 +178,8 @@
         }
     }
 
-    //TODO correct a bit: Do we check an instance or just equals?
     final boolean containsValue(final String value) {
-        if (value == this.value) {
-            return true;
-        }
-
-        return values.contains(value);
+        return values == null ? false : values.contains(value);
     }
 }
 



Mime
View raw message