Implement equals and hashCode methods

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@917980 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/sigil/common/core/src/org/apache/felix/sigil/core/internal/model/osgi/PackageExport.java b/sigil/common/core/src/org/apache/felix/sigil/core/internal/model/osgi/PackageExport.java
index d3ab4b9..4520113 100644
--- a/sigil/common/core/src/org/apache/felix/sigil/core/internal/model/osgi/PackageExport.java
+++ b/sigil/common/core/src/org/apache/felix/sigil/core/internal/model/osgi/PackageExport.java
@@ -166,4 +166,31 @@
             }
         }
     }
+
+
+    @Override
+    public boolean equals(Object obj)
+    {
+        if ( obj == null ) return false;
+        if ( obj == this ) return true;
+        try {
+            PackageExport e = (PackageExport) obj;
+            return name == null ? e.name == null : name.equals( e.name ) && 
+                version == null ? e.version == null : version.equals( e.version );
+        }
+        catch (ClassCastException e) {
+            return false;
+        }
+    }
+
+
+    @Override
+    public int hashCode()
+    {
+        int hc = name.hashCode();
+        
+        if ( version != null ) hc *= version.hashCode();
+        
+        return hc;
+    }
 }