commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject [commons-geometry] 05/12: Anonymous inner class replaced with lambda.
Date Thu, 28 Nov 2019 14:12:13 GMT
This is an automated email from the ASF dual-hosted git repository.

erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-geometry.git

commit 110c707464379e55bb5d9f48d955a980bf727228
Author: Gilles Sadowski <gilles@harfang.homelinux.org>
AuthorDate: Thu Nov 28 14:08:47 2019 +0100

    Anonymous inner class replaced with lambda.
    
    Reported by "sonarcloud.io".
---
 .../commons/geometry/euclidean/twod/hull/MonotoneChain.java       | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/commons-geometry-hull/src/main/java/org/apache/commons/geometry/euclidean/twod/hull/MonotoneChain.java
b/commons-geometry-hull/src/main/java/org/apache/commons/geometry/euclidean/twod/hull/MonotoneChain.java
index 9a45066..2a50090 100644
--- a/commons-geometry-hull/src/main/java/org/apache/commons/geometry/euclidean/twod/hull/MonotoneChain.java
+++ b/commons-geometry-hull/src/main/java/org/apache/commons/geometry/euclidean/twod/hull/MonotoneChain.java
@@ -78,10 +78,7 @@ public class MonotoneChain extends AbstractConvexHullGenerator2D {
         final List<Vector2D> pointsSortedByXAxis = new ArrayList<>(points);
 
         // sort the points in increasing order on the x-axis
-        Collections.sort(pointsSortedByXAxis, new Comparator<Vector2D>() {
-            /** {@inheritDoc} */
-            @Override
-            public int compare(final Vector2D o1, final Vector2D o2) {
+        Collections.sort(pointsSortedByXAxis, (o1, o2) -> {
                 final DoublePrecisionContext precision = getPrecision();
                 // need to take the tolerance value into account, otherwise collinear points
                 // will not be handled correctly when building the upper/lower hull
@@ -91,8 +88,7 @@ public class MonotoneChain extends AbstractConvexHullGenerator2D {
                 } else {
                     return diff;
                 }
-            }
-        });
+            });
 
         // build lower hull
         final List<Vector2D> lowerHull = new ArrayList<>();


Mime
View raw message