-
Enhancement
-
Resolution: Not an Issue
-
P4
-
None
-
7
-
generic
-
generic
Expert group feedback has found a syntatic issue in the JSR 334 / Project Coin try-with-resources feature: the Resource alternatives
VariableModifiersopt Type VariableDeclaratorId = Expression
Expression
cannot be fully distinguished based on the first few tokens because of code like:
try (i < j ? .... // ?: operator expression
try (List<String> l ... // declaring a parameterized type
This issue should be resolved before the next JCP milestone. Remedies include restricting or even eliminating the Expression alternative. One restriction which may preserve most of the expressibility would be to limit the Expression to be an Identifier.
VariableModifiersopt Type VariableDeclaratorId = Expression
Expression
cannot be fully distinguished based on the first few tokens because of code like:
try (i < j ? .... // ?: operator expression
try (List<String> l ... // declaring a parameterized type
This issue should be resolved before the next JCP milestone. Remedies include restricting or even eliminating the Expression alternative. One restriction which may preserve most of the expressibility would be to limit the Expression to be an Identifier.
- relates to
-
JDK-7196163 Project Coin: Allow final or effectively final variables to be used as resources in try-with-resources
- Closed
-
JDK-7013420 Project Coin: remove general expression support from try-with-resources statement
- Closed
-
JDK-8273220 AutoCloseable And Try-With-Resources Without Variable Declaration
- Closed