Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-4033

[classlib][beans] A listener created by means of EventHandler.create() does not work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • Classlib
    • None

    Description

      A listener created by

      EventHandler.create(FredListener.class, target, "methodWithoutParam", null, "fireFredEvent")

      doesn't call target.methodWithoutParam() method when its fireFredEvent(event) method is called.

      To reproduce the issue please run the attached test.
      The expected output is "OK".

      Harmony throws the following exception instead.
      java.lang.reflect.InvocationTargetException
      at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
      at java.lang.reflect.Method.invoke(Method.java:382)
      at Test.main(Test.java:11)
      Caused by: java.lang.IllegalArgumentException: Invalid method call
      at java.beans.EventHandler.invoke(EventHandler.java:96)
      at $Proxy0.fireFredEvent(Unknown Source)
      at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
      ... 2 more

      Affected tests:
      functional/org/apache/harmony/test/func/api/java/beans/eventhandler/ImplementationOnlyOneMethodFalse.xml
      functional/org/apache/harmony/test/func/api/java/beans/eventhandler/ImplementationOnlyOneMethodTrue.xml
      (see HARMONY-3528)

      Attachments

        1. H-4033.patch
          2 kB
          Mikhail Markov
        2. test.zip
          1.0 kB
          Roman S. Bushmanov

        Issue Links

          Activity

            People

              zakha Alexei Zakharov
              rbouchma Roman S. Bushmanov
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: