return srcPaths;
} catch (ClassNotFoundException e) {
e.printStackTrace();
return srcPaths;
}
ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(ManagementFactory.getOperatingSystemMXBean().getAvailableProcessors());
try {
File instrumenterFile = new File(instrumenterFileName);
instrumenterFile.delete();
instrumenter.open(instrumenterFile, true);
List<Future<File>> futures = new ArrayList<Future<File>>();
for (File file: srcPaths) {
String path = file.getPath();
if (path.matches(".*/ofbiz[^/]*\\.(jar|zip)")) {
futures.add(executor.submit(new FileInstrumenter(instrumenter, file)));
} else {
futures.add(new ConstantFutureFile(file));
}
}
List<File> result = new ArrayList<File>(futures.size());
for (Future<File> future: futures) {
result.add(future.get());
}
instrumenter.close();
return result;
} catch (ExecutionException e) {
e.printStackTrace();
return srcPaths;
} catch (InterruptedException e) {
e.printStackTrace();
return srcPaths;
} catch (IOException e) {
e.printStackTrace();
return srcPaths;
} finally {
executor.shutdown();
}
}