Some fiddling to handle classes that extend SimpleStreamableObject.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4688 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2007-05-04 22:17:24 +00:00
parent 1ec22804da
commit ea8bf25c0a
@@ -34,6 +34,7 @@ import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Task; import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.FileSet; import org.apache.tools.ant.types.FileSet;
import com.threerings.io.SimpleStreamableObject;
import com.threerings.io.Streamable; import com.threerings.io.Streamable;
import com.threerings.presents.data.InvocationMarshaller; import com.threerings.presents.data.InvocationMarshaller;
@@ -119,7 +120,7 @@ public class GenStreamableTask extends Task
// see if our parent also implements Streamable // see if our parent also implements Streamable
Class supster = sclass.getSuperclass(); Class supster = sclass.getSuperclass();
do { do {
if (isStreamable(supster)) { if (isStreamableClass(supster)) {
readbuf.append(" super.readObject(ins);\n"); readbuf.append(" super.readObject(ins);\n");
writebuf.append(" super.writeObject(out);\n"); writebuf.append(" super.writeObject(out);\n");
break; break;
@@ -180,11 +181,11 @@ public class GenStreamableTask extends Task
} }
} }
protected boolean isStreamable (Class clazz) protected boolean isStreamableClass (Class clazz)
{ {
for (Class iface : clazz.getInterfaces()) { for (Class iface : clazz.getInterfaces()) {
if (Streamable.class.equals(iface)) { if (Streamable.class.equals(iface)) {
return true; return !SimpleStreamableObject.class.equals(clazz);
} }
} }
return false; return false;