changeset 47812:9f913dffab13

8191131: Nashorn test comparator breaks comparator contract Reviewed-by: sundar, jlaskey
author hannesw
date Mon, 13 Nov 2017 18:14:33 +0100
parents 45af799ceb6a
children 95363d2f2c13 acfedb75dd51 845872abef55
files test/nashorn/src/jdk/nashorn/internal/test/framework/TestReorderInterceptor.java
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;