Skip to content

Commit

Permalink
Fix equals
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@3670 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
pmuir committed Sep 15, 2009
1 parent b91932f commit 89f0640
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 34 deletions.
Expand Up @@ -65,7 +65,7 @@ public AbstractClassBean<?> getDeclaringBean()
@Override
public boolean equals(Object obj)
{
return delegate().equals(obj);
return this == obj || delegate().equals(obj);
}

@Override
Expand Down
Expand Up @@ -55,7 +55,7 @@ public VariableMapper getVariableMapper()
@Override
public boolean equals(Object obj)
{
return delgate().equals(obj);
return this == obj || delgate().equals(obj);
}

@SuppressWarnings("unchecked")
Expand Down
Expand Up @@ -66,7 +66,7 @@ public void setValue(ELContext context, Object base, Object property, Object val
@Override
public boolean equals(Object obj)
{
return delegate().equals(obj);
return this == obj || delegate().equals(obj);
}

@Override
Expand Down
Expand Up @@ -58,7 +58,7 @@ public ValueExpression createValueExpression(ELContext context, String expressio
@Override
public boolean equals(Object obj)
{
return delegate().equals(obj);
return this == obj || delegate().equals(obj);
}

@Override
Expand Down
Expand Up @@ -55,11 +55,10 @@ public boolean isLiteralText()
return delegate().isLiteralText();
}


@Override
public boolean equals(Object obj)
{
return delegate().equals(obj);
return this == obj || delegate().equals(obj);
}

@Override
Expand Down
Expand Up @@ -77,7 +77,7 @@ public boolean isLiteralText()
@Override
public boolean equals(Object obj)
{
return delegate().equals(obj);
return this == obj || delegate().equals(obj);
}

@Override
Expand Down
Expand Up @@ -63,7 +63,7 @@ public int hashCode()
@Override
public boolean equals(Object obj)
{
return delegate().equals(obj);
return this == obj ||delegate().equals(obj);
}

public Bootstrap deployBeans()
Expand Down
Expand Up @@ -105,7 +105,7 @@ public int hashCode()
@Override
public boolean equals(Object obj)
{
return delegate().equals(obj);
return this == obj || delegate().equals(obj);
}

}
Expand Up @@ -60,7 +60,7 @@ public int hashCode()
@Override
public boolean equals(Object obj)
{
return delegate().equals(obj);
return this == obj || delegate().equals(obj);
}

@Override
Expand Down
Expand Up @@ -47,7 +47,7 @@ public int hashCode()
@Override
public boolean equals(Object obj)
{
return delegate().equals(obj);
return this == obj || delegate().equals(obj);
}

}
Expand Up @@ -65,7 +65,7 @@ public boolean isStateless()
@Override
public boolean equals(Object obj)
{
return delegate().equals(obj);
return this == obj || delegate().equals(obj);
}

@Override
Expand Down
Expand Up @@ -43,7 +43,7 @@ public SessionObjectReference resolveEjb(EjbDescriptor<?> ejbDescriptor)
@Override
public boolean equals(Object obj)
{
return delegate().equals(obj);
return this == obj || delegate().equals(obj);
}

@Override
Expand Down
Expand Up @@ -62,7 +62,7 @@ public int hashCode()
@Override
public boolean equals(Object obj)
{
return delegate().equals(obj);
return this == obj || delegate().equals(obj);
}

}
Expand Up @@ -38,7 +38,7 @@ public Collection<URL> getResources(String name)
@Override
public boolean equals(Object obj)
{
return delegate().equals(obj);
return this == obj || delegate().equals(obj);
}

@Override
Expand Down
38 changes: 19 additions & 19 deletions tests/src/main/java/org/jboss/webbeans/mock/MockEjbDescriptor.java
Expand Up @@ -178,24 +178,24 @@ public String toString()
return builder.toString();
}

@Override
public boolean equals(Object other)
{
if (other instanceof EjbDescriptor)
{
EjbDescriptor<T> that = (EjbDescriptor<T>) other;
return this.getBeanClass().equals(that.getBeanClass());
}
else
{
return false;
}
}

@Override
public int hashCode()
{
return getEjbName().hashCode();
}
// @Override
// public boolean equals(Object other)
// {
// if (other instanceof EjbDescriptor)
// {
// EjbDescriptor<T> that = (EjbDescriptor<T>) other;
// return this.getBeanClass().equals(that.getBeanClass());
// }
// else
// {
// return false;
// }
// }
//
// @Override
// public int hashCode()
// {
// return getEjbName().hashCode();
// }

}

0 comments on commit 89f0640

Please sign in to comment.