diff --git a/src/main/java/com/threerings/presents/tools/ActionScriptUtils.java b/src/main/java/com/threerings/presents/tools/ActionScriptUtils.java index cfbfba96f..e3e194a32 100644 --- a/src/main/java/com/threerings/presents/tools/ActionScriptUtils.java +++ b/src/main/java/com/threerings/presents/tools/ActionScriptUtils.java @@ -274,32 +274,6 @@ public class ActionScriptUtils return false; } - /** - * Returns the primitive (unboxed) counterpart of a class, or the same class if it isn't a boxed - * type. - */ - public static Class toPrimitiveType (Class cclass) - { - if (Boolean.class == cclass) { - return Boolean.TYPE; - } else if (Character.class == cclass) { - return Character.TYPE; - } else if (Byte.class == cclass) { - return Byte.TYPE; - } else if (Short.class == cclass) { - return Short.TYPE; - } else if (Integer.class == cclass) { - return Integer.TYPE; - } else if (Long.class == cclass) { - return Long.TYPE; - } else if (Float.class == cclass) { - return Float.TYPE; - } else if (Double.class == cclass) { - return Double.TYPE; - } - return cclass; - } - /** Returns if the given class is an implementation of Map that doesn't know about Streaming */ protected static boolean isNaiveMap (Class type) { diff --git a/src/main/java/com/threerings/presents/tools/GenActionScriptStreamableTask.java b/src/main/java/com/threerings/presents/tools/GenActionScriptStreamableTask.java index 4b7fdfe28..e54d1fc62 100644 --- a/src/main/java/com/threerings/presents/tools/GenActionScriptStreamableTask.java +++ b/src/main/java/com/threerings/presents/tools/GenActionScriptStreamableTask.java @@ -33,6 +33,7 @@ import org.apache.tools.ant.Project; import com.google.common.base.Charsets; import com.google.common.base.Joiner; +import com.google.common.primitives.Primitives; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.google.common.io.Files; @@ -189,7 +190,7 @@ public class GenActionScriptStreamableTask extends GenTask for (Type param : ((ParameterizedType) genType).getActualTypeArguments()) { if (param instanceof Class) { // Convert any box classes to primitives to avoid having to import them - Class primitive = ActionScriptUtils.toPrimitiveType((Class) param); + Class primitive = Primitives.unwrap((Class) param); parameters.add(ActionScriptUtils.addImportAndGetShortType( primitive, false, imports)); }