commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <j...@apache.org>
Subject [jira] Closed: (MATH-336) Unnecessary null checks in equals methods
Date Sat, 03 Apr 2010 03:57:27 GMT

     [ https://issues.apache.org/jira/browse/MATH-336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Phil Steitz closed MATH-336.
----------------------------


> Unnecessary null checks in equals methods
> -----------------------------------------
>
>                 Key: MATH-336
>                 URL: https://issues.apache.org/jira/browse/MATH-336
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Sebb
>            Priority: Minor
>             Fix For: 2.1
>
>
> Many of the equals() methods have code like the following:
> {code}
> if (obj == null) {
>     return false;
> }
> if (!(obj instanceof OpenMapRealVector)) {
>     return false;
> }
> {code}
> The null check is redundant, as null would cause the instanceof check to fail anyway,
so the null check could just be removed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message