You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Suresh Srinivas (JIRA)" <ji...@apache.org> on 2008/09/19 21:06:44 UTC

[jira] Commented: (HADOOP-4210) Findbugs warnings are printed related to equals implementation of several classes

    [ https://issues.apache.org/jira/browse/HADOOP-4210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12632775#action_12632775 ] 

Suresh Srinivas commented on HADOOP-4210:
-----------------------------------------

Patch passed all the unit tests. The number of findbugs warning for "Correctness Warnings" reduced from 18 to 8.

Here is the result of test-patch:
{noformat}
      [exec] -1 overall.  
 
      [exec]     +1 @author.  The patch does not contain any @author tags.
 
      [exec]     -1 tests included.  The patch doesn't appear to include any new or modified tests.
      [exec]                         Please justify why no tests are needed for this patch.
 
      [exec]     +1 javadoc.  The javadoc tool did not generate any warning messages.
 
      [exec]     +1 javac.  The applied patch does not increase the total number of javac compiler warnings.
 
      [exec]     +1 findbugs.  The patch does not introduce any new Findbugs warnings.
{noformat}

> Findbugs warnings are printed related to equals implementation of several classes
> ---------------------------------------------------------------------------------
>
>                 Key: HADOOP-4210
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4210
>             Project: Hadoop Core
>          Issue Type: Bug
>            Reporter: Suresh Srinivas
>            Assignee: Suresh Srinivas
>             Fix For: 0.19.0
>
>         Attachments: HADOOP-4210.patch, HADOOP-4210.patch, HADOOP4210.patch
>
>
> During compilation - findbugs generates several warnings that indicates bugs in the implementation of equals method. One of the example of this report is:
> Bug type EQ_GETCLASS_AND_CLASS_CONSTANT (click for details)
> In class org.apache.hadoop.mapred.ID
> In method org.apache.hadoop.mapred.ID.equals(Object)
> At ID.java:[line 66]
> Value doesn't work for subtypes
> This class has an equals method that will be broken if it is inherited by subclasses. It compares a class literal with the class of the argument (e.g., in class Foo it might check if Foo.class == o.getClass()). It is better to check if this.getClass() == o.getClass().

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