diff --git a/navalplanner-gantt-zk/pom.xml b/navalplanner-gantt-zk/pom.xml
index 55c942b60..8ffde6340 100644
--- a/navalplanner-gantt-zk/pom.xml
+++ b/navalplanner-gantt-zk/pom.xml
@@ -22,6 +22,10 @@
commons-logging
commons-logging
+
+ commons-lang
+ commons-lang
+
org.zkoss.zk
diff --git a/navalplanner-gantt-zk/src/main/java/org/zkoss/ganttz/data/Dependency.java b/navalplanner-gantt-zk/src/main/java/org/zkoss/ganttz/data/Dependency.java
index 630ab4b05..f62b4398c 100644
--- a/navalplanner-gantt-zk/src/main/java/org/zkoss/ganttz/data/Dependency.java
+++ b/navalplanner-gantt-zk/src/main/java/org/zkoss/ganttz/data/Dependency.java
@@ -3,6 +3,9 @@ package org.zkoss.ganttz.data;
import java.util.Collection;
import java.util.Date;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+
/**
* This class represents a dependency. Contains the source and the destination.
* It also specifies the type of the relationship.
@@ -74,12 +77,8 @@ public class Dependency {
@Override
public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result
- + ((destination == null) ? 0 : destination.hashCode());
- result = prime * result + ((source == null) ? 0 : source.hashCode());
- return result;
+ return new HashCodeBuilder().append(source).append(destination).append(
+ type).toHashCode();
}
@Override
@@ -91,17 +90,9 @@ public class Dependency {
if (getClass() != obj.getClass())
return false;
Dependency other = (Dependency) obj;
- if (destination == null) {
- if (other.destination != null)
- return false;
- } else if (!destination.equals(other.destination))
- return false;
- if (source == null) {
- if (other.source != null)
- return false;
- } else if (!source.equals(other.source))
- return false;
- return true;
+ return new EqualsBuilder().append(this.destination, other.destination)
+ .append(this.source, other.source)
+ .append(this.type, other.type).isEquals();
}
public Task getSource() {