| Priority |
Normal |
| Type | Bug |
| State | Fixed |
| Assignee | Bas Leijdekkers |
| Subsystem | Code Analysis. Inspection |
| Affected versions |
No affected versions
|
| Fixed in |
No fix versions
|
| Fixed in build |
Next build |
| Build |
5766
|
| Fixed in build |
8238
|
| Severity |
0
|
IDEA-34765 |
JDBC resource inspection bug |
|
|
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.CallableStatement;
public class Main
{
private interface MyStatement extends CallableStatement{}
public void doit( Connection conn )
{
CallableStatement stmt = null;
MyStatement stmt2 = null;
try
{
stmt = conn.prepareCall( "xxx" );
stmt2 = (MyStatement) conn.prepareCall( "xxx" );
}
catch ( SQLException e )
{
e.printStackTrace();
}
finally
{
if ( stmt != null )
{
try { stmt.close(); } catch ( SQLException e ) { e.printStackTrace(); }
}
if ( stmt2 != null )
{
try { stmt2.close(); } catch ( SQLException e ) { e.printStackTrace(); }
}
}
}
}