You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Though the try-with-resources statement doesn't introduce any new bytecode instructions, it uses the Throwable.addSuppressed method which was added in Java 7. Possible options for a backport:
Swallow the suppressed exception
Throw the suppressed exception, swallowing the original exception
Print the stack trace of suppressed exceptions
Log the suppressed exceptions
Option 2 is clearly undesirable. I think option 3 would possibly cause lots of unwanted stack traces in the console. Option 4 is what Guava's Closer does.
I think the viable options are 1 and 4.
The text was updated successfully, but these errors were encountered:
It's not using a logger currently, but it would be relatively easy to add support for it (e.g. generate code that does java.util.logging.Logger.getLogger("CurrentClass").log(Level.WARNING, "Suppressed exception", exception)). It could be toggleable using a parameter when running Retrolambda. Does somebody want to have such logging?
Though the try-with-resources statement doesn't introduce any new bytecode instructions, it uses the Throwable.addSuppressed method which was added in Java 7. Possible options for a backport:
Option 2 is clearly undesirable. I think option 3 would possibly cause lots of unwanted stack traces in the console. Option 4 is what Guava's Closer does.
I think the viable options are 1 and 4.
The text was updated successfully, but these errors were encountered: