Inspectopedia Help

Connection opened but not safely closed

Reports Java ME javax.microedition.io.Connection resources that are not opened in front of a try block and closed in the corresponding finally block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed.

Example:

void example() throws IOException { Connection c = Connector.open("foo"); }

Inspection options

Option

Type

Default

Allow resource to be opened inside a 'try' block

Checkbox

false

Any method may close resource argument

Checkbox

true

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023