8191131: Nashorn test comparator breaks comparator contract
authorhannesw
Mon, 13 Nov 2017 18:14:33 +0100
changeset 47736 9f913dffab13
parent 47735 45af799ceb6a
child 47737 acfedb75dd51
child 47833 845872abef55
child 47886 95363d2f2c13
8191131: Nashorn test comparator breaks comparator contract Reviewed-by: sundar, jlaskey
test/nashorn/src/jdk/nashorn/internal/test/framework/TestReorderInterceptor.java
--- a/test/nashorn/src/jdk/nashorn/internal/test/framework/TestReorderInterceptor.java	Mon Nov 13 16:32:30 2017 +0100
+++ b/test/nashorn/src/jdk/nashorn/internal/test/framework/TestReorderInterceptor.java	Mon Nov 13 18:14:33 2017 +0100
@@ -47,6 +47,10 @@
                 final Object o2 = mi2.getInstance();
                 if (o1 instanceof ITest && o2 instanceof ITest) {
                     return ((ITest)o1).getTestName().compareTo(((ITest)o2).getTestName());
+                } else if (o1 instanceof ITest) {
+                    return 1;
+                } else if (o2 instanceof ITest) {
+                    return -1;
                 }
                 // something else, don't care about the order
                 return 0;