Java 7 automatic resource management and suppressed exceptions

Hello, I just read this article: http://www.oracle.com/technetwork/articles/java/trywithresources-401775.html I was aware of auto-close in Java 7, but have just seen (here) an example of "suppressed exceptions", which appear in stacktraces. Will this have an impact/be supported with logback? For reference, this example: MyException: Exception in work() at AutoClose.work(AutoClose.java:11) at AutoClose.runWithoutMasking(AutoClose.java:27) at AutoClose.main(AutoClose.java:58) Suppressed: java.lang.RuntimeException: Exception in close() at AutoClose.close(AutoClose.java:6) at AutoClose.runWithoutMasking(AutoClose.java:34) ... 1 more Thanks, Christopher

Thanks for pointing this out. I guess we need to add support for Throwable[] getSuppressed() using reflection... Cheers, Joern. On 10.06.2011, at 22:39, Christopher BROWN wrote:
Hello,
I just read this article: http://www.oracle.com/technetwork/articles/java/trywithresources-401775.html
I was aware of auto-close in Java 7, but have just seen (here) an example of "suppressed exceptions", which appear in stacktraces. Will this have an impact/be supported with logback?
For reference, this example:
MyException: Exception in work() at AutoClose.work(AutoClose.java:11) at AutoClose.runWithoutMasking(AutoClose.java:27) at AutoClose.main(AutoClose.java:58) Suppressed: java.lang.RuntimeException: Exception in close() at AutoClose.close(AutoClose.java:6) at AutoClose.runWithoutMasking(AutoClose.java:34) ... 1 more
Thanks, Christopher _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user

I just prepared Lilith for this new feature. https://github.com/huxi/lilith/commit/b8b298659e317cc0dbba321e6b42c358455182... Now we simply need to add support for this to Logback. ;) Cheers, Joern. On 10.06.2011, at 22:39, Christopher BROWN wrote:
Hello,
I just read this article: http://www.oracle.com/technetwork/articles/java/trywithresources-401775.html
I was aware of auto-close in Java 7, but have just seen (here) an example of "suppressed exceptions", which appear in stacktraces. Will this have an impact/be supported with logback?
For reference, this example:
MyException: Exception in work() at AutoClose.work(AutoClose.java:11) at AutoClose.runWithoutMasking(AutoClose.java:27) at AutoClose.main(AutoClose.java:58) Suppressed: java.lang.RuntimeException: Exception in close() at AutoClose.close(AutoClose.java:6) at AutoClose.runWithoutMasking(AutoClose.java:34) ... 1 more
Thanks, Christopher _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user

I created a feature request at http://jira.qos.ch/browse/LBCLASSIC-276 On 10.06.2011, at 22:39, Christopher BROWN wrote:
Hello,
I just read this article: http://www.oracle.com/technetwork/articles/java/trywithresources-401775.html
I was aware of auto-close in Java 7, but have just seen (here) an example of "suppressed exceptions", which appear in stacktraces. Will this have an impact/be supported with logback?
For reference, this example:
MyException: Exception in work() at AutoClose.work(AutoClose.java:11) at AutoClose.runWithoutMasking(AutoClose.java:27) at AutoClose.main(AutoClose.java:58) Suppressed: java.lang.RuntimeException: Exception in close() at AutoClose.close(AutoClose.java:6) at AutoClose.runWithoutMasking(AutoClose.java:34) ... 1 more
Thanks, Christopher _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user

I just checked the pull request https://github.com/ceki/logback/pull/16 linked to http://jira.qos.ch/browse/LBCLASSIC-276 on Java 7 b145 and everything works as expected. Cheers, Joern. On 10.06.2011, at 22:39, Christopher BROWN wrote:
Hello,
I just read this article: http://www.oracle.com/technetwork/articles/java/trywithresources-401775.html
I was aware of auto-close in Java 7, but have just seen (here) an example of "suppressed exceptions", which appear in stacktraces. Will this have an impact/be supported with logback?
For reference, this example:
MyException: Exception in work() at AutoClose.work(AutoClose.java:11) at AutoClose.runWithoutMasking(AutoClose.java:27) at AutoClose.main(AutoClose.java:58) Suppressed: java.lang.RuntimeException: Exception in close() at AutoClose.close(AutoClose.java:6) at AutoClose.runWithoutMasking(AutoClose.java:34) ... 1 more
Thanks, Christopher _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
participants (2)
-
Christopher BROWN
-
Joern Huxhorn