[jboss-jira] [JBoss JIRA] (LOGMGR-146) Suppressed exception format is not correct

James Perkins (JIRA) issues at jboss.org
Thu Feb 16 18:20:00 EST 2017


     [ https://issues.jboss.org/browse/LOGMGR-146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Perkins reassigned LOGMGR-146:
------------------------------------

      Assignee: James Perkins
    Resolution: Done


> Suppressed exception format is not correct
> ------------------------------------------
>
>                 Key: LOGMGR-146
>                 URL: https://issues.jboss.org/browse/LOGMGR-146
>             Project: JBoss Log Manager
>          Issue Type: Bug
>            Reporter: James Perkins
>            Assignee: James Perkins
>             Fix For: 2.0.5.Final, 2.1.0.Beta1
>
>
> The suppressed exception format is not correct when multiple exceptions are suppressed. Too many causes are printed likely because the circular dependencies are not working correctly.
> {code:java|title=Example Reproducer}
> final RuntimeException r1 = new RuntimeException("Exception 1");
> final RuntimeException r2 = new RuntimeException("Exception 2", r1);
> final RuntimeException r3 = new RuntimeException("Exception 3", r2);
> final RuntimeException cause = new RuntimeException("This is the cause", r1);
> cause.addSuppressed(r2);
> cause.addSuppressed(r3);
> Logger.getLogger(Main.class).error("Log message", cause);
> {code}
> {code:title=Output from JBoss Log Manager}
> 13:03:53,684 ERROR [com.jamezp.test.Main] Log message: java.lang.RuntimeException: This is the cause
> 	at com.jamezp.test.Main.main(Main.java:165)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:498)
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
> 	Suppressed: java.lang.RuntimeException: Exception 2
> 		at com.jamezp.test.Main.main(Main.java:162)
> 		... 5 more
> 	Caused by: java.lang.RuntimeException: Exception 1
> 		at com.jamezp.test.Main.main(Main.java:161)
> 		... 5 more
> 	Suppressed: java.lang.RuntimeException: Exception 3
> 		at com.jamezp.test.Main.main(Main.java:163)
> 		... 5 more
> 	Caused by: java.lang.RuntimeException: Exception 2
> 		at com.jamezp.test.Main.main(Main.java:162)
> 		... 5 more
> 	Caused by: java.lang.RuntimeException: Exception 1
> 		at com.jamezp.test.Main.main(Main.java:161)
> 		... 5 more
> Caused by: java.lang.RuntimeException: Exception 1
> 	at com.jamezp.test.Main.main(Main.java:161)
> 	... 5 more
> {code}
> {code:title=Output from Throwable.printStackTrace()}
> java.lang.RuntimeException: This is the cause
> 	at com.jamezp.test.Main.main(Main.java:165)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:498)
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
> 	Suppressed: java.lang.RuntimeException: Exception 2
> 		at com.jamezp.test.Main.main(Main.java:162)
> 		... 5 more
> 	Caused by: java.lang.RuntimeException: Exception 1
> 		at com.jamezp.test.Main.main(Main.java:161)
> 		... 5 more
> 	Suppressed: java.lang.RuntimeException: Exception 3
> 		at com.jamezp.test.Main.main(Main.java:163)
> 		... 5 more
> 	[CIRCULAR REFERENCE:java.lang.RuntimeException: Exception 2]
> 	[CIRCULAR REFERENCE:java.lang.RuntimeException: Exception 1]
> {code}
> {code:title=Output from JUL}
> Jan 26, 2017 1:06:29 PM com.jamezp.test.Main main
> ERROR: Log message
> java.lang.RuntimeException: This is the cause
> 	at com.jamezp.test.Main.main(Main.java:165)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:498)
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
> 	Suppressed: java.lang.RuntimeException: Exception 2
> 		at com.jamezp.test.Main.main(Main.java:162)
> 		... 5 more
> 	Caused by: java.lang.RuntimeException: Exception 1
> 		at com.jamezp.test.Main.main(Main.java:161)
> 		... 5 more
> 	Suppressed: java.lang.RuntimeException: Exception 3
> 		at com.jamezp.test.Main.main(Main.java:163)
> 		... 5 more
> 	[CIRCULAR REFERENCE:java.lang.RuntimeException: Exception 2]
> 	[CIRCULAR REFERENCE:java.lang.RuntimeException: Exception 1]
> {code}



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list