Skip to content

Instantly share code, notes, and snippets.

@ALRubinger
Created August 11, 2010 02:51
Show Gist options
  • Save ALRubinger/518395 to your computer and use it in GitHub Desktop.
Save ALRubinger/518395 to your computer and use it in GitHub Desktop.
[alr@alr-laptop shrinkwrap]$ git diff
diff --git a/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ContainerBase.java b/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/containe
index 29ebe9d..2fb6483 100644
--- a/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ContainerBase.java
+++ b/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ContainerBase.java
@@ -381,49 +381,19 @@ public abstract class ContainerBase<T extends Archive<T>> extends AssignableBase
@Override
public int hashCode()
{
- final int prime = 31;
- int result = 1;
- result = prime * result + ((archive.getName() == null) ? 0 : archive.getName().hashCode());
- result = prime * result + ((archive.getContent() == null) ? 0 : archive.getContent().hashCode());
- return result;
+ return archive.hashCode();
}
@Override
public boolean equals(Object obj)
{
- if (this == obj)
- return true;
- if (obj == null)
- return false;
if (!(obj instanceof ContainerBase))
- return false;
-
- ContainerBase<?> other = (ContainerBase<?>) obj;
-
- if (archive == null)
{
- if (other.archive != null)
- return false;
- }
- else if (!archive.equals(other.archive))
return false;
- if (archive.getContent() == null)
- {
- if (other.getArchive().getContent() != null)
- return false;
}
- else if (!archive.getContent().equals(other.getArchive().getContent()))
- return false;
- if (archive.getName() == null)
- {
- if (other.getArchive().getName() != null)
- return false;
- }
- else if (!archive.getName().equals(other.getArchive().getName()))
- return false;
-
- return true;
- }
+ final ContainerBase<?> other = (ContainerBase<?>) obj;
+ return archive.equals(other.getArchive());
+ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment