harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r549637 - in /harmony/enhanced/classlib/trunk/modules/beans/src: main/java/java/beans/EventHandler.java test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java
Date Thu, 21 Jun 2007 22:46:40 GMT
Author: ayza
Date: Thu Jun 21 15:46:37 2007
New Revision: 549637

URL: http://svn.apache.org/viewvc?view=rev&rev=549637
Log:
Applying patch from HARMONY-4033 ([classlib][beans] A listener created by means of EventHandler.create()
does not work)

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

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java?view=diff&rev=549637&r1=549636&r2=549637
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java
Thu Jun 21 15:46:37 2007
@@ -157,12 +157,11 @@
         } else if (listenerMethodName.equals(method.getName())) {
             // method's name matches
             // no arguments in call are valid
-            if ((eventPropertyName == null)
-                    && ((arguments == null) || (arguments.length == 0))) {
+            if (eventPropertyName == null
+                    && (arguments == null || arguments.length == 0)) {
                 result = true;
-                // one-argument call is value
-            } else if ((eventPropertyName != null) && (arguments != null)
-                    && (arguments.length == 1)) {
+            // one-argument call is also valid
+            } else if (arguments != null && arguments.length == 1) {
                 result = true;
             } else {
                 result = false;

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java?view=diff&rev=549637&r1=549636&r2=549637
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java
Thu Jun 21 15:46:37 2007
@@ -126,6 +126,13 @@
 
         assertEquals(invocationObject, handler.getTarget());
         assertEquals("doSomething", getMethodName());
+
+        // Regression test for HARMONY-4033
+        m = FredListener.class.getMethod("fireFredEvent",
+                new Class[] { FredEvent.class });
+        proxy = EventHandler.create(FredListener.class, invocationObject,
+                "doSomething", null, "fireFredEvent");
+        m.invoke(proxy, new Object[] { null });
     }
 
     /**



Mime
View raw message