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

Bruno P. Kinoshita commented on MATH-1408:
------------------------------------------

Had completely forgotten about this issue [~erans] , sorry. PR raised 
https://github.com/apache/commons-math/pull/115

> Do not use exceptions for control flow
> --------------------------------------
>
>                 Key: MATH-1408
>                 URL: https://issues.apache.org/jira/browse/MATH-1408
>             Project: Commons Math
>          Issue Type: Task
>            Reporter: Gilles Sadowski
>            Assignee: Bruno P. Kinoshita
>            Priority: Minor
>              Labels: control, exception, flow
>             Fix For: 4.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> There are several occurrences where exception is used to control flow.
> Code such as
> {noformat}
> try  {
>  // block A
> } catch (ClassCastException e) {
>  // block B
> }
> {noformat}
> where "block A" is trying to cast an object "o" to "SomeClass", should be 
> changed to
> {noformat}
> if (o instanceof SomeClass)  {
>  // block A
> } else {
>  // block B
> }
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to