Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5001842

EventSetDescriptor looses listener methods

XMLWordPrintable

    • b45
    • x86
    • linux_sun, windows_2000

      jdk 1.5.0 b39
      After some time, form editor in NetBeans is not able to generate code for event handlers, failing on NullPointerException because EventSetDescriptor.getAddListenerMethod() returns null.

      The cause seems to be in that the non-public "merge" and "clone" constructors of EventSetDescriptor (unlike the public constructors) don't copy the names of the "add" and "remove" listener methods. These methods (java.lang.reflect.Method) are held weekly so when the week reference is released, getAddListenerMethod() and getRemoveListenerMethod() return null as they are not able to recover the methods from the names.

      In NetBeans, introspecting e.g. JFrame leeds to the Introspecor calling the "merge" constructors of EventSetDescriptor - I think it is because there are multiple BeanInfo search paths in NB (e.g. dt.jar is on it).
      ###@###.### 2004-02-24

            bchristi Brent Christian
            tpavek Tomáš Pávek
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: