You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by ro...@apache.org on 2010/02/05 18:59:15 UTC
svn commit: r907020 - in
/lucene/mahout/trunk/math/src/main/java-templates/org/apache/mahout/math/list:
AbstractValueTypeList.java.t ValueTypeArrayList.java.t
Author: robinanil
Date: Fri Feb 5 17:59:14 2010
New Revision: 907020
URL: http://svn.apache.org/viewvc?rev=907020&view=rev
Log:
null check bug in List
Modified:
lucene/mahout/trunk/math/src/main/java-templates/org/apache/mahout/math/list/AbstractValueTypeList.java.t
lucene/mahout/trunk/math/src/main/java-templates/org/apache/mahout/math/list/ValueTypeArrayList.java.t
Modified: lucene/mahout/trunk/math/src/main/java-templates/org/apache/mahout/math/list/AbstractValueTypeList.java.t
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/math/src/main/java-templates/org/apache/mahout/math/list/AbstractValueTypeList.java.t?rev=907020&r1=907019&r2=907020&view=diff
==============================================================================
--- lucene/mahout/trunk/math/src/main/java-templates/org/apache/mahout/math/list/AbstractValueTypeList.java.t (original)
+++ lucene/mahout/trunk/math/src/main/java-templates/org/apache/mahout/math/list/AbstractValueTypeList.java.t Fri Feb 5 17:59:14 2010
@@ -276,15 +276,15 @@
* @return true if the specified Object is equal to the receiver.
*/
public boolean equals(Object otherObj) { //delta
+ if (otherObj == null) {
+ return false;
+ }
if (!(otherObj instanceof Abstract${valueTypeCap}List)) {
return false;
}
if (this == otherObj) {
return true;
}
- if (otherObj == null) {
- return false;
- }
Abstract${valueTypeCap}List other = (Abstract${valueTypeCap}List) otherObj;
if (size() != other.size()) {
return false;
Modified: lucene/mahout/trunk/math/src/main/java-templates/org/apache/mahout/math/list/ValueTypeArrayList.java.t
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/math/src/main/java-templates/org/apache/mahout/math/list/ValueTypeArrayList.java.t?rev=907020&r1=907019&r2=907020&view=diff
==============================================================================
--- lucene/mahout/trunk/math/src/main/java-templates/org/apache/mahout/math/list/ValueTypeArrayList.java.t (original)
+++ lucene/mahout/trunk/math/src/main/java-templates/org/apache/mahout/math/list/ValueTypeArrayList.java.t Fri Feb 5 17:59:14 2010
@@ -244,6 +244,9 @@
* @return true if the specified Object is equal to the receiver.
*/
public boolean equals(Object otherObj) { //delta
+ if (otherObj == null) {
+ return false;
+ }
// overridden for performance only.
if (!(otherObj instanceof ${valueTypeCap}ArrayList)) {
return super.equals(otherObj);
@@ -251,9 +254,6 @@
if (this == otherObj) {
return true;
}
- if (otherObj == null) {
- return false;
- }
${valueTypeCap}ArrayList other = (${valueTypeCap}ArrayList) otherObj;
if (size() != other.size()) {
return false;