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

REGRESSION:java.awt.Component.setName() fires PropertyChangeEvent

    Details

    • Subcomponent:
    • CPU:
      x86, sparc
    • OS:
      linux, solaris_2.6, solaris_8

      Description



      Name: apR10229 Date: 05/30/2003


      Filed By : SPB JCK team (###@###.###)
      JDK : java full version "1.5.0-beta-b07"
      JCK : 1.5
      Platform[s] : Linux
      switch/Mode :
      JCK test owner : http://javaweb.eng/jct/sqe/JCK-tck/usr/owners.jto
      Failing Test [s] :
          api/java_awt/Component/descriptions.html#Listener[Component2125]


      Specification excerpt:
      ======================
      --------- J2SE API spec v.1.5 ---------
      ...
      public void addPropertyChangeListener(PropertyChangeListener listener)

             Adds a PropertyChangeListener to the listener list. The listener is registered for all bound properties
             of this class, including the following:
                    this Component's font ("font")
                    this Component's background color ("background")
                    this Component's foreground color ("foreground")
                    this Component's focusability ("focusable")
                    this Component's focus traversal keys enabled state ("focusTraversalKeysEnabled")
                    this Component's Set of FORWARD_TRAVERSAL_KEYS ("forwardFocusTraversalKeys")
                    this Component's Set of BACKWARD_TRAVERSAL_KEYS ("backwardFocusTraversalKeys")
                    this Component's Set of UP_CYCLE_TRAVERSAL_KEYS ("upCycleFocusTraversalKeys")
             Note that if this Component is inheriting a bound property, then no event will be fired in response to a
             change in the inherited property.

      ...
      ---------- end-of-excerpt ---------------

      Problem description
      ===================
      Invoking java.awt.Component.setName() method fires PropertyChangeEvent,
      but documentation contains no any information about such kind of behaviour,
      so the property "name" does not exist in the property list for
      PropertyChangeListener for this component.
          
      Minimized test:
      ===============
      ------- Test.java -------
      import java.awt.*;
      import java.beans.*;
      public class Test {
          public static void main(String[] argv) {
              StubComponent comp = new StubComponent();
              PCListener pcl = new PCListener();
              comp.addPropertyChangeListener(pcl);
              comp.setName("newname");
          }
      }
      class StubComponent extends Component {
          public StubComponent() {
              super();
          }
      }
      class PCListener implements PropertyChangeListener {
          public void propertyChange(PropertyChangeEvent evt){
              System.out.println("Listener called!");
          }
      }

      ------- end-of-Test.java -------

      Minimized test output:
      ======================
      <pav@libra(pts/5).283> java -cp . Test
      Listener called!
      <pav@libra(pts/5).284>

      JCK test source location:
      ==========================
      /java/re/jck/1.5//nightly/binaries/latest/JCK-runtime-15/tests

      Test output:
      =============
      Component2125: Failed. Component2125 failed: 1

      Specific Machine Info:
      =====================
      Linux libra 2.4.18 #10 Fri Jun 28 18:21:54 MSD 2002 i686 unknown

      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                svioletsunw Scott Violet (Inactive)
                Reporter:
                pavsunw Pav Pav (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: