diff --git a/src/java/com/threerings/presents/tools/GenServiceTask.java b/src/java/com/threerings/presents/tools/GenServiceTask.java index b775b6aee..45d9bbd1c 100644 --- a/src/java/com/threerings/presents/tools/GenServiceTask.java +++ b/src/java/com/threerings/presents/tools/GenServiceTask.java @@ -62,6 +62,12 @@ public class GenServiceTask extends InvocationTask return getName().compareTo(other.getName()); } + public boolean equals (Object other) + { + return getClass().equals(other.getClass()) && + listener.equals(((ServiceListener)other).listener); + } + public String getName () { String name = simpleName(listener); @@ -113,8 +119,8 @@ public class GenServiceTask extends InvocationTask for (int aa = 0; aa < args.length; aa++) { if (_ilistener.isAssignableFrom(args[aa]) && simpleName(args[aa]).startsWith(sname + ".")) { - listeners.add(new ServiceListener( - service, args[aa], imports)); + checkedAdd(listeners, new ServiceListener( + service, args[aa], imports)); } } methods.add(new ServiceMethod(service, m, imports)); diff --git a/src/java/com/threerings/presents/tools/InvocationTask.java b/src/java/com/threerings/presents/tools/InvocationTask.java index 11b60bab6..3dbc2aae2 100644 --- a/src/java/com/threerings/presents/tools/InvocationTask.java +++ b/src/java/com/threerings/presents/tools/InvocationTask.java @@ -13,6 +13,7 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; +import java.util.List; import java.util.regex.Pattern; import java.util.regex.Matcher; @@ -353,7 +354,7 @@ public abstract class InvocationTask extends Task FileUtils.writeStringToFile(new File(path), data, "UTF-8"); } - protected static void checkedAdd (SortableArrayList list, String value) + protected static void checkedAdd (List list, Object value) { if (!list.contains(value)) { list.add(value);