Fixed same package removal to not also wipe out subpackages
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5052 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -126,6 +126,22 @@ public class ImportSet
|
||||
return removeAll("[*");
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all classes that are in the same package.
|
||||
* @param pkg package to remove
|
||||
*/
|
||||
public void removeSamePackage (String pkg)
|
||||
{
|
||||
Iterator<String> i = _imports.iterator();
|
||||
while (i.hasNext()) {
|
||||
String name = i.next();
|
||||
if (name.startsWith(pkg) &&
|
||||
name.indexOf('.', pkg.length() + 1) == -1) {
|
||||
i.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces inner class imports (those with a '$') with an import of the parent class.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user