Skip to content

Commit

Permalink
Resolve warnings in workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
Godin committed Jan 14, 2013
1 parent ee2d687 commit 051ed37
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
23 changes: 20 additions & 3 deletions jacoco-maven-plugin/src/org/jacoco/maven/FileFilter.java
Expand Up @@ -8,15 +8,18 @@
* Contributors:
* Evgeny Mandrikov - initial API and implementation
* Kyle Lieber - implementation of CheckMojo
*
*
*******************************************************************************/
package org.jacoco.maven;

import java.util.List;

import org.apache.commons.collections.CollectionUtils;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.StringUtils;

import java.io.File;
import java.io.IOException;
import java.util.List;

/**
* A file filter using includes/excludes patterns.
*/
Expand All @@ -41,6 +44,20 @@ public FileFilter(final List<String> includes, final List<String> excludes) {
this.excludes = excludes;
}

/**
* Returns a list of files.
*
* @param directory
* the directory to scan
* @return a list of files
* @throws IOException
*/
@SuppressWarnings("unchecked")
public List<String> getFileNames(final File directory) throws IOException {
return FileUtils.getFileNames(directory, getIncludes(), getExcludes(),
false);
}

/**
* Get the includes pattern
*
Expand Down
6 changes: 2 additions & 4 deletions jacoco-maven-plugin/src/org/jacoco/maven/InstrumentMojo.java
Expand Up @@ -47,10 +47,8 @@ public void executeMojo() throws MojoExecutionException,

final List<String> fileNames;
try {
final FileFilter fileFilter = new FileFilter(this.getIncludes(),
this.getExcludes());
fileNames = FileUtils.getFileNames(classesDir,
fileFilter.getIncludes(), fileFilter.getExcludes(), false);
fileNames = new FileFilter(this.getIncludes(),
this.getExcludes()).getFileNames(classesDir);
} catch (final IOException e1) {
throw new MojoExecutionException(
"Unable to get list of files to instrument.", e1);
Expand Down

0 comments on commit 051ed37

Please sign in to comment.