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

[commons-geometry] branch GEOMETRY-54 created (now 6bfaf06)

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

khmarbaise pushed a change to branch GEOMETRY-54
in repository https://gitbox.apache.org/repos/asf/commons-geometry.git.


      at 6bfaf06  [GEOMETRY-54] - Cleanup Checkstyle Reported issues

This branch includes the following new commits:

     new 6bfaf06  [GEOMETRY-54] - Cleanup Checkstyle Reported issues

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[commons-geometry] 01/01: [GEOMETRY-54] - Cleanup Checkstyle Reported issues

Posted by kh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 6bfaf0653730bc8edc701b4e34f24d04adbaa78a
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sat Jun 1 14:44:05 2019 +0200

    [GEOMETRY-54] - Cleanup Checkstyle Reported issues
---
 .../main/java/org/apache/commons/geometry/core/Vector.java   |  8 ++++----
 .../geometry/core/precision/DoublePrecisionContextTest.java  | 12 ++++++------
 .../geometry/euclidean/oned/AffineTransformMatrix1D.java     |  4 ++--
 .../geometry/euclidean/threed/AffineTransformMatrix3D.java   |  4 ++--
 .../geometry/euclidean/twod/AffineTransformMatrix2D.java     |  4 ++--
 5 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/Vector.java b/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/Vector.java
index 873e24e..a55b1b7 100644
--- a/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/Vector.java
+++ b/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/Vector.java
@@ -96,9 +96,9 @@ public interface Vector<V extends Vector<V>> extends Spatial {
     /** Get a normalized vector aligned with the instance. The returned
      * vector has a magnitude of 1.
      * @return a new normalized vector
-     * @exception IllegalNormException if the norm is zero, NaN, or infinite
+     * @throws IllegalNormException if the norm is zero, NaN, or infinite
      */
-    V normalize();
+    V normalize() throws IllegalNormException;
 
     /** Multiply the instance by a scalar.
      * @param a scalar
@@ -131,7 +131,7 @@ public interface Vector<V extends Vector<V>> extends Spatial {
     /** Compute the angular separation between two vectors in radians.
      * @param v other vector
      * @return angular separation between this instance and v in radians
-     * @exception IllegalNormException if either vector has a zero, NaN, or infinite norm
+     * @throws IllegalNormException if either vector has a zero, NaN, or infinite norm
      */
-    double angle(V v);
+    double angle(V v) throws IllegalNormException;
 }
diff --git a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/precision/DoublePrecisionContextTest.java b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/precision/DoublePrecisionContextTest.java
index 80d9f8d..aff6a16 100644
--- a/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/precision/DoublePrecisionContextTest.java
+++ b/commons-geometry-core/src/test/java/org/apache/commons/geometry/core/precision/DoublePrecisionContextTest.java
@@ -108,13 +108,13 @@ public class DoublePrecisionContextTest {
     @Test
     public void testCompare_wrapper() {
         // act/assert
-        Assert.assertEquals(0, ctx.compare(new Double(1), new Double(1)));
-        Assert.assertEquals(-1, ctx.compare(new Double(1), new Double(2)));
-        Assert.assertEquals(1, ctx.compare(new Double(2), new Double(1)));
+        Assert.assertEquals(0, ctx.compare(Double.valueOf(1), Double.valueOf(1)));
+        Assert.assertEquals(-1, ctx.compare(Double.valueOf(1), Double.valueOf(2)));
+        Assert.assertEquals(1, ctx.compare(Double.valueOf(2), Double.valueOf(1)));
 
-        Assert.assertEquals(0, ctx.compare(new Double(-1), new Double(-1)));
-        Assert.assertEquals(1, ctx.compare(new Double(-1), new Double(-2)));
-        Assert.assertEquals(-1, ctx.compare(new Double(-2), new Double(-1)));
+        Assert.assertEquals(0, ctx.compare(Double.valueOf(-1), Double.valueOf(-1)));
+        Assert.assertEquals(1, ctx.compare(Double.valueOf(-1), Double.valueOf(-2)));
+        Assert.assertEquals(-1, ctx.compare(Double.valueOf(-2), Double.valueOf(-1)));
     }
 
     private static class StubContext extends DoublePrecisionContext {
diff --git a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/oned/AffineTransformMatrix1D.java b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/oned/AffineTransformMatrix1D.java
index 1a6aaf9..6056700 100644
--- a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/oned/AffineTransformMatrix1D.java
+++ b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/oned/AffineTransformMatrix1D.java
@@ -201,7 +201,7 @@ public final class AffineTransformMatrix1D implements AffineTransformMatrix<Vect
      * @return inverse transform
      * @throws NonInvertibleTransformException if the transform matrix cannot be inverted
      */
-    public AffineTransformMatrix1D inverse() {
+    public AffineTransformMatrix1D inverse() throws NonInvertibleTransformException {
 
         final double det = this.m00;
 
@@ -356,7 +356,7 @@ public final class AffineTransformMatrix1D implements AffineTransformMatrix<Vect
      * @throws NonInvertibleTransformException if the element is not valid for use
      *  in calculating a matrix inverse, ie if it is NaN or infinite.
      */
-    private static void validateElementForInverse(final double element) {
+    private static void validateElementForInverse(final double element) throws NonInvertibleTransformException {
         if (!Double.isFinite(element)) {
             throw new NonInvertibleTransformException("Transform is not invertible; invalid matrix element: " + element);
         }
diff --git a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/AffineTransformMatrix3D.java b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/AffineTransformMatrix3D.java
index cd25f7b..ad38a5a 100644
--- a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/AffineTransformMatrix3D.java
+++ b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/AffineTransformMatrix3D.java
@@ -316,7 +316,7 @@ public final class AffineTransformMatrix3D implements AffineTransformMatrix<Vect
      * @return inverse transform
      * @throws NonInvertibleTransformException if the transform matrix cannot be inverted
      */
-    public AffineTransformMatrix3D inverse() {
+    public AffineTransformMatrix3D inverse() throws NonInvertibleTransformException {
 
         // Our full matrix is 4x4 but we can significantly reduce the amount of computations
         // needed here since we know that our last row is [0 0 0 1].
@@ -609,7 +609,7 @@ public final class AffineTransformMatrix3D implements AffineTransformMatrix<Vect
      * @throws NonInvertibleTransformException if the element is not valid for use
      *  in calculating a matrix inverse, ie if it is NaN or infinite.
      */
-    private static void validateElementForInverse(final double element) {
+    private static void validateElementForInverse(final double element) throws NonInvertibleTransformException {
         if (!Double.isFinite(element)) {
             throw new NonInvertibleTransformException("Transform is not invertible; invalid matrix element: " + element);
         }
diff --git a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/AffineTransformMatrix2D.java b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/AffineTransformMatrix2D.java
index 2192f43..d5ffbfd 100644
--- a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/AffineTransformMatrix2D.java
+++ b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/AffineTransformMatrix2D.java
@@ -276,7 +276,7 @@ public final class AffineTransformMatrix2D implements AffineTransformMatrix<Vect
      * @return inverse transform
      * @throws NonInvertibleTransformException if the transform matrix cannot be inverted
      */
-    public AffineTransformMatrix2D inverse() {
+    public AffineTransformMatrix2D inverse() throws NonInvertibleTransformException {
 
         // Our full matrix is 3x3 but we can significantly reduce the amount of computations
         // needed here since we know that our last row is [0 0 1].
@@ -559,7 +559,7 @@ public final class AffineTransformMatrix2D implements AffineTransformMatrix<Vect
      * @throws NonInvertibleTransformException if the element is not valid for use
      *  in calculating a matrix inverse, ie if it is NaN or infinite.
      */
-    private static void validateElementForInverse(final double element) {
+    private static void validateElementForInverse(final double element) throws NonInvertibleTransformException {
         if (!Double.isFinite(element)) {
             throw new NonInvertibleTransformException("Transform is not invertible; invalid matrix element: " + element);
         }