Patch from Jamie to ensure GenService still finds all the array parameters for importing.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5069 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -181,6 +181,9 @@ public class GenServiceTask extends InvocationTask
|
|||||||
imports.add(InvocationResponseEvent.class);
|
imports.add(InvocationResponseEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// import classes contained in arrays
|
||||||
|
imports.translateClassArrays();
|
||||||
|
|
||||||
// get rid of java.lang stuff and primitives
|
// get rid of java.lang stuff and primitives
|
||||||
imports.removeGlobals();
|
imports.removeGlobals();
|
||||||
|
|
||||||
@@ -453,6 +456,9 @@ public class GenServiceTask extends InvocationTask
|
|||||||
imports.add(InvocationDispatcher.class);
|
imports.add(InvocationDispatcher.class);
|
||||||
imports.add(InvocationException.class);
|
imports.add(InvocationException.class);
|
||||||
|
|
||||||
|
// import classes contained in arrays
|
||||||
|
imports.translateClassArrays();
|
||||||
|
|
||||||
// get rid of primitives and java.lang types
|
// get rid of primitives and java.lang types
|
||||||
imports.removeGlobals();
|
imports.removeGlobals();
|
||||||
|
|
||||||
@@ -518,6 +524,9 @@ public class GenServiceTask extends InvocationTask
|
|||||||
imports.add(InvocationException.class);
|
imports.add(InvocationException.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// import classes contained in arrays
|
||||||
|
imports.translateClassArrays();
|
||||||
|
|
||||||
// get rid of primitives and java.lang types
|
// get rid of primitives and java.lang types
|
||||||
imports.removeGlobals();
|
imports.removeGlobals();
|
||||||
|
|
||||||
|
|||||||
@@ -180,6 +180,25 @@ public class ImportSet
|
|||||||
|
|
||||||
addAll(inner);
|
addAll(inner);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inserts imports for the non-primitive classes contained in all array imports.
|
||||||
|
*/
|
||||||
|
public void translateClassArrays ()
|
||||||
|
{
|
||||||
|
ImportSet arrayTypes = new ImportSet();
|
||||||
|
Iterator<String> i = _imports.iterator();
|
||||||
|
while (i.hasNext()) {
|
||||||
|
String name = i.next();
|
||||||
|
int bracket = name.lastIndexOf('[');
|
||||||
|
if (bracket != -1 &&
|
||||||
|
name.charAt(bracket + 1) == 'L') {
|
||||||
|
arrayTypes.add(name.substring(bracket + 2, name.length() - 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addAll(arrayTypes);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Temporarily remove one import matching the given pattern. The most recently pushed pattern
|
* Temporarily remove one import matching the given pattern. The most recently pushed pattern
|
||||||
|
|||||||
Reference in New Issue
Block a user