从PrimeFaces 10.0.0到11.0.0的变化是否使Treenode成为原始类型?

发布于 2025-02-05 08:18:47 字数 412 浏览 3 评论 0原文

现在,当我定义一个treenode列表时,例如:

list node = elethnode.getChildren();

我收到两个警告。

对于左侧:“ treenode是一种原始类型。对右侧的通用类型treeNode的引用应为“参数化”

:“类型安全:类型列表的表达式需要不受检查的转换以符合列表以列出列表“

这也会引起代码破坏问题尝试使用for循环以迭代这样的列表时:

for(treenode loopingNode:node.getChildren()) { ... }

我收到一个实际错误:“类型不匹配:无法从元素类型对象转换为treenode”

这些问题仅在从PrimeFaces 10.0.0升级到PrimeFaces 11.0.0时才提出。为什么会这?我已经浏览了迁移指南(

Now, when I define a TreeNode List such as:

List node = otherNode.getChildren();

I get two warnings.

For the left side: "TreeNode is a raw type. References to generic type TreeNode should be parameterized"

For the right side: "Type safety: The expression of type List needs unchecked conversion to conform to List"

This also creates a code breaking issue when trying to use a for loop to iterate though the list like this:

for(TreeNode loopingNode : node.getChildren())
{
...
}

I receive an actual error: "Type mismatch: cannot convert from element type Object to TreeNode"

These issues were only raised when upgrading from PrimeFaces 10.0.0 to PrimeFaces 11.0.0. Why would this be? I have looked through the migration guide (https://primefaces.github.io/primefaces/11_0_0/#/../migrationguide/11_0_0), but I do not think I see anything about this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空宴 2025-02-12 08:18:47

是的。请参阅:

在11.0.0 RC 1中添加了这一点。我将在迁移指南中添加注释。

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文