mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 20:42:21 +00:00
Handle circular references.
This commit is contained in:
1 parent
187731fd88
commit
7f4ce02e42
2 files changed
+26
-4
No files matched your search
@@ -501,6 +501,22 @@ public class FunctionsTest {
|
||||
s.println("Some custom exception");
|
||||
}
|
||||
}, "Some custom exception\n", "Some custom exception\n");
|
||||
// Circular references:
|
||||
Stack stack1 = new Stack("p.Exc1", "p.C.method1:17");
|
||||
Stack stack2 = new Stack("p.Exc2", "p.C.method2:27");
|
||||
stack1.cause(stack2);
|
||||
stack2.cause(stack1);
|
||||
assertPrintThrowable(stack1,
|
||||
"p.Exc1\n" +
|
||||
"\tat p.C.method1(C.java:17)\n" +
|
||||
"Caused by: p.Exc2\n" +
|
||||
"\tat p.C.method2(C.java:27)\n" +
|
||||
"\t[CIRCULAR REFERENCE:p.Exc1]\n",
|
||||
"<cycle to p.Exc1>\n" +
|
||||
"Caused: p.Exc2\n" +
|
||||
"\tat p.C.method2(C.java:27)\n" +
|
||||
"Caused: p.Exc1\n" +
|
||||
"\tat p.C.method1(C.java:17)\n");
|
||||
}
|
||||
private static void assertPrintThrowable(Throwable t, String traditional, String custom) {
|
||||
StringWriter sw = new StringWriter();
|
||||
|
||||
Reference in new issue
Block a user