commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <>
Subject [jira] [Created] (MATH-1408) Do not use exceptions for control flow
Date Tue, 04 Apr 2017 11:38:41 GMT
Gilles created MATH-1408:

             Summary: Do not use exceptions for control flow
                 Key: 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
try  {
 // block A
} catch (ClassCastException e) {
 // block B
where "block A" is trying to cast an object "o" to "SomeClass", should be changed to
if (o instanceof SomeClass)  {
 // block A
} else {
 // block B

This message was sent by Atlassian JIRA

View raw message