From 3b0c2f752f52b951adf60a8f821dd3c6789e09c2 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Tue, 15 Oct 2024 15:46:24 +0200 Subject: [PATCH] [core] Remove NumberFormatException from innermost try/catch in parseAndProcessStanza() This was added in 02d8f53246b3 ("[core] Increase resilience against faulty parser implementions"). However, NumberFormatException is a subclass of IllegalArgumentException, which is already catched by the outermost catch. --- .../java/org/jivesoftware/smack/AbstractXMPPConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java index 00d19c4f0..a8e0909c6 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java @@ -1462,7 +1462,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection { try { try { stanza = PacketParserUtils.parseStanza(parser, incomingStreamXmlEnvironment); - } catch (NullPointerException | NumberFormatException e) { + } catch (NullPointerException e) { // Those exceptions should probably be wrapped into a SmackParsingException and therefore likely constitute a missing verification in the throwing parser. String message = "Smack parser throw unexpected exception '" + e.getMessage() + "', please report this at " + Smack.BUG_REPORT_URL; LOGGER.log(Level.SEVERE, message, e);