In Java, checked and unchecked conversions are when the generic types do not match on both sides of the assignment: ClassType<T> ct = var.method();
where var.method()
returns something of type ClassType
instead of ClassType<T>
.
The Java API says that node.children()
returns an object of type Enumeration
, not Enumeration<WhateverTreeNode>
. So, you could cast your method call: (Enumeration<WhateverTreeNode>)node.children()
if you know for sure what the underlying type is, or you assign the return value to a regular Enumeration
(which the javac compiler will still probably complain about).
Most likely, you will have to tell the compiler to ignore those warnings because of how the underlying javax code is written.
This related question and the Oracle Java Tutorial on Raw Types might help you understand checked and unchecked conversions.