diff --git a/src/java/com/threerings/presents/tools/GenServiceTask.java b/src/java/com/threerings/presents/tools/GenServiceTask.java index fc5496f98..c4b30c74f 100644 --- a/src/java/com/threerings/presents/tools/GenServiceTask.java +++ b/src/java/com/threerings/presents/tools/GenServiceTask.java @@ -322,6 +322,9 @@ public class GenServiceTask extends InvocationTask ".client.", ".data."); imports.popIn(); + // convert java primitive types to ooo util types + imports.replace(Integer.class, "com.threerings.util.Integer"); + // get rid of java.lang stuff and any remaining primitives imports.removeGlobals(); diff --git a/src/java/com/threerings/presents/tools/ImportSet.java b/src/java/com/threerings/presents/tools/ImportSet.java index 5797eefc2..33147e243 100644 --- a/src/java/com/threerings/presents/tools/ImportSet.java +++ b/src/java/com/threerings/presents/tools/ImportSet.java @@ -264,6 +264,16 @@ public class ImportSet _imports.addAll(toAdd); } + /** + * Replace the import matchings a class name. + * @param pattern the class whose name to match + * @param replacement string to use instead + */ + public void replace (Class pattern, String replacement) + { + replace(pattern.getName(), replacement); + } + /** * Remove all imports matching the given pattern. * @param pattern the dumbed down regex to match (see description above)