Permalink
Browse files

Restore deterministic test ordering.

  • Loading branch information...
sl4mmy committed May 21, 2012
1 parent 07de073 commit 24da9244b61f2dce4664a602e73ad060a4f68ce7
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/main/java/org/junit/internal/MethodSorter.java
@@ -14,7 +14,10 @@
public int compare(Method m1, Method m2) {
int i1 = m1.getName().hashCode();
int i2 = m2.getName().hashCode();
- return i1 != i2 ? i1 - i2 : MethodSorter.compare(m1.toString(), m2.toString());
+ if (i1 != i2) {
+ return i1 < i2 ? -1 : 1;
+ }
+ return MethodSorter.compare(m1.toString(), m2.toString());
}
};

0 comments on commit 24da924

Please sign in to comment.