BATCH-1470: remove commons-lang dependency

This commit is contained in:
dsyer
2009-12-30 11:04:11 +00:00
parent 99aeb7fe62
commit e1fe74b3f9
40 changed files with 1343 additions and 622 deletions

View File

@@ -19,8 +19,8 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.apache.commons.lang.SerializationUtils;
import org.junit.Test;
import org.springframework.batch.support.SerializationUtils;
/**
* @author Dave Syer

View File

@@ -25,8 +25,8 @@ import java.util.Arrays;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang.SerializationUtils;
import org.junit.Test;
import org.springframework.batch.support.SerializationUtils;
/**
* @author Dave Syer

View File

@@ -15,10 +15,10 @@
*/
package org.springframework.batch.core;
import org.apache.commons.lang.SerializationUtils;
import junit.framework.TestCase;
import org.springframework.batch.support.SerializationUtils;
/**
* @author dsyer
*

View File

@@ -10,7 +10,7 @@ import java.util.Map.Entry;
import junit.framework.TestCase;
import org.apache.commons.lang.SerializationUtils;
import org.springframework.batch.support.SerializationUtils;
/**
* @author Lucas Ward

View File

@@ -26,11 +26,11 @@ import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import org.apache.commons.lang.SerializationUtils;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.core.step.StepSupport;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.support.SerializationUtils;
/**
* @author Dave Syer

View File

@@ -1,7 +1,5 @@
package org.springframework.batch.core.resource;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
/**
* Simple domain object for testing purposes.
@@ -42,13 +40,37 @@ public class Foo {
public String toString() {
return "Foo[id=" +id +",name=" + name + ",value=" + value + "]";
}
public boolean equals(Object obj) {
return EqualsBuilder.reflectionEquals(this, obj);
}
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
final int prime = 31;
int result = 1;
result = prime * result + id;
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + value;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Foo other = (Foo) obj;
if (id != other.id)
return false;
if (name == null) {
if (other.name != null)
return false;
}
else if (!name.equals(other.name))
return false;
if (value != other.value)
return false;
return true;
}
}