Use "diamond" operator.
Reported by "sonarcloud.io".
diff --git a/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractRegionBSPTree.java b/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractRegionBSPTree.java
index 9a867a8..5bce738 100644
--- a/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractRegionBSPTree.java
+++ b/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/partitioning/bsp/AbstractRegionBSPTree.java
@@ -242,7 +242,7 @@
splitPlus = plus.isEmpty() ? null : plus;
}
- return new Split<T>(splitMinus, splitPlus);
+ return new Split<>(splitMinus, splitPlus);
}
/** Get the size-related properties for the region. The value is computed
@@ -498,7 +498,7 @@
}
}
- return new RegionCutBoundary<P>(insideFacing.build(), outsideFacing.build());
+ return new RegionCutBoundary<>(insideFacing.build(), outsideFacing.build());
}
/** Recursive method to characterize a convex subhyperplane with respect to the region's
diff --git a/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/partitioning/bsp/AttributeBSPTree.java b/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/partitioning/bsp/AttributeBSPTree.java
index d7fecd6..065f08f 100644
--- a/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/partitioning/bsp/AttributeBSPTree.java
+++ b/commons-geometry-core/src/main/java/org/apache/commons/geometry/core/partitioning/bsp/AttributeBSPTree.java
@@ -52,7 +52,7 @@
/** {@inheritDoc} */
@Override
protected AttributeNode<P, T> createNode() {
- return new AttributeNode<P, T>(this);
+ return new AttributeNode<>(this);
}
/** {@inheritDoc} */
diff --git a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/RegionBSPTree3D.java b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/RegionBSPTree3D.java
index 23e5792..c2f9ebd 100644
--- a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/RegionBSPTree3D.java
+++ b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/RegionBSPTree3D.java
@@ -659,7 +659,7 @@
sumZ * barycenterScale);
}
- return new RegionSizeProperties<Vector3D>(size, barycenter);
+ return new RegionSizeProperties<>(size, barycenter);
}
/** Add the facet contribution of the given node cut boundary. If {@code reverse} is true,