RFR: 6507038: Memory Leak in JTree / BasicTreeUI [v8]

Prasanta Sadhukhan psadhukhan at openjdk.org
Thu Feb 8 03:23:14 UTC 2024


On Wed, 7 Feb 2024 00:56:08 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Test updated
>
> src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java line 3282:
> 
>> 3280:                      expanded, treeModel.isLeaf(value), row,
>> 3281:                      false);
>> 3282:                 if(tree != null) {
> 
> Suggestion:
> 
>                 if (tree != null) {

other places uses similar so kept it to keep it consistent..

> test/jdk/javax/swing/plaf/basic/BasicTreeUI/TreeCellRendererLeakTest.java line 30:
> 
>> 28:  * @summary Verifies memory leak in BasicTreeUI TreeCellRenderer
>> 29:  * @run main TreeCellRendererLeakTest
>> 30:  */
> 
> jtreg header can be moved  to _before class declaration_ location.

No consensus on it yet so kept it same..

> test/jdk/javax/swing/plaf/basic/BasicTreeUI/TreeCellRendererLeakTest.java line 117:
> 
>> 115:         jScrollPane1 = new javax.swing.JScrollPane();
>> 116:         jTree1 = new javax.swing.JTree();
>> 117:         jPanel2 = new javax.swing.JPanel();
> 
> Fully qualified class name are redundant here since we already have the required imports.

ok

> test/jdk/javax/swing/plaf/basic/BasicTreeUI/TreeCellRendererLeakTest.java line 140:
> 
>> 138:         frame.getContentPane().add(jTabbedPane1, java.awt.BorderLayout.CENTER);
>> 139: 
>> 140:         frame.pack();
> 
> how about `frame.setSize(300, 200)` ?

ok

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17458#discussion_r1482365425
PR Review Comment: https://git.openjdk.org/jdk/pull/17458#discussion_r1482365210
PR Review Comment: https://git.openjdk.org/jdk/pull/17458#discussion_r1482365069
PR Review Comment: https://git.openjdk.org/jdk/pull/17458#discussion_r1482365511


More information about the client-libs-dev mailing list