[logback-user] Java 7 automatic resource management and suppressed exceptions

Christopher BROWN brown at reflexe.fr
Fri Jun 10 22:39:53 CEST 2011


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


More information about the Logback-user mailing list