commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cyrille Artho (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MATH-1116) NullPointerException not advertized in Javadoc
Date Wed, 16 Apr 2014 06:50:15 GMT

    [ https://issues.apache.org/jira/browse/MATH-1116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13970509#comment-13970509
] 

Cyrille Artho commented on MATH-1116:
-------------------------------------

Thanks. I've added another attachment that shows two more similar cases, after removing deprecated
classes and trying to simplify the tests. The attachment IllegalStateB.java appears above,
along with the one-liner for the shorter of the two tests.

> NullPointerException not advertized in Javadoc
> ----------------------------------------------
>
>                 Key: MATH-1116
>                 URL: https://issues.apache.org/jira/browse/MATH-1116
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.2
>         Environment: Mac OS 10.9, Java 6, 7
>            Reporter: Cyrille Artho
>            Priority: Minor
>              Labels: javadoc
>             Fix For: 3.3
>
>         Attachments: IllegalStateB.java, Report2.java
>
>
> The following statement produces a NullPointerException:
> new org.apache.commons.math3.optim.nonlinear.vector.jacobian.LevenbergMarquardtOptimizer().getWeight();
> The documentation does not seem to indicate that other data must be set before getWeight
is used (at least I could not find that information). In this case, weightMatrix is still
null because it has not been initialized.
> This call should probably throw an IllegalStateException, which makes it clear that this
API usage is incorrect.
> This test uses LevenbergMarquardtOptimizer but any instantiable subclass of MultivariateVectorOptimizer
probably works the same way.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message