Reports any JNDI resource which is not safely closed in a finally block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed. JNDI resources reported by this inspection include javax.naming.InitialContext, and javax.naming.NamingEnumeration.

Use the first checkbox below to specify if a JNDI Resource is allowed to be opened inside a try block. This style is less desirable because it is more verbose than opening a resource in front of a try block.

Use the second checkbox below to specify that the inspection should not warn if a JNDI resource is passed as a method call argument. If enabled the inspection assumes the resource is closed in the called method. Method calls inside a finally block with close in the name and a JNDI resource argument will not be ignored.