Can we get compiler warnings for empty catch blocks?
Chen Liang
chen.l.liang at oracle.com
Fri Jun 20 23:11:23 UTC 2025
Empty catch blocks serve a purpose: They aim to catch the type of exception from the try block, and continue execution from immediately after the try-catch statement. As Brian Goetz often says, let's first look at the problem instead of a solution. What prompted you to write those empty catch blocks at first?
________________________________
From: compiler-dev <compiler-dev-retn at openjdk.org> on behalf of David Alayachew <davidalayachew at gmail.com>
Sent: Friday, June 20, 2025 6:00 PM
To: compiler-dev <compiler-dev at openjdk.org>
Subject: Can we get compiler warnings for empty catch blocks?
I got burned pretty bad today because of a large number of empty catch blocks.
If a compiler warning is not feasible or not a good idea, that's fine.
But please let me know -- whether yes, no, or otherwise.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20250620/9f90c405/attachment-0001.htm>
More information about the compiler-dev
mailing list