You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gilles (JIRA)" <ji...@apache.org> on 2017/04/04 11:38:41 UTC

[jira] [Created] (MATH-1408) Do not use exceptions for control flow

Gilles created MATH-1408:
----------------------------

             Summary: 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
            Priority: Minor
             Fix For: 4.0


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
(v6.3.15#6346)