Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for Throwable.getSuppressed(). #16

Merged
merged 2 commits into from
Nov 4, 2011
Merged

Conversation

huxi
Copy link
Member

@huxi huxi commented Jun 12, 2011

See http://www.oracle.com/technetwork/articles/java/trywithresources-401775.html

  • Removed superfluous public from methods in IThrowableProxy interface and added method IThrowableProxy[] getSuppressed().
  • Serialized ThrowableProxyVO will be incompatible since suppressed has been added. Consequently, the respective serialVersionUID has been changed.
  • ThrowableProxyVO.equals is now also checking suppressed.
  • ThrowableProxy is now evaluating suppressed Throwables of its c'tor argument if the Throwable class has a getSuppressed() method, i.e. in case of Java SE 7 and upwards.

This patch is merely adding support of suppressed exceptions to the creation of LoggingEvent/IThrowableProxy. Further support should be added to the following classes:

  • ch.qos.logback.classic.db.DBAppender
  • ch.qos.logback.classic.html.DefaultThrowableRenderer
  • ch.qos.logback.classic.net.SyslogAppender
  • ch.qos.logback.classic.pattern.ThrowableProxyConverter
  • ch.qos.logback.classic.spi.ThrowableProxyUtil
    • method asString
  • ch.qos.logback.classic.spi.PackagingDataCalculator
    • method calculate(IThrowableProxy tp) may also need to take suppressed into account.

huxi added 2 commits June 12, 2011 16:22
See http://www.oracle.com/technetwork/articles/java/trywithresources-401775.html

- Removed superfluous public from methods in IThrowableProxy interface and added method IThrowableProxy[] getSuppressed().
- Serialized ThrowableProxyVO will be incompatible since suppressed has been added. Consequently, the respective serialVersionUID has been changed.
- ThrowableProxyVO.equals is now also checking suppressed.
- ThrowableProxy is now evaluating suppressed Throwables of its c'tor argument if the Throwable class has a getSuppressed() method, i.e. in case of Java SE 7 and upwards.

This patch is merely adding support of suppressed exceptions to the creation of LoggingEvent/IThrowableProxy. Further support should be added to the following classes:

- ch.qos.logback.classic.db.DBAppender
- ch.qos.logback.classic.html.DefaultThrowableRenderer
- ch.qos.logback.classic.net.SyslogAppender
- ch.qos.logback.classic.pattern.ThrowableProxyConverter
- ch.qos.logback.classic.spi.ThrowableProxyUtil
  - method asString
- ch.qos.logback.classic.spi.PackagingDataCalculator
  - method calculate(IThrowableProxy tp) may also need to take suppressed into account.
calculate(IThrowableProxy), as expected, needs to support suppressed Throwables, too.

All of this has been tested with Java 7 b145 and is working as expected.
@huxi
Copy link
Member Author

huxi commented Jun 13, 2011

I tested this on Java 7 b145 and everything works as expected.

huxi added a commit that referenced this pull request Nov 4, 2011
Adding support for Throwable.getSuppressed().
@huxi huxi merged commit ccadbcf into qos-ch:master Nov 4, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant