Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1816

Closure Listener does not work with method events that have more than one parameter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0
    • 1.1-beta-1
    • None
    • None
    • Patch

    Description

      Section 6.4.1 of the beans sepc specifically allows for event listener methods that do not follow the standard JavaBeans pattern of having only one argument that is a sub-type of java.util.EventObject. It takes some BeanInfo magic to create such an event method that registers via introspection, but it can be done.

      When the event is actually fired something like the following exception is produced
      Caught: groovy.lang.MissingMethodException: No signature of method: CommandLine.doCall() is applicable for argument types: (java.lang.String) values:

      {"?"}

      at $Proxy0.somethingStrangeHappened(Unknown Source)
      at gjdk.groovy.StrangeBean_GroovyReflector.invoke(Unknown Source)
      at CommandLine.run(CommandLine.groovy:1)

      Attachments

        1. StrangeEventListener.java
          0.5 kB
          Daniel Ferrin
        2. StrangeBeanBeanInfo.java
          1 kB
          Daniel Ferrin
        3. StrangeBean.java
          1 kB
          Daniel Ferrin
        4. groovy-1816.txt
          1 kB
          Daniel Ferrin

        Activity

          People

            blackdrag Jochen Theodorou
            shemnon Daniel Ferrin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: