-
Bug
-
Resolution: Not an Issue
-
P3
-
9, 10, 11
-
b02
-
generic
-
generic
FULL PRODUCT VERSION :
openjdk version "9-Ubuntu"
OpenJDK Runtime Environment (build 9-Ubuntu+0-9b181-2)
OpenJDK 64-Bit Server VM (build 9-Ubuntu+0-9b181-2, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux astoria 4.10.0-32-generic #36-Ubuntu SMP Tue Aug 8 12:10:06 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
The class "javax.swing.tree.DefaultMutableTreeNode" has gained generics on some protected fields which are for client usage. It contained raw Vector previously, now contains a Vector<TreeNode>.
This breaks existing code horribly, as clients must use their own TreeNode extension, e.g. in the Electric VLSI tool here:
https://sources.debian.net/src/electric/9.07%2Bdfsg-2/com/sun/electric/tool/user/ui/JobTree.java/#L50
children = [..] new Vector<JobTreeNode>();
Also the addition of generics to the "Enumeration children()" requires code changes, but not as horrible. Also left broken in the code example below.
Perhaps this field should be <? extends TreeNode>? Or the class should be generic?
REGRESSION. Last worked in version 8u144
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.Enumeration;
import java.util.Vector;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreeNode;
class MyNode implements TreeNode {
public boolean isLeaf() { return false; }
public TreeNode getParent() { return null; }
public int getIndex(TreeNode node) { return 0; }
public int getChildCount() { return 0; }
public TreeNode getChildAt(int childIndex) { return null; }
public boolean getAllowsChildren() { return false; }
public Enumeration<?> children() { return null; }
}
class A extends DefaultMutableTreeNode {
A() {
children = new Vector<MyNode>();
}
}
---------- END SOURCE ----------
openjdk version "9-Ubuntu"
OpenJDK Runtime Environment (build 9-Ubuntu+0-9b181-2)
OpenJDK 64-Bit Server VM (build 9-Ubuntu+0-9b181-2, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux astoria 4.10.0-32-generic #36-Ubuntu SMP Tue Aug 8 12:10:06 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
The class "javax.swing.tree.DefaultMutableTreeNode" has gained generics on some protected fields which are for client usage. It contained raw Vector previously, now contains a Vector<TreeNode>.
This breaks existing code horribly, as clients must use their own TreeNode extension, e.g. in the Electric VLSI tool here:
https://sources.debian.net/src/electric/9.07%2Bdfsg-2/com/sun/electric/tool/user/ui/JobTree.java/#L50
children = [..] new Vector<JobTreeNode>();
Also the addition of generics to the "Enumeration children()" requires code changes, but not as horrible. Also left broken in the code example below.
Perhaps this field should be <? extends TreeNode>? Or the class should be generic?
REGRESSION. Last worked in version 8u144
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.Enumeration;
import java.util.Vector;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreeNode;
class MyNode implements TreeNode {
public boolean isLeaf() { return false; }
public TreeNode getParent() { return null; }
public int getIndex(TreeNode node) { return 0; }
public int getChildCount() { return 0; }
public TreeNode getChildAt(int childIndex) { return null; }
public boolean getAllowsChildren() { return false; }
public Enumeration<?> children() { return null; }
}
class A extends DefaultMutableTreeNode {
A() {
children = new Vector<MyNode>();
}
}
---------- END SOURCE ----------
- relates to
-
JDK-8043550 Fix raw and unchecked lint warnings in javax.swing.*
- Resolved
-
JDK-8054360 Refine generification of javax.swing
- Resolved
-
JDK-8217035 Further refine generification of javax.swing
- Closed