scala/scala — pull request #2877 by som-snytt (2013-08-26 13:14:07+00:00)
Title: SI-7781 REPL stack trunc shows cause

The handy stack trace truncation in REPL doesn't show cause like a regular trace.

This commit fixes that and also adds the usual indicator for truncation, viz, "... 33 more".

The example from the ticket produces:

```
scala> rewrapperer
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: Point of failure
at .rewrapper(:9)
at .rewrapperer(:10)
... 32 elided
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Point of failure
at .wrapper(:8)
... 34 more
Caused by: java.lang.RuntimeException: Point of failure
at .sample(:7)
... 35 more
```

Suppressed exceptions on Java 7 are handled reflectively.

```
java.lang.RuntimeException: My problem
at scala.tools.nsc.util.StackTraceTest.repressed(StackTraceTest.scala:56)
... 27 elided
Suppressed: java.lang.RuntimeException: Point of failure
at scala.tools.nsc.util.StackTraceTest.sample(StackTraceTest.scala:29)
at scala.tools.nsc.util.StackTraceTest.repressed(StackTraceTest.scala:54)
... 27 more
```

Review by @qerub