From e09ef8bbb2b9fb4256eb4b3e8ece08a510cbc7eb Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Fri, 11 Jul 2003 01:22:16 +0000 Subject: [PATCH] If asked to find a marshaller for a pure interface, use the marshaller for Object. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2700 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/io/FieldMarshaller.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/io/FieldMarshaller.java b/src/java/com/threerings/io/FieldMarshaller.java index 56812338b..cab1af831 100644 --- a/src/java/com/threerings/io/FieldMarshaller.java +++ b/src/java/com/threerings/io/FieldMarshaller.java @@ -1,5 +1,5 @@ // -// $Id: FieldMarshaller.java,v 1.4 2002/12/21 00:44:25 mdb Exp $ +// $Id: FieldMarshaller.java,v 1.5 2003/07/11 01:22:16 ray Exp $ package com.threerings.io; @@ -39,8 +39,13 @@ public abstract class FieldMarshaller createMarshallers(); } - // if we have an exact match, use that Class ftype = field.getType(); + if (ftype.isInterface()) { + // if the class is a pure interface, use Object. + ftype = Object.class; + } + + // if we have an exact match, use that FieldMarshaller fm = (FieldMarshaller)_marshallers.get(ftype); // otherwise if the class is a streamable, use the streamable