This is an automated email from the ASF dual-hosted git repository. aherbert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-geometry.git
commit d676fbb4a954381dabb24244f8bca467f9ff95d7 Author: Alex Herbert <aherb...@apache.org> AuthorDate: Tue Sep 23 17:23:37 2025 +0100 pmd fix: remove unnecessary scope qualifier --- .../geometry/spherical/oned/AngularInterval.java | 18 +++++++++--------- .../commons/geometry/spherical/oned/Point1S.java | 8 ++++---- .../geometry/spherical/oned/RegionBSPTree1S.java | 8 ++++---- .../commons/geometry/spherical/twod/GreatCircles.java | 2 +- .../commons/geometry/spherical/twod/Point2S.java | 2 +- .../geometry/spherical/twod/RegionBSPTree2S.java | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/oned/AngularInterval.java b/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/oned/AngularInterval.java index a6eabfc3..0382d89a 100644 --- a/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/oned/AngularInterval.java +++ b/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/oned/AngularInterval.java @@ -219,7 +219,7 @@ public class AngularInterval implements HyperplaneBoundedRegion<Point1S> { * @return a new instance transformed by the argument */ public AngularInterval transform(final Transform<Point1S> transform) { - return AngularInterval.transform(this, transform, AngularInterval::of); + return transform(this, transform, AngularInterval::of); } /** {@inheritDoc} @@ -503,8 +503,8 @@ public class AngularInterval implements HyperplaneBoundedRegion<Point1S> { splitter.getPrecision()); if (isFull()) { - final Convex minus = Convex.of(splitter, opposite); - final Convex plus = Convex.of(splitter.reverse(), opposite.reverse()); + final Convex minus = of(splitter, opposite); + final Convex plus = of(splitter.reverse(), opposite.reverse()); return new Split<>(minus, plus); } @@ -537,12 +537,12 @@ public class AngularInterval implements HyperplaneBoundedRegion<Point1S> { final CutAngle posCut = positiveFacingSplit ? opposite.reverse() : opposite; - pos = Convex.of(minBoundary, posCut); + pos = of(minBoundary, posCut); final CutAngle negCut = positiveFacingSplit ? opposite : opposite.reverse(); - neg = Convex.of(negCut, maxBoundary); + neg = of(negCut, maxBoundary); } } else if (minLoc < 0) { // min is on the neg side @@ -555,12 +555,12 @@ public class AngularInterval implements HyperplaneBoundedRegion<Point1S> { final CutAngle posCut = positiveFacingSplit ? splitter.reverse() : splitter; - pos = Convex.of(maxBoundary, posCut); + pos = of(maxBoundary, posCut); final CutAngle negCut = positiveFacingSplit ? splitter : splitter.reverse(); - neg = Convex.of(negCut, minBoundary); + neg = of(negCut, minBoundary); } } else { // min is directly on the splitter; determine whether it was on the main split @@ -610,7 +610,7 @@ public class AngularInterval implements HyperplaneBoundedRegion<Point1S> { * interval is not convex (meaning it has a size of greater than {@code pi}) */ public static Convex of(final Point1S min, final Point1S max, final Precision.DoubleEquivalence precision) { - return createInterval(min, max, precision, Convex::new, Convex.FULL); + return createInterval(min, max, precision, Convex::new, FULL); } /** Return an instance representing the convex angular interval between the given oriented points. @@ -624,7 +624,7 @@ public class AngularInterval implements HyperplaneBoundedRegion<Point1S> { * interval is not convex (meaning it has a size of greater than {@code pi}) */ public static Convex of(final CutAngle a, final CutAngle b) { - return createInterval(a, b, Convex::new, Convex.FULL); + return createInterval(a, b, Convex::new, FULL); } } } diff --git a/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/oned/Point1S.java b/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/oned/Point1S.java index dc0c9c44..93ab9651 100644 --- a/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/oned/Point1S.java +++ b/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/oned/Point1S.java @@ -40,13 +40,13 @@ import org.apache.commons.numbers.core.Precision; public final class Point1S implements Point<Point1S> { /** A point with coordinates set to {@code 0*pi}. */ - public static final Point1S ZERO = Point1S.of(0.0); + public static final Point1S ZERO = of(0.0); /** A point with coordinates set to {@code pi}. */ - public static final Point1S PI = Point1S.of(Math.PI); + public static final Point1S PI = of(Math.PI); /** A point with all coordinates set to NaN. */ - public static final Point1S NaN = Point1S.of(Double.NaN); + public static final Point1S NaN = of(Double.NaN); /** Comparator that sorts points by normalized azimuth in ascending order. * Points are only considered equal if their normalized azimuths match exactly. @@ -194,7 +194,7 @@ public final class Point1S implements Point<Point1S> { az -= Angle.TWO_PI; } - return Point1S.of(az); + return of(az); } /** Return true if this instance is equivalent to the argument. The points are diff --git a/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/oned/RegionBSPTree1S.java b/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/oned/RegionBSPTree1S.java index 1c7ef634..37c71c25 100644 --- a/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/oned/RegionBSPTree1S.java +++ b/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/oned/RegionBSPTree1S.java @@ -60,7 +60,7 @@ public class RegionBSPTree1S extends AbstractRegionBSPTree<Point1S, RegionBSPTre * @see #copy(org.apache.commons.geometry.core.partitioning.bsp.BSPTree) */ public RegionBSPTree1S copy() { - final RegionBSPTree1S result = RegionBSPTree1S.empty(); + final RegionBSPTree1S result = empty(); result.copy(this); return result; @@ -138,7 +138,7 @@ public class RegionBSPTree1S extends AbstractRegionBSPTree<Point1S, RegionBSPTre } } - return split(splitter, RegionBSPTree1S.empty(), RegionBSPTree1S.empty()); + return split(splitter, empty(), empty()); } /** Split the instance along a circle diameter.The diameter is defined by the given @@ -164,8 +164,8 @@ public class RegionBSPTree1S extends AbstractRegionBSPTree<Point1S, RegionBSPTre final Split<RegionBSPTree1S> firstSplit = split(splitter); final Split<RegionBSPTree1S> secondSplit = split(opposite); - RegionBSPTree1S minus = RegionBSPTree1S.empty(); - RegionBSPTree1S plus = RegionBSPTree1S.empty(); + RegionBSPTree1S minus = empty(); + RegionBSPTree1S plus = empty(); if (zeroOnPlusSide) { // zero wrap-around needs to be handled on the plus side of the split diff --git a/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/GreatCircles.java b/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/GreatCircles.java index c34983f3..7933541d 100644 --- a/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/GreatCircles.java +++ b/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/GreatCircles.java @@ -108,7 +108,7 @@ public final class GreatCircles { */ public static GreatArc arcFromPoints(final Point2S start, final Point2S end, final Precision.DoubleEquivalence precision) { - final GreatCircle circle = GreatCircles.fromPoints(start, end, precision); + final GreatCircle circle = fromPoints(start, end, precision); final Point1S subspaceStart = circle.toSubspace(start); final Point1S subspaceEnd = circle.toSubspace(end); diff --git a/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/Point2S.java b/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/Point2S.java index 9b6454c9..89027c45 100644 --- a/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/Point2S.java +++ b/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/Point2S.java @@ -175,7 +175,7 @@ public final class Point2S implements Point<Point2S> { final QuaternionRotation quat = start.slerp(end).apply(t); - return Point2S.from(quat.apply(getVector())); + return from(quat.apply(getVector())); } /** Return true if this point should be considered equivalent to the argument using the diff --git a/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/RegionBSPTree2S.java b/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/RegionBSPTree2S.java index 0817c7f6..15c8cf01 100644 --- a/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/RegionBSPTree2S.java +++ b/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/RegionBSPTree2S.java @@ -60,7 +60,7 @@ public class RegionBSPTree2S extends AbstractRegionBSPTree<Point2S, RegionBSPTre * @see #copy(org.apache.commons.geometry.core.partitioning.bsp.BSPTree) */ public RegionBSPTree2S copy() { - final RegionBSPTree2S result = RegionBSPTree2S.empty(); + final RegionBSPTree2S result = empty(); result.copy(this); return result;