继续我在链接中的上一个查询:Swing Issue on Java 10,我发现了更多问题(仅突出显示错误),这次我看到问题主要出现在迁移到 Java 10 后的 Collection API 中。
下面是错误。想知道从 Java 8 迁移时 Java 10 是否有任何重大变化(从集合/泛型的角度来看)。
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\tree\WMTreeNode.java:159: error: breadthFirstEnumeration() in WMTreeNode cannot override breadthFirstEnumeration() in DefaultMutableTreeNode
[javac] public Enumeration<?extends WMTreeNode> breadthFirstEnumeration() {
[javac] ^
[javac] return type Enumeration<? extends WMTreeNode> is not compatible with Enumeration<TreeNode>
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\tree\WMTreeNode.java:158: error: method does not override or implement a method from a supertype
[javac] @Override
[javac] ^
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\tree\WMTreeNode.java:164: error: depthFirstEnumeration() in WMTreeNode cannot override depthFirstEnumeration() in DefaultMutableTreeNode
[javac] public Enumeration<?extends WMTreeNode> depthFirstEnumeration() {
[javac] ^
[javac] return type Enumeration<? extends WMTreeNode> is not compatible with Enumeration<TreeNode>
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\tree\WMTreeNode.java:163: error: method does not override or implement a method from a supertype
[javac] @Override
[javac] ^
[javac] ^
[javac] C:\WorkSpace\JAVA10\oswm\rel20.10_Patches\WorkManager\src\com\osm\ui\tree\WMTreeNode.java:298: error: no suitable method found for sort(Vector<TreeNode>)
[javac] Collections.sort(children);
WMTreeNode
正在延伸javax.swing.tree.DefaultMutableTreeNode
。
相关分类