|
[
Permlink
| « Hide
]
Suresh Srinivas added a comment - 19/Sep/08 01:33 AM
Fixing the issue reported by changing the implementation of equals to be consistent at all the places where bugs were reported. The implementation of equals ensures the following checks are consistently done before the internal data comparison of the two objects:
After this change, the number of "Correctness Warnings" printed by find bugs reduced from 18 to 8. There is no automated test case written for this change.
Incorporating code review comments from Chris:
1. Use base class equals method in the sub classes 2. Class ID should not be instantiated. Hence making it abstract and removing the unused static methods that were instantiating the class ID. 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: [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.
Changed fix version to 0.20 (
> Returns false if the this.getClass() != paramObject.getClass()
For class comparison, should we use equals(...) instead of ==? Otherwise, I am afraid it won't work in dynamic class loading.
java.lang.Class doesn't override equals, so it uses Object::equals, which does exactly this.
This is wrong; subpackages need access to methods on these IDs. Assuming all test cases pass, +1. -1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12390452/HADOOP-4210.patch against trunk revision 700322. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 Eclipse classpath. The patch retains Eclipse classpath integrity. -1 core tests. The patch failed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3402/testReport/ This message is automatically generated. HDFS test TestLeaseRecovery2 is failing. It is unrelated to this change (it is failing for other patches too)
I just committed this. Thanks, Suresh
Integrated in Hadoop-trunk #620 (See http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/620/
. Fix findbugs warnings for equals implementations of mapred ID classes. Removed public, static ID::read and ID::forName; made ID an abstract class. Contributed by Suresh Srinivas. Edit release note for publication.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||