Should not be implementing java.lang.Iterable<? extends com.aspose.words.Node>?
Example: - for each iteration over document.getSections do not need explicit casting - for each iteration over body nodes need unchecked explicit casting (Iterable)
So are we right to do such explicit casting as it is also indicated in JavaDoc (but for different method) or do you expect to iterate over object that it is not an instance of Node?
It is very likely not possible to provide original code based on set restrictions, but there is some other example. Additionally it is possible to see that with "aspose-words-14.10.0-jdk16.jar" also.
I guess that this error is there due to fact com.aspose.words.Body implements raw type java.lang.Iterable (based on some version of JavaDoc of Aspose.Words).
Thanks for being patient. Please note that Aspose.Words for Java version is automatically ported from Aspose.Words for .NET baseline. .NET allows implicit unsafe casting of IEnumerable so it is ported as is to Java. Also, it is fully safe to use explicit ‘unsafe’ casting in his case - section.getBody() – i.e. Body iterator returns only com.aspose.words.Nodes. We have also logged a task for our development team to try to remove need of explicit casting in foreach loop for Body and other CompositeNode child nodes. We will keep you informed of any updates and let you know once this issue (WORDSJAVA-972) is resolved. We apologize for any inconvenience.