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

Unstable behavior of PropertyDescriptor's getWriteMethod() in case of overloaded setters

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b124

      Description

      JDK9 b115 + Win. 7

      To reproduce please run test/java/beans/Performance/Test4058433.java several times:

      $ $JDK/bin/java Test4058433 | tee log1.txt
      ...
      $ $JDK/bin/java Test4058433 | tee log5.txt

      then try to compare logs:

      $ diff log1.txt log2.txt
      82219,82220c82219,82220
      < property type: java.util.Vector
      < write method: public void javax.swing.JList.setListData(java.util.Vector)
      ---
      > property type: [Ljava.lang.Object;
      > write method: public void javax.swing.JList.setListData(java.lang.Object[])

      ...

      $ diff log1.txt log5.txt
      198923,198924c198923,198924
      < property type: java.util.Vector
      < write method: public void javax.swing.table.DefaultTableModel.setColumnIdentifiers(java.util.Vector)
      ---
      > property type: [Ljava.lang.Object;
      > write method: public void javax.swing.table.DefaultTableModel.setColumnIdentifiers(java.lang.Object[])

      etc.

      So it seems that the getWriteMethod() (ln 145 of the test) chooses the setter randomly. Only one setter per log is chosen as a "write method":
      $ cat log1.txt | grep "write method: public void javax.swing.JList.setListData"
      write method: public void javax.swing.JList.setListData(java.util.Vector)

        Attachments

          Activity

            People

            Assignee:
            serb Sergey Bylokhov
            Reporter:
            avstepan Alexander Stepanov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: