@@ -0,0 +1,440 @@
+package sfBugs;%0A%0Aimport java.sql.Connection;%0Aimport java.sql.SQLException;%0A%0Apublic class Bug1842545 %7B%0A%09%0A%09private static Connection m_connection;%0A%09%0A%09public static void main(String args%5B%5D) %7B%0A%09%09Connection c = m_connection; // should trigger warning%0A%09%7D%0A%09%0A%09boolean hasConnection() %7B%0A%09%09try %7B%0A%09%09%09return (m_connection != null) && !m_connection.isClosed();%0A%09%09%7D catch (SQLException ex) // should not trigger warning (?)%0A%09%09%7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%7D%0A%7D%0A

Test case for sourceforge Bug1842545: