harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ton...@apache.org
Subject svn commit: r557833 - in /harmony/enhanced/classlib/trunk/modules/beans/src: main/java/java/beans/EventSetDescriptor.java test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java
Date Fri, 20 Jul 2007 01:11:31 GMT
Author: tonywu
Date: Thu Jul 19 18:11:31 2007
New Revision: 557833

URL: http://svn.apache.org/viewvc?view=rev&rev=557833
Log:
Fix exception compatibility, should throw NullPointerException rather than IntorspectException

Modified:
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java?view=diff&rev=557833&r1=557832&r2=557833
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
Thu Jul 19 18:11:31 2007
@@ -112,7 +112,7 @@
         Method method = null;
         Method[] methods = listenerType.getMethods();
         for (Method m : methods) {
-            if (m.getName().equals(listenerMethodName)) {
+            if (listenerMethodName.equals(m.getName())) {
                 Class[] paramTypes = m.getParameterTypes();
                 if (paramTypes.length == 1
                         && paramTypes[0].getName().endsWith("Event")) {

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java?view=diff&rev=557833&r1=557832&r2=557833
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java
Thu Jul 19 18:11:31 2007
@@ -275,8 +275,8 @@
                     listenerMethodName);
             fail("Should throw NullPointerException.");
         } catch (NullPointerException e) {
+            // expected
         }
-
     }
 
     /*
@@ -463,8 +463,16 @@
                     listenerMethodNames, addMethod, removeMethod);
             fail("Should throw NullPointerException.");
         } catch (NullPointerException e) {
+            // expected
+        }
+        
+        try {
+            new EventSetDescriptor(sourceClass, eventSetName, listenerType,
+                    new String[] { null }, addMethod, removeMethod);
+            fail("Should throw NullPointerException.");
+        } catch (NullPointerException e) {
+            // expected
         }
-
     }
 
     /*



Mime
View raw message