mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
31 lines
1.0 KiB
HTML
31 lines
1.0 KiB
HTML
<html>
|
|
<body>
|
|
Reports JNDI resources that are not safely closed. JNDI resources reported
|
|
by this inspection include <code>javax.naming.InitialContext</code>,
|
|
and <code>javax.naming.NamingEnumeration</code>.
|
|
<p>
|
|
By default, the inspection assumes that the resources can be closed by any method with
|
|
'close' or 'cleanup' in its name.
|
|
</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
Object findObject(Properties properties, String name) throws NamingException {
|
|
Context context = new InitialContext(properties); //context is not closed
|
|
return context.lookup(name);
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>
|
|
Use the following options to configure the inspection:
|
|
</p>
|
|
<ul>
|
|
<li>
|
|
Whether a JNDI Resource is allowed to be opened inside a <code>try</code> block.
|
|
This style is less desirable because it is more verbose than opening a resource in front of a <code>try</code> block.
|
|
</li>
|
|
<li>
|
|
Whether the resource can be closed by any method call with the resource passed as argument.
|
|
</li>
|
|
</ul>
|
|
</body>
|
|
</html> |