JDK-8156043 : Unstable behavior of PropertyDescriptor's getWriteMethod() in case of overloaded setters
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-05-04
  • Updated: 2025-03-20
  • Resolved: 2016-05-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b124Fixed
Related Reports
Causes :  
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)

Comments
This fix introduced regressions which are addressed by JDK-8211147, JDK-8280132 and JDK-8308152.
10-10-2024

URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/5dff4c1c075c User: lana Date: 2016-06-22 19:53:10 +0000
22-06-2016

URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/5dff4c1c075c User: serb Date: 2016-05-28 23:35:04 +0000
28-05-2016

please find attached simple test code to reproduce
06-05-2016

there are a lot of issues concerning getWriteMethod(), but at a 1st glance can't find any "open" or "new" duplicate for that
04-05-2016