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.


2 comments
Comment actions Permalink


This is already in plan, and I hope to have it before the first Irida EAP.

--Dave Griffith

0
Comment actions Permalink

Cool thanks
"Dave Griffith" <dave.griffith@cnn.com> wrote in message
news:31360931.1092913759385.JavaMail.itn@is.intellij.net...
>

This is already in plan, and I hope to have it before the first Irida EAP.

>

--Dave Griffith



0

Please sign in to leave a comment.