New inspection for IGP: Unclosed local resources
Unclosed local resources:
If you gather a resource (from a factory or new) into a local variable and
do not close it before it goes out of scope:
{
InitialContext jndiContext = new InitialContext(); // <-- close is
missing
// do something.
}
{
ConnectionFactory cf = ...;
Connection con = cf.getConnection(); // <-- close is missing
// do something.
}
Possible Resources:
JNDI: InitialContext, Context
JDBC: Connection, ResultSet, Statement
JCA: Connection, Interaction,
JMS: ...
I guess you get the picture. Most of these are real programming errors.
Please sign in to leave a comment.
This is already in plan, and I hope to have it before the first Irida EAP.
--Dave Griffith
Cool thanks
"Dave Griffith" <dave.griffith@cnn.com> wrote in message
news:31360931.1092913759385.JavaMail.itn@is.intellij.net...
>
>