You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by lu...@apache.org on 2015/04/30 18:36:08 UTC
[5/5] [math] Fixed checkstyle and findbugs warnings.
Fixed checkstyle and findbugs warnings.
Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/35f4fbee
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/35f4fbee
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/35f4fbee
Branch: refs/heads/master
Commit: 35f4fbeeb6feff2fd364f79d845449417d84cc74
Parents: 783adba
Author: Luc Maisonobe <lu...@apache.org>
Authored: Thu Apr 30 18:35:35 2015 +0200
Committer: Luc Maisonobe <lu...@apache.org>
Committed: Thu Apr 30 18:35:35 2015 +0200
----------------------------------------------------------------------
.../math4/analysis/interpolation/FieldHermiteInterpolator.java | 3 ++-
.../apache/commons/math4/geometry/enclosing/EnclosingBall.java | 1 +
.../commons/math4/geometry/euclidean/threed/PolyhedronsSet.java | 1 -
.../apache/commons/math4/geometry/partitioning/RegionFactory.java | 3 ++-
src/test/java/org/apache/commons/math4/PerfTestUtils.java | 2 ++
.../math4/analysis/interpolation/TricubicInterpolatorTest.java | 1 -
.../math4/geometry/euclidean/threed/PolyhedronsSetTest.java | 2 --
7 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-math/blob/35f4fbee/src/main/java/org/apache/commons/math4/analysis/interpolation/FieldHermiteInterpolator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/analysis/interpolation/FieldHermiteInterpolator.java b/src/main/java/org/apache/commons/math4/analysis/interpolation/FieldHermiteInterpolator.java
index 8945aae..e5e660f 100644
--- a/src/main/java/org/apache/commons/math4/analysis/interpolation/FieldHermiteInterpolator.java
+++ b/src/main/java/org/apache/commons/math4/analysis/interpolation/FieldHermiteInterpolator.java
@@ -87,7 +87,8 @@ public class FieldHermiteInterpolator<T extends FieldElement<T>> {
* @throws DimensionMismatchException if derivative structures are inconsistent
* @throws NullArgumentException if x is null
*/
- public void addSamplePoint(final T x, final T[] ... value)
+ @SafeVarargs
+ public final void addSamplePoint(final T x, final T[] ... value)
throws ZeroException, MathArithmeticException,
DimensionMismatchException, NullArgumentException {
http://git-wip-us.apache.org/repos/asf/commons-math/blob/35f4fbee/src/main/java/org/apache/commons/math4/geometry/enclosing/EnclosingBall.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/geometry/enclosing/EnclosingBall.java b/src/main/java/org/apache/commons/math4/geometry/enclosing/EnclosingBall.java
index 64caf28..9279377 100644
--- a/src/main/java/org/apache/commons/math4/geometry/enclosing/EnclosingBall.java
+++ b/src/main/java/org/apache/commons/math4/geometry/enclosing/EnclosingBall.java
@@ -48,6 +48,7 @@ public class EnclosingBall<S extends Space, P extends Point<S>> implements Seria
* @param radius radius of the ball
* @param support support points used to define the ball
*/
+ @SafeVarargs
public EnclosingBall(final P center, final double radius, final P ... support) {
this.center = center;
this.radius = radius;
http://git-wip-us.apache.org/repos/asf/commons-math/blob/35f4fbee/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSet.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSet.java b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSet.java
index 744aa9f..9de30ce 100644
--- a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSet.java
+++ b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSet.java
@@ -171,7 +171,6 @@ public class PolyhedronsSet extends AbstractRegion<Euclidean3D, Euclidean2D> {
final Plane pyMax = new Plane(new Vector3D(0, yMax, 0), Vector3D.PLUS_J, tolerance);
final Plane pzMin = new Plane(new Vector3D(0, 0, zMin), Vector3D.MINUS_K, tolerance);
final Plane pzMax = new Plane(new Vector3D(0, 0, zMax), Vector3D.PLUS_K, tolerance);
- @SuppressWarnings("unchecked")
final Region<Euclidean3D> boundary =
new RegionFactory<Euclidean3D>().buildConvex(pxMin, pxMax, pyMin, pyMax, pzMin, pzMax);
return boundary.getTree(false);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/35f4fbee/src/main/java/org/apache/commons/math4/geometry/partitioning/RegionFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/geometry/partitioning/RegionFactory.java b/src/main/java/org/apache/commons/math4/geometry/partitioning/RegionFactory.java
index cf96192..9e32c99 100644
--- a/src/main/java/org/apache/commons/math4/geometry/partitioning/RegionFactory.java
+++ b/src/main/java/org/apache/commons/math4/geometry/partitioning/RegionFactory.java
@@ -45,7 +45,8 @@ public class RegionFactory<S extends Space> {
* @param hyperplanes collection of bounding hyperplanes
* @return a new convex region, or null if the collection is empty
*/
- public Region<S> buildConvex(final Hyperplane<S> ... hyperplanes) {
+ @SafeVarargs
+ public final Region<S> buildConvex(final Hyperplane<S> ... hyperplanes) {
if ((hyperplanes == null) || (hyperplanes.length == 0)) {
return null;
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/35f4fbee/src/test/java/org/apache/commons/math4/PerfTestUtils.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/PerfTestUtils.java b/src/test/java/org/apache/commons/math4/PerfTestUtils.java
index 75afa60..f137a47 100644
--- a/src/test/java/org/apache/commons/math4/PerfTestUtils.java
+++ b/src/test/java/org/apache/commons/math4/PerfTestUtils.java
@@ -51,6 +51,7 @@ public class PerfTestUtils {
* taken by a single call to the {@code call} method (i.e. the time
* taken by each timed block divided by {@code repeatChunk}).
*/
+ @SafeVarargs
public static StatisticalSummary[] time(int repeatChunk,
int repeatStat,
boolean runGC,
@@ -95,6 +96,7 @@ public class PerfTestUtils {
* </li>
* </ul>
*/
+ @SafeVarargs
public static double[][][] timesAndResults(int repeatChunk,
int repeatStat,
boolean runGC,
http://git-wip-us.apache.org/repos/asf/commons-math/blob/35f4fbee/src/test/java/org/apache/commons/math4/analysis/interpolation/TricubicInterpolatorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/analysis/interpolation/TricubicInterpolatorTest.java b/src/test/java/org/apache/commons/math4/analysis/interpolation/TricubicInterpolatorTest.java
index a02e7d5..8c9c579 100644
--- a/src/test/java/org/apache/commons/math4/analysis/interpolation/TricubicInterpolatorTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/interpolation/TricubicInterpolatorTest.java
@@ -90,7 +90,6 @@ public final class TricubicInterpolatorTest {
double[] zval = new double[] {-12, -8, -5.5, -3, 0, 2.5};
double[][][] fval = new double[xval.length][yval.length][zval.length];
- @SuppressWarnings("unused")
TricubicInterpolatingFunction tcf = new TricubicInterpolator().interpolate(xval, yval, zval, fval);
// Valid.
http://git-wip-us.apache.org/repos/asf/commons-math/blob/35f4fbee/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java
index 5c6f93c..8d4b003 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java
@@ -103,7 +103,6 @@ public class PolyhedronsSetTest {
Vector3D vertex2 = new Vector3D(2, 2, 4);
Vector3D vertex3 = new Vector3D(2, 3, 3);
Vector3D vertex4 = new Vector3D(1, 3, 4);
- @SuppressWarnings("unchecked")
PolyhedronsSet tree =
(PolyhedronsSet) new RegionFactory<Euclidean3D>().buildConvex(
new Plane(vertex3, vertex2, vertex1, 1.0e-10),
@@ -138,7 +137,6 @@ public class PolyhedronsSetTest {
Vector3D vertex2 = new Vector3D(2.0, 2.4, 4.2);
Vector3D vertex3 = new Vector3D(2.8, 3.3, 3.7);
Vector3D vertex4 = new Vector3D(1.0, 3.6, 4.5);
- @SuppressWarnings("unchecked")
PolyhedronsSet tree =
(PolyhedronsSet) new RegionFactory<Euclidean3D>().buildConvex(
new Plane(vertex3, vertex2, vertex1, 1.0e-10),