[MNG-7965] Fix duplicate tags not rejected (#1344)

This commit is contained in:
Guillaume Nodet 2023-12-15 07:33:11 +01:00 committed by GitHub
parent a1fe9fc387
commit d9a49e6ff7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -761,6 +761,10 @@ public class ${className} {
throw new XMLStreamException("Duplicated tag: '" + tagName + "'", parser.getLocation(), null);
}
}
#else
if (!parsed.add(tagName)) {
throw new XMLStreamException("Duplicated tag: '" + tagName + "'", parser.getLocation(), null);
}
#end
return tagName;
}

View File

@ -613,6 +613,7 @@ public class ${className} {
#foreach( $entry in $aliases.entrySet() )
case "${entry.key}":
tagName = "${entry.value}";
break;
#end
}
#end
@ -627,6 +628,10 @@ public class ${className} {
throw new XMLStreamException("Duplicated tag: '" + tagName + "'", parser.getLocation(), null);
}
}
#else
if (!parsed.add(tagName)) {
throw new XMLStreamException("Duplicated tag: '" + tagName + "'", parser.getLocation(), null);
}
#end
return tagName;
}