changeset 1420:3674a478c090

7901955: Replace <Numeric>.compareTo with <Numeric>.compare Contributed-by: Christoph Dreis <christoph.dreis@freenet.de>
author shade
date Sun, 23 Apr 2017 22:19:07 +0200
parents 5c8f74626ab2
children 2e4ec571fd74
files jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractPerfAsmProfiler.java jmh-core/src/main/java/org/openjdk/jmh/profile/StackProfiler.java jmh-core/src/main/java/org/openjdk/jmh/runner/WorkloadParams.java jmh-core/src/main/java/org/openjdk/jmh/util/Multisets.java jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_25_API_GA.java
diffstat 5 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractPerfAsmProfiler.java	Mon Apr 17 13:02:02 2017 +0200
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/AbstractPerfAsmProfiler.java	Sun Apr 23 22:19:07 2017 +0200
@@ -389,8 +389,8 @@
         Collections.sort(regions, new Comparator<Region>() {
             @Override
             public int compare(Region o1, Region o2) {
-                return Long.valueOf(o2.getEventCount(events, mainEvent)).
-                    compareTo(o1.getEventCount(events, mainEvent));
+                return Long.compare(o2.getEventCount(events, mainEvent),
+                                    o1.getEventCount(events, mainEvent));
             }
         });
 
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/StackProfiler.java	Mon Apr 17 13:02:02 2017 +0200
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/StackProfiler.java	Sun Apr 23 22:19:07 2017 +0200
@@ -288,7 +288,7 @@
 
                 @Override
                 public int compare(Thread.State s1, Thread.State s2) {
-                    return Long.valueOf(stateSize(s2)).compareTo(stateSize(s1));
+                    return Long.compare(stateSize(s2), stateSize(s1));
                 }
 
             });
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/WorkloadParams.java	Mon Apr 17 13:02:02 2017 +0200
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/WorkloadParams.java	Sun Apr 23 22:19:07 2017 +0200
@@ -123,7 +123,7 @@
 
         @Override
         public int compareTo(Value o) {
-            return Integer.valueOf(order).compareTo(o.order);
+            return Integer.compare(order, o.order);
         }
 
         @Override
--- a/jmh-core/src/main/java/org/openjdk/jmh/util/Multisets.java	Mon Apr 17 13:02:02 2017 +0200
+++ b/jmh-core/src/main/java/org/openjdk/jmh/util/Multisets.java	Sun Apr 23 22:19:07 2017 +0200
@@ -58,7 +58,7 @@
         Collections.sort(sorted, new Comparator<T>() {
             @Override
             public int compare(T o1, T o2) {
-                return Long.valueOf(set.count(o2)).compareTo(set.count(o1));
+                return Long.compare(set.count(o2), set.count(o1));
             }
         });
         return sorted;
--- a/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_25_API_GA.java	Mon Apr 17 13:02:02 2017 +0200
+++ b/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_25_API_GA.java	Sun Apr 23 22:19:07 2017 +0200
@@ -253,7 +253,7 @@
         @Override
         public int compareTo(Chromosome o) {
             // Order by score, descending.
-            return -Double.valueOf(score()).compareTo(o.score());
+            return -Double.compare(score(), o.score());
         }
 
         @Override