commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject [commons-geometry] 08/12: Use "isEmpty()".
Date Thu, 28 Nov 2019 14:12:16 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 4cdadae88b72f5edd4302f452dacacc57ae113d5
Author: Gilles Sadowski <gilles@harfang.homelinux.org>
AuthorDate: Thu Nov 28 14:33:18 2019 +0100

    Use "isEmpty()".
    
    Reported by "sonarcloud.io".
---
 .../commons/geometry/euclidean/threed/enclosing/SphereGenerator.java    | 2 +-
 .../apache/commons/geometry/euclidean/twod/enclosing/DiskGenerator.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/commons-geometry-enclosing/src/main/java/org/apache/commons/geometry/euclidean/threed/enclosing/SphereGenerator.java
b/commons-geometry-enclosing/src/main/java/org/apache/commons/geometry/euclidean/threed/enclosing/SphereGenerator.java
index 29ce8ee..0b28f16 100644
--- a/commons-geometry-enclosing/src/main/java/org/apache/commons/geometry/euclidean/threed/enclosing/SphereGenerator.java
+++ b/commons-geometry-enclosing/src/main/java/org/apache/commons/geometry/euclidean/threed/enclosing/SphereGenerator.java
@@ -40,7 +40,7 @@ public class SphereGenerator implements SupportBallGenerator<Vector3D>
{
     @Override
     public EnclosingBall<Vector3D> ballOnSupport(final List<Vector3D> support)
{
 
-        if (support.size() < 1) {
+        if (support.isEmpty()) {
             return new EnclosingBall<>(Vector3D.ZERO, Double.NEGATIVE_INFINITY);
         } else {
             final Vector3D vA = support.get(0);
diff --git a/commons-geometry-enclosing/src/main/java/org/apache/commons/geometry/euclidean/twod/enclosing/DiskGenerator.java
b/commons-geometry-enclosing/src/main/java/org/apache/commons/geometry/euclidean/twod/enclosing/DiskGenerator.java
index 5af9b99..885e089 100644
--- a/commons-geometry-enclosing/src/main/java/org/apache/commons/geometry/euclidean/twod/enclosing/DiskGenerator.java
+++ b/commons-geometry-enclosing/src/main/java/org/apache/commons/geometry/euclidean/twod/enclosing/DiskGenerator.java
@@ -31,7 +31,7 @@ public class DiskGenerator implements SupportBallGenerator<Vector2D>
{
     @Override
     public EnclosingBall<Vector2D> ballOnSupport(final List<Vector2D> support)
{
 
-        if (support.size() < 1) {
+        if (support.isEmpty()) {
             return new EnclosingBall<>(Vector2D.ZERO, Double.NEGATIVE_INFINITY);
         } else {
             final Vector2D vA = support.get(0);


Mime
View raw message