ERROR:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project abc : Compilation failure
[ERROR] abc.java:[128,32] incompatible types: java.util.Iterator<javax.xml.stream.events.Namespace> cannot be converted to java.util.Iterator<javax.xml.stream.events.Attribute>
CODE:
StartElement ele = (StartElement) xmleve;
Iterator<Attribute> ite = ele.getAttributes();
while (ite.hasNext()) {
Attribute attr = ite.next();
element.setAttribute(attr.getName().getLocalPart(),
attr.getValue());
}
String xmlns = EwsUtilities.WSTrustFebruary2005Namespace;//"http://schemas.xmlsoap.org/wsdl/";
ite = ele.getNamespaces();
ele.getNamespaces() is returning above mentioned error
NOTE:
The above mentioned error occured in OpenJDK version 11.0.5 but not in OpenJDK versions 1.7 & 1.8.