You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ma...@apache.org on 2021/01/16 12:28:06 UTC

[commons-geometry] branch master updated: Minor Improvement:

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new e15bd7b  Minor Improvement:
     new 4a959bd  Merge pull request #129 from arturobernalg/feature/minor_improvement
e15bd7b is described below

commit e15bd7b1d4e9c5162bb22840ac42d64098c04041
Author: Arturo Bernal <ar...@gmail.com>
AuthorDate: Fri Jan 15 08:32:23 2021 +0100

    Minor Improvement:
    
    * Redundant Field Initializer
---
 .../java/org/apache/commons/geometry/euclidean/threed/Planes.java     | 2 +-
 .../commons/geometry/euclidean/threed/mesh/SimpleTriangleMesh.java    | 4 ++--
 .../org/apache/commons/geometry/euclidean/twod/path/LinePath.java     | 4 ++--
 .../geometry/hull/euclidean/twod/AbstractConvexHullGenerator2D.java   | 2 +-
 .../java/org/apache/commons/geometry/spherical/twod/GreatArcPath.java | 4 ++--
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/Planes.java b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/Planes.java
index 9e265aa..21d69e7 100644
--- a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/Planes.java
+++ b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/Planes.java
@@ -637,7 +637,7 @@ public final class Planes {
         private double crossSumZ;
 
         /** If true, an exception will be thrown if the point sequence is discovered to be non-convex. */
-        private boolean requireConvex = false;
+        private boolean requireConvex;
 
         /** List that unique vertices discovered in the input sequence will be added to. */
         private List<? super Vector3D> uniqueVertexOutput;
diff --git a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/mesh/SimpleTriangleMesh.java b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/mesh/SimpleTriangleMesh.java
index 3c5b41d..1e70dec 100644
--- a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/mesh/SimpleTriangleMesh.java
+++ b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/mesh/SimpleTriangleMesh.java
@@ -376,7 +376,7 @@ public final class SimpleTriangleMesh implements TriangleMesh {
     private final class FaceIterator<T> implements Iterator<T> {
 
         /** The current index of the iterator. */
-        private int index = 0;
+        private int index;
 
         /** Function to apply to each face in the mesh. */
         private final Function<? super TriangleMesh.Face, T> fn;
@@ -428,7 +428,7 @@ public final class SimpleTriangleMesh implements TriangleMesh {
         private final DoublePrecisionContext precision;
 
         /** Flag set to true once a mesh is constructed from this builder. */
-        private boolean built = false;
+        private boolean built;
 
         /** Construct a new builder.
          * @param precision precision context used for floating point comparisons; may
diff --git a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/path/LinePath.java b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/path/LinePath.java
index 25a0272..71124eb 100644
--- a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/path/LinePath.java
+++ b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/path/LinePath.java
@@ -458,10 +458,10 @@ public class LinePath implements BoundarySource2D, Sized {
      */
     public static final class Builder {
         /** Line subsets appended to the path. */
-        private List<LineConvexSubset> appended = null;
+        private List<LineConvexSubset> appended;
 
         /** Line subsets prepended to the path. */
-        private List<LineConvexSubset> prepended = null;
+        private List<LineConvexSubset> prepended;
 
         /** Precision context used when creating line segments directly from vertices. */
         private DoublePrecisionContext precision;
diff --git a/commons-geometry-hull/src/main/java/org/apache/commons/geometry/hull/euclidean/twod/AbstractConvexHullGenerator2D.java b/commons-geometry-hull/src/main/java/org/apache/commons/geometry/hull/euclidean/twod/AbstractConvexHullGenerator2D.java
index fd5abd3..be9fa95 100644
--- a/commons-geometry-hull/src/main/java/org/apache/commons/geometry/hull/euclidean/twod/AbstractConvexHullGenerator2D.java
+++ b/commons-geometry-hull/src/main/java/org/apache/commons/geometry/hull/euclidean/twod/AbstractConvexHullGenerator2D.java
@@ -68,7 +68,7 @@ abstract class AbstractConvexHullGenerator2D implements ConvexHullGenerator2D {
     /** {@inheritDoc} */
     @Override
     public ConvexHull2D generate(final Collection<Vector2D> points) {
-        Collection<Vector2D> hullVertices = null;
+        Collection<Vector2D> hullVertices;
         if (points.size() < 2) {
             hullVertices = points;
         } else {
diff --git a/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/GreatArcPath.java b/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/GreatArcPath.java
index 87631ac..cff1995 100644
--- a/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/GreatArcPath.java
+++ b/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/GreatArcPath.java
@@ -283,10 +283,10 @@ public final class GreatArcPath implements BoundarySource2S {
      */
     public static final class Builder {
         /** Arcs appended to the path. */
-        private List<GreatArc> appendedArcs = null;
+        private List<GreatArc> appendedArcs;
 
         /** Arcs prepended to the path. */
-        private List<GreatArc> prependedArcs = null;
+        private List<GreatArc> prependedArcs;
 
         /** Precision context used when creating arcs directly from points. */
         private DoublePrecisionContext precision;