} catch (final IOException e1) {
throw new MojoExecutionException(
"Unable to get list of files to instrument.", e1);
}
final Instrumenter instrumenter = new Instrumenter(
new OfflineInstrumentationAccessGenerator());
for (final String fileName : fileNames) {
if (fileName.endsWith(".class")) {
final File source = new File(classesDir, fileName);
final File backup = new File(originalClassesDir, fileName);
InputStream input = null;
OutputStream output = null;
try {
FileUtils.copyFile(source, backup);
input = new FileInputStream(backup);
output = new FileOutputStream(source);
instrumenter.instrument(input, output, source.getPath());
} catch (final IOException e2) {
throw new MojoExecutionException(
"Unable to instrument file.", e2);
} finally {
IOUtil.close(input);