Skip to content

Commit

Permalink
UnwantedChildException: Delegate to Location-taking constructor inste…
Browse files Browse the repository at this point in the history
…ad of int/int variant.
  • Loading branch information
kingjon3377 committed Mar 30, 2024
1 parent e5cf6d3 commit eca406f
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,9 @@ public static UnwantedChildException listingExpectedTags(final QName parent, fin
* @param child the unwanted child
*/
private UnwantedChildException(final StartElement child, final QName parent) {
// TODO: Use constructor taking Location instead of splitting Location here
super("Unexpected child, from unknown namespace, %s:%s in tag %s".formatted(
child.getName().getPrefix(), child.getName().getLocalPart(),
parent.getLocalPart()),
child.getLocation().getLineNumber(), child.getLocation().getColumnNumber());
parent.getLocalPart()), child.getLocation());
tag = parent;
this.child = child.getName();
location = child.getLocation();
Expand All @@ -173,10 +171,8 @@ public static UnwantedChildException unexpectedNamespace(final QName parent, fin
* @param message the additional message
*/
public UnwantedChildException(final QName parent, final StartElement child, final String message) {
// TODO: Use constructor taking Location instead of splitting Location here
super("Unexpected child %s in tag %s: %s".formatted(
child.getName().getLocalPart(), parent.getLocalPart(), message),
child.getLocation().getLineNumber(), child.getLocation().getColumnNumber());
child.getName().getLocalPart(), parent.getLocalPart(), message), child.getLocation());
tag = parent;
this.child = child.getName();
location = child.getLocation();
Expand Down

0 comments on commit eca406f

Please sign in to comment.