The import munging rabbit hole goes a little deeper...
* We can't just removeGlobals for actionscript services because that will nuke lovingly hacked things like ByteArray, so instead remove primitive stuff that got added as argument types. * Prevent a crash in ImportSet if the first import in our list has no group. This was uncovered by genservice in orth. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6681 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -383,8 +383,13 @@ public class GenServiceTask extends InvocationTask
|
|||||||
// change imports of Foo$Bar to Foo_Bar
|
// change imports of Foo$Bar to Foo_Bar
|
||||||
imports.translateInnerClasses();
|
imports.translateInnerClasses();
|
||||||
|
|
||||||
// marshallers just use the built-in actionscript classes in place of byte, short, etc
|
// Boolean is built in
|
||||||
imports.removeGlobals();
|
imports.remove("boolean");
|
||||||
|
|
||||||
|
// int is used for these
|
||||||
|
imports.remove("byte");
|
||||||
|
imports.remove("short");
|
||||||
|
imports.remove("char");
|
||||||
|
|
||||||
// convert java bases and primitives
|
// convert java bases and primitives
|
||||||
ActionScriptUtils.convertBaseClasses(imports);
|
ActionScriptUtils.convertBaseClasses(imports);
|
||||||
|
|||||||
@@ -236,6 +236,11 @@ public class ImportSet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void remove (String name)
|
||||||
|
{
|
||||||
|
_imports.remove(name);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the name of a class from the imports.
|
* Removes the name of a class from the imports.
|
||||||
* @param clazz the class whose name should be removed
|
* @param clazz the class whose name should be removed
|
||||||
@@ -348,7 +353,7 @@ public class ImportSet
|
|||||||
});
|
});
|
||||||
List<List<String>> result = Lists.newArrayList();
|
List<List<String>> result = Lists.newArrayList();
|
||||||
List<String> current = null;
|
List<String> current = null;
|
||||||
int lastGroup = -1;
|
int lastGroup = -2;
|
||||||
for (String imp : list) {
|
for (String imp : list) {
|
||||||
int group = findImportGroup(imp, groups);
|
int group = findImportGroup(imp, groups);
|
||||||
if (group != lastGroup) {
|
if (group != lastGroup) {
|
||||||
|
|||||||
Reference in New Issue
Block a user