[
https://issues.apache.org/jira/browse/MATH-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16904604#comment-16904604
]
Gilles edited comment on MATH-1495 at 8/11/19 9:48 AM:
-------------------------------------------------------
{quote}class file for org.apache.commons.rng.UniformRandomProvider not found
{quote}
You are missing new dependencies (e.g. ["Commons
RNG"|https://mvnrepository.com/artifact/org.apache.commons/commons-rng-simple],
for the above error)
Simplest would be to clone/fork the [project's
repository|https://gitbox.apache.org/repos/asf?p=commons-math.git] and create a
unit test.
Then, you should just run
{noformat}
mvn test
{noformat}
and "maven" would take care of downloading the dependencies.
Also possible is to check [which dependencies are
needed|https://gitbox.apache.org/repos/asf?p=commons-math.git;a=blob;f=pom.xml]
and download them manually (note that some of them are
[snapshots|https://repository.apache.org/content/repositories/snapshots/org/apache/commons/]).
was (Author: erans):
bq. class file for org.apache.commons.rng.UniformRandomProvider not found
You are missing new dependencies.
Simplest would be to clone/fork the [project's
repository|https://gitbox.apache.org/repos/asf?p=commons-math.git] and create a
unit test.
Then, you should just run
{noformat}
mvn test
{noformat}
and "maven" would take care of downloading the dependencies.
> Calling NaturalRanking#rank() on an array of all NaNs throws a misleading
> ArrayIndexOutOfBoundsException when the NanStrategy is REMOVED
> ----------------------------------------------------------------------------------------------------------------------------------------
>
> Key: MATH-1495
> URL: https://issues.apache.org/jira/browse/MATH-1495
> Project: Commons Math
> Issue Type: Bug
> Reporter: Akash Srivastava
> Priority: Major
>
> Consider the following code:
> {code:java}
> import org.apache.commons.math3.stat.ranking.NaNStrategy;
> import org.apache.commons.math3.stat.ranking.NaturalRanking;
> import org.apache.commons.math3.stat.ranking.TiesStrategy;
> class AllNaNException{
> public NaturalRanking naturalranking;
> public double[] AllNaNArray(){
> naturalranking = new NaturalRanking(NaNStrategy.REMOVED,
> TiesStrategy.AVERAGE);
> double[] x = {Double.NaN, Double.NaN};
> double[] y = naturalranking.rank(x);
> return y;
> }
> public static void main(String[] args) {
> AllNaNException a = new AllNaNException();
> double[] res = a.bug();
> System.out.println(res[0] + "," + res[1]);
> }
> }
> {code}
> Compiled it by: javac -cp /usr/share/java/commons-math3-3.6.1.jar tryit.java
> Executed it by: java -cp /usr/share/java/commons-math3-3.6.1.jar:. tryit
>
> Output:
> {code:java}
> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
> at
> org.apache.commons.math3.stat.ranking.NaturalRanking.rank(NaturalRanking.java:231)
> at tryit.bug(tryit.java:9)
> at tryit.main(tryit.java:14)
> {code}
>
> Currently, calling NaturalRanking#rank() on an array of all NaNs throws a
> misleading ArrayIndexOutOfBoundsException when the NanStrategy is REMOVED. I
> am unsure what outcome the user should expect in code like the test case I
> have provided below. Can you shed some light on this? I am happy to write a
> pull request once I know what fix would be best. I think throwing an
> IllegalArgumentException or returning an empty array would be more apt in
> this case.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)