-
Enhancement
-
Resolution: Fixed
-
P4
-
7
-
b116
-
generic
-
generic
-
Verified
Various improvements to the javac implementation of the try-with-resources desugaring have been suggested:
1) Generate a per-class helper method to encapsulate the if-primary-exception not-null... logic of the synthesized finally block. (Unfortunately, such code cannot be shared in a common library method because the more precise exception information cannot be captured in the method's signature.)
2) From coin-dev ( http://mail.openjdk.java.net/pipermail/coin-dev/2011-February/003079.html ), omit the null-check on a resource if the resource is initialized with a constructor call since constructors cannot return null.
These should be considered in the future.
1) Generate a per-class helper method to encapsulate the if-primary-exception not-null... logic of the synthesized finally block. (Unfortunately, such code cannot be shared in a common library method because the more precise exception information cannot be captured in the method's signature.)
2) From coin-dev ( http://mail.openjdk.java.net/pipermail/coin-dev/2011-February/003079.html ), omit the null-check on a resource if the resource is initialized with a constructor call since constructors cannot return null.
These should be considered in the future.
- relates to
-
JDK-7020047 Project Coin: generate null-check around try-with-resources close call
-
- Closed
-
-
JDK-7013420 Project Coin: remove general expression support from try-with-resources statement
-
- Closed
-