You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2019/09/27 13:49:14 UTC
[commons-rng] 04/05: Fix PMD errors in quadrature examples code.
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-rng.git
commit edc6e3587c7a114249e7df76c63be119bc87f179
Author: aherbert <ah...@apache.org>
AuthorDate: Fri Sep 27 14:21:30 2019 +0100
Fix PMD errors in quadrature examples code.
---
.../java/org/apache/commons/rng/examples/quadrature/ComputePi.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/ComputePi.java b/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/ComputePi.java
index 5f500fb..f5e0c19 100644
--- a/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/ComputePi.java
+++ b/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/ComputePi.java
@@ -33,6 +33,8 @@ import org.apache.commons.rng.simple.RandomSource;
* we will have \( \frac{N_c}{N} \approx \frac{\pi}{4} \).
*/
public class ComputePi extends MonteCarloIntegration {
+ /** Expected number of arguments. */
+ private static final int EXPECTED_ARGUMENTS = 2;
/** Domain dimension. */
private static final int DIMENSION = 2;
@@ -58,7 +60,7 @@ public class ComputePi extends MonteCarloIntegration {
* </ol>
*/
public static void main(String[] args) {
- if (args.length != 2) {
+ if (args.length != EXPECTED_ARGUMENTS) {
throw new IllegalStateException("Missing arguments");
}