}
GlobPatternMapper m = new GlobPatternMapper();
m.setFrom(ext);
m.setTo("*.class");
SourceFileScanner sfs = new SourceFileScanner(this);
if (ext.equals("*.java"))
{
File[] newFiles = sfs.restrictAsFiles(files, srcDir, destDir, m);
if (newFiles.length > 0)
{
File[] newCompileList = new File[compileList.length + newFiles.length];
System.arraycopy(compileList, 0, newCompileList, 0, compileList.length);
System.arraycopy(newFiles, 0, newCompileList, compileList.length,
newFiles.length);
compileList = newCompileList;
}
}
else
{
String [] newSources = sfs.restrict(files, srcDir, destDir, m);
int extLen = ext.length() - 1; // strip wildcard
if (newSources.length > 0)
{
File[] newCompileList = new File[compileList.length + newSources.length];
System.arraycopy(compileList, 0, newCompileList, 0, compileList.length);