Fix service generation for classes that use java.lang.Integer. Some day I will clean this up and fix the big TODO. It probably isn't actually that hard now I know more.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6059 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user