8191131: Nashorn test comparator breaks comparator contract
Reviewed-by: sundar, jlaskey
--- 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;