Improve InvalidJidException handling in Jid class
This code should never be triggered anway, so with this 'fix', we should at least get more meaningful stack traces. Plus, it makes the linter happy by preventing NullPointerExceptions.
This commit is contained in:
parent
da31582911
commit
a7c7a42136
|
@ -176,7 +176,7 @@ public final class Jid {
|
||||||
return resourcepart.isEmpty() ? this : fromParts(localpart, domainpart, "");
|
return resourcepart.isEmpty() ? this : fromParts(localpart, domainpart, "");
|
||||||
} catch (final InvalidJidException e) {
|
} catch (final InvalidJidException e) {
|
||||||
// This should never happen.
|
// This should never happen.
|
||||||
return null;
|
throw new AssertionError("Jid " + this.toString() + " invalid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ public final class Jid {
|
||||||
return resourcepart.isEmpty() && localpart.isEmpty() ? this : fromString(getDomainpart());
|
return resourcepart.isEmpty() && localpart.isEmpty() ? this : fromString(getDomainpart());
|
||||||
} catch (final InvalidJidException e) {
|
} catch (final InvalidJidException e) {
|
||||||
// This should never happen.
|
// This should never happen.
|
||||||
return null;
|
throw new AssertionError("Jid " + this.toString() + " invalid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue