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 443a0a3a67fce2255223952ddc5a55d54096b0f8 Author: Matt Juntunen <[email protected]> AuthorDate: Sun Sep 2 23:44:36 2018 -0400 fixing report errors --- .../geometry/core/MultiDimensionalVector.java | 4 +-- .../geometry/core/internal/SimpleTupleFormat.java | 36 +++++++++++----------- .../apache/commons/geometry/core/util/Vectors.java | 12 ++++---- .../geometry/euclidean/EuclideanVector.java | 2 +- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/MultiDimensionalVector.java b/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/MultiDimensionalVector.java index a8eb74e..cf21b56 100644 --- a/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/MultiDimensionalVector.java +++ b/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/MultiDimensionalVector.java @@ -29,7 +29,7 @@ public interface MultiDimensionalVector<V extends MultiDimensionalVector<V>> ext * <code> * <strong>v</strong> = <strong>v<sub>projection</sub></strong> + <strong>v<sub>rejection</sub></strong> * </code> - * @param base + * @param base base vector * @return the vector projection of the instance onto {@code base} * @exception IllegalStateException if the norm of the base vector is zero * @see #reject(MultiDimensionalVector) @@ -44,7 +44,7 @@ public interface MultiDimensionalVector<V extends MultiDimensionalVector<V>> ext * <code> * <strong>v</strong> = <strong>v<sub>projection</sub></strong> + <strong>v<sub>rejection</sub></strong> * </code> - * @param base + * @param base base vector * @return the vector rejection of the instance from {@code base} * @exception IllegalStateException if the norm of the base vector is zero * @see #project(MultiDimensionalVector) diff --git a/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/internal/SimpleTupleFormat.java b/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/internal/SimpleTupleFormat.java index 041380f..4cca8cc 100644 --- a/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/internal/SimpleTupleFormat.java +++ b/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/internal/SimpleTupleFormat.java @@ -93,7 +93,7 @@ public class SimpleTupleFormat { * @return 1-tuple string */ public String format(double a) { - StringBuilder sb = new StringBuilder(); + final StringBuilder sb = new StringBuilder(); if (prefix != null) { sb.append(prefix); @@ -114,16 +114,16 @@ public class SimpleTupleFormat { * @return 2-tuple string */ public String format(double a1, double a2) { - StringBuilder sb = new StringBuilder(); + final StringBuilder sb = new StringBuilder(); if (prefix != null) { sb.append(prefix); } - sb.append(a1); - sb.append(separator); - sb.append(SPACE); - sb.append(a2); + sb.append(a1) + .append(separator) + .append(SPACE) + .append(a2); if (suffix != null) { sb.append(suffix); @@ -139,19 +139,19 @@ public class SimpleTupleFormat { * @return 3-tuple string */ public String format(double a1, double a2, double a3) { - StringBuilder sb = new StringBuilder(); + final StringBuilder sb = new StringBuilder(); if (prefix != null) { sb.append(prefix); } - sb.append(a1); - sb.append(separator); - sb.append(SPACE); - sb.append(a2); - sb.append(separator); - sb.append(SPACE); - sb.append(a3); + sb.append(a1) + .append(separator) + .append(SPACE) + .append(a2) + .append(separator) + .append(SPACE) + .append(a3); if (suffix != null) { sb.append(suffix); @@ -208,7 +208,7 @@ public class SimpleTupleFormat { * @throws IllegalArgumentException if the input string format is invalid */ public <T> T parse(String str, DoubleFunction3N<T> fn) throws IllegalArgumentException { - ParsePosition pos = new ParsePosition(0); + final ParsePosition pos = new ParsePosition(0); readPrefix(str, pos); final double v1 = readTupleValue(str, pos); @@ -257,9 +257,9 @@ public class SimpleTupleFormat { } } - String substr = str.substring(startIdx, endIdx); + final String substr = str.substring(startIdx, endIdx); try { - double value = Double.parseDouble(substr); + final double value = Double.parseDouble(substr); // advance the position and move past any terminating separator pos.setIndex(endIdx); @@ -388,7 +388,7 @@ public class SimpleTupleFormat { * @throws IllegalArgumentException the exception signaling a parse failure */ private void fail(String msg, String str, ParsePosition pos, Throwable cause) throws IllegalArgumentException { - String fullMsg = String.format("Failed to parse string \"%s\" at index %d: %s", str, pos.getIndex(), msg); + final String fullMsg = String.format("Failed to parse string \"%s\" at index %d: %s", str, pos.getIndex(), msg); throw new TupleParseException(fullMsg, cause); } diff --git a/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/util/Vectors.java b/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/util/Vectors.java index f066364..4cd24b2 100644 --- a/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/util/Vectors.java +++ b/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/util/Vectors.java @@ -20,6 +20,9 @@ package org.apache.commons.geometry.core.util; */ public final class Vectors { + /** Private constructor. */ + private Vectors() {} + /** Get the L<sub>1</sub> norm for the vector with the given components. * This is defined as the sum of the absolute values of all vector components. * @param x vector component @@ -33,7 +36,7 @@ public final class Vectors { /** Get the L<sub>1</sub> norm for the vector with the given components. * This is defined as the sum of the absolute values of all vector components. * @param x1 first vector component - * @param x2 second vector compoent + * @param x2 second vector component * @return L<sub>1</sub> norm for the vector with the given components * @see <a href="http://mathworld.wolfram.com/L1-Norm.html">L1 Norm</a> */ @@ -44,8 +47,8 @@ public final class Vectors { /** Get the L<sub>1</sub> norm for the vector with the given components. * This is defined as the sum of the absolute values of all vector components. * @param x1 first vector component - * @param x2 second vector compoent - * @param x2 third vector component + * @param x2 second vector component + * @param x3 third vector component * @return L<sub>1</sub> norm for the vector with the given components * @see <a href="http://mathworld.wolfram.com/L1-Norm.html">L1 Norm</a> */ @@ -157,7 +160,4 @@ public final class Vectors { public static double normInf(final double x1, final double x2, final double x3) { return Math.max(Math.max(Math.abs(x1), Math.abs(x2)), Math.abs(x3)); } - - /** Private constructor. */ - private Vectors() {} } diff --git a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/EuclideanVector.java b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/EuclideanVector.java index 923df74..8df3a91 100644 --- a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/EuclideanVector.java +++ b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/EuclideanVector.java @@ -41,5 +41,5 @@ public interface EuclideanVector<P extends EuclideanPoint<P, V>, V extends Eucli * @param t interpolation parameter * @return interpolated vector */ - V lerp(V p, double t); + V lerp(V v, double t); }
