From f18cd38c3d573b96f132d261207aa878e2ce823a Mon Sep 17 00:00:00 2001 From: Par Winzell Date: Tue, 8 Feb 2011 23:26:32 +0000 Subject: [PATCH] Try again - instead of a major reorganization, simply extend the range of conversions. An [B is always a ByteArray, and after that, any array becomes a TypedArray. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6486 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/presents/tools/GenServiceTask.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/threerings/presents/tools/GenServiceTask.java b/src/main/java/com/threerings/presents/tools/GenServiceTask.java index 743a40c85..b147f8fb1 100644 --- a/src/main/java/com/threerings/presents/tools/GenServiceTask.java +++ b/src/main/java/com/threerings/presents/tools/GenServiceTask.java @@ -337,7 +337,8 @@ public class GenServiceTask extends InvocationTask // get rid of java.lang stuff and any remaining primitives imports.removeGlobals(); - if (imports.removeAll("[L*") > 0) { + imports.replace("[B", "flash.utils.ByteArray"); + if (imports.removeAll("[*") > 0) { imports.add("com.threerings.io.TypedArray"); } @@ -379,8 +380,8 @@ public class GenServiceTask extends InvocationTask // convert primitive java types to ooo util types imports.replace("long", "com.threerings.util.Long"); - // convert object arrays to typed arrays - if (imports.removeAll("[L*") > 0) { + imports.replace("[B", "flash.utils.ByteArray"); + if (imports.removeAll("[*") > 0) { imports.add("com.threerings.io.TypedArray"); } @@ -416,7 +417,7 @@ public class GenServiceTask extends InvocationTask // convert java primitive types to ooo util types imports.replace("java.lang.Integer", "com.threerings.util.Integer"); - if (imports.removeAll("[L*") > 0) { + if (imports.removeAll("[*") > 0) { imports.add("com.threerings.io.TypedArray"); } @@ -459,8 +460,8 @@ public class GenServiceTask extends InvocationTask // change Foo$Bar to Foo_Bar imports.translateInnerClasses(); - // use a typed array for any arrays of objects - if (imports.removeAll("[L*") > 0) { + imports.replace("[B", "flash.utils.ByteArray"); + if (imports.removeAll("[*") > 0) { imports.add("com.threerings.io.TypedArray"); }