Skip to content

Commit f6fb820

Browse files
committed
Revert "Fix scala-js#3154: Avoid calling AssertionError(String, Throwable)."
This reverts commit 9428b68. That commit was avoiding a constructor not available on JDK6. Now that we only build on JDK8+, we can use the `(String, Throwable)` constructor, which is cleaner.
1 parent a4bb751 commit f6fb820

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

junit-runtime/src/main/scala/org/junit/internal/ArrayComparisonFailure.scala

+2-8
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,8 @@ package org.junit.internal
55

66
object ArrayComparisonFailure
77

8-
/* Attention: AssertionError does not have a (String, Throwable) constructor
9-
* in JDK 6. If we try to call that one, compilation *succeeds* because of
10-
* auto-boxing, but it does not do the right thing. See #3154.
11-
*/
128
class ArrayComparisonFailure(message: String, cause: AssertionError, index: Int)
13-
extends AssertionError(message) {
14-
15-
initCause(cause)
9+
extends AssertionError(message, cause) {
1610

1711
private var fIndices: List[Int] = index :: Nil
1812

@@ -29,7 +23,7 @@ class ArrayComparisonFailure(message: String, cause: AssertionError, index: Int)
2923
val indices =
3024
if (fIndices == null) s"[$index]" // see #3148
3125
else fIndices.map(index => s"[$index]").mkString
32-
val causeMessage = cause.getMessage // do not use getCause(), see #3148
26+
val causeMessage = getCause.getMessage
3327
s"${msg}arrays first differed at element $indices; $causeMessage"
3428
}
3529

0 commit comments

Comments
 (0)