[jira] Created: (MATH-336) Unnecessary null checks in equals methods

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (MATH-336) Unnecessary null checks in equals methods

ASF GitHub Bot (Jira)
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


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.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (MATH-336) Unnecessary null checks in equals methods

ASF GitHub Bot (Jira)

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

Phil Steitz updated MATH-336:
-----------------------------

    Fix Version/s: 2.1

> 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.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (MATH-336) Unnecessary null checks in equals methods

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

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

Sebb resolved MATH-336.
-----------------------

    Resolution: Fixed

Fixed as part of MATH-337

> 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.

Reply | Threaded
Open this post in threaded view
|

[jira] Reopened: (MATH-336) Unnecessary null checks in equals methods

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

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

Sebb reopened MATH-336:
-----------------------


Oops - only some of the instances were fixed as part of MATH-337

> 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.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (MATH-336) Unnecessary null checks in equals methods

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

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

Sebb resolved MATH-336.
-----------------------

    Resolution: Fixed

URL: http://svn.apache.org/viewvc?rev=922714&view=rev
Log:
MATH-336 Unnecessary null checks in equals methods

Modified:
   commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/polynomials/PolynomialFunction.java
   commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/OpenMapRealVector.java
   commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SparseFieldVector.java
   commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/descriptive/moment/VectorialCovariance.java
   commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/descriptive/moment/VectorialMean.java

> 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.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (MATH-336) Unnecessary null checks in equals methods

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ 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.