Some code hygiene.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6045 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2010-03-16 23:57:28 +00:00
parent c77ff81160
commit 7eb35b5dc1
2 changed files with 19 additions and 6 deletions
@@ -143,7 +143,7 @@ public class GenServiceTask extends InvocationTask
@Override
public boolean equals (Object other)
{
return getClass().equals(other.getClass()) &&
return (other != null) && getClass().equals(other.getClass()) &&
listener.equals(((ServiceListener)other).listener);
}
@@ -263,11 +263,6 @@ public abstract class InvocationTask extends Task
});
}
public int compareTo (ServiceMethod other)
{
return getCode().compareTo(other.getCode());
}
public String getUnwrappedArgList (boolean listenerMode)
{
StringBuilder buf = new StringBuilder();
@@ -315,6 +310,24 @@ public abstract class InvocationTask extends Task
hint.type().name() + ", " + hint.channel() + ")";
}
// from interface Comparator<ServiceMethod>
public int compareTo (ServiceMethod other)
{
return getCode().compareTo(other.getCode());
}
@Override // from Object
public boolean equals (Object other)
{
return (other instanceof ServiceMethod) && compareTo((ServiceMethod)other) == 0;
}
@Override // from Object
public int hashCode ()
{
return getCode().hashCode();
}
protected String boxArgument (Class<?> clazz, int index)
{
if (_ilistener.isAssignableFrom(clazz)) {