harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r465977 - in /incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src: main/java/javax/accessibility/AccessibleStateSet.java test/api/java/common/javax/accessibility/AccessibleStateSetTest.java
Date Fri, 20 Oct 2006 04:05:39 GMT
Author: mloenko
Date: Thu Oct 19 21:05:39 2006
New Revision: 465977

URL: http://svn.apache.org/viewvc?view=rev&rev=465977
Log:
fixed HARMONY-1190
[classlib][accessibility] compatibility: AccessibleStateSet.toString() throws NPE on RI and
returns 'null'

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleStateSet.java
    incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleStateSetTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleStateSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleStateSet.java?view=diff&rev=465977&r1=465976&r2=465977
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleStateSet.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleStateSet.java
Thu Oct 19 21:05:39 2006
@@ -75,11 +75,11 @@
     @Override
     public String toString() {
         if (states == null) {
-            return ""; //$NON-NLS-1$
+            return "null"; //$NON-NLS-1$
         }
         StringBuffer str = new StringBuffer();
         for (Iterator<AccessibleState> it = states.iterator(); it.hasNext(); ) {
-            str.append(it.next());
+            str.append(it.next().toString());
             if (it.hasNext()) {
                 str.append(","); //$NON-NLS-1$
             }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleStateSetTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleStateSetTest.java?view=diff&rev=465977&r1=465976&r2=465977
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleStateSetTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/test/api/java/common/javax/accessibility/AccessibleStateSetTest.java
Thu Oct 19 21:05:39 2006
@@ -110,6 +110,14 @@
 
         stateSet.states = null;
         stateSet.toString();
+        
+        //regression test for HARMONY-1190
+        try {
+        	new AccessibleStateSet(new AccessibleState[2]).toString();
+        	fail("NullPointerException expected");
+        } catch (NullPointerException e) {
+        	//expected 
+        }
     }
 
     public void testToArray() throws Exception {



Mime
View raw message