JDK-8057770 : api/javax_swing/JScrollPane/indexTGF.html#UpdateUI failed with MotifLookAndFeel on all platform
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6,7,8,8u25,8u40,9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-09-03
  • Updated: 2017-08-17
  • Resolved: 2014-09-09
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 8 JDK 9
8u25Fixed 9 b33Fixed
Description
Please see the following code:

-----------------------------------------------------------------------------------------
import javax.swing.*;
import static java.lang.System.err;

public class UpUI {

    public static void main(String[] args) {

        JScrollPane scrollPane = new JScrollPane();

        err.println(scrollPane.getPropertyChangeListeners().length);
        scrollPane.updateUI();
        err.println(scrollPane.getPropertyChangeListeners().length);
        scrollPane.updateUI();
        err.println(scrollPane.getPropertyChangeListeners().length);

    }
}
----------------------------------------------------------------------------------------- 

With MotifLookAndFeel the number of listeners will be growing - verified on JDK6, JDK7, JDK8, JDK8u26 (on Win/Solaris) - the output will be

2
3
4

While with default LaFs (on Win/Solaris) the output will be

2
2
2


The following test which is new to JCK8 (not present in JCK7) fails due to this

api/javax_swing/JScrollPane/indexTGF.html\#UpdateUI[updateUI_PropertyChangeListener_list_notGrows]


--- original report from JCK QA ---

JDK 8 b129
JCK 8a QAC b12

Other Options 
-Dswing.defaultlaf=com.sun.java.swing.plaf.motif.MotifLookAndFeel
------------------------------------------------------------------------------------------

Comments
There is no the test in JCK7.
09-09-2014

SQE OK to take the tck-red bug fix fix in CPU14_04.
09-09-2014

The issue isn't applicable to jck1.5a and jck6b because there is no the test.
09-09-2014

http://cr.openjdk.java.net/~azvegint/jdk/9/8057770/
09-09-2014

Critical request justification: Webrev: http://cr.openjdk.java.net/~azvegint/jdk/9/8057770/ Reivew: http://mail.openjdk.java.net/pipermail/swing-dev/2014-September/003902.html Issue impact: old propertyChangeListeners not cleared, this may cause a memory leak and other side effects Fix rational: change uninstallListeners() signature to override a method correctly. Risks: minimal Suggested testing: run failing JCK test
09-09-2014

MotifScrollPaneUI does not override uninstallListeners() method from BasicScrollPaneUI It has following signature protected void uninstallListeners(JScrollPane scrollPane) { but it should be protected void uninstallListeners(JComponent c) { So listeners will never be deleted. BTW, it is a bit confusing since installListeners() has signature with JScrollPane parameter: protected void installListeners(JScrollPane c)
08-09-2014

Same problem in XTextAreaPeer.
08-09-2014

The failure is present here: http://moonblade.ru.oracle.com/set/java/jck/qa-results/jck/8/ea/b29/results/laf/laf_linux_b29_motif/report/html/kfl_newfailures.html
03-09-2014

As I can see this test also failed during JCK8 test runs on JCK8 b29. report https://wiki.se.oracle.com/display/JPG/JCK8+b29+Test+Report#JCK8b29TestReport-Additionaltestruns
03-09-2014