-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
16
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
Suggesting to modify javac to allow try-with-resources without a variable declaration, causing an implicit variable declaration to be inserted by the complier. This can be helpful in reducing code when dealing with resources that are opened and closed, but where the resource itself need not be exposed.
Example:
try (new SomethingToClose()) {
... do something while something to close is open
}
Suggesting to modify javac to allow try-with-resources without a variable declaration, causing an implicit variable declaration to be inserted by the complier. This can be helpful in reducing code when dealing with resources that are opened and closed, but where the resource itself need not be exposed.
Example:
try (new SomethingToClose()) {
... do something while something to close is open
}
- relates to
-
JDK-7011742 Allow Expressions in resource specification of try-with-resources
- Closed
-
JDK-7196163 Project Coin: Allow final or effectively final variables to be used as resources in try-with-resources
- Closed