Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Apply generics + forEach loops

git-svn-id: https://svn.apache.org/repos/asf/maven/shared/trunk@1397327 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit 4886be85f40eb4496f83754adf0651a858cffb08 1 parent f9523ba
@rfscholte rfscholte authored
View
11 ...tering/src/main/java/org/apache/maven/shared/filtering/AbstractMavenFilteringRequest.java
@@ -19,14 +19,13 @@
* under the License.
*/
-import org.apache.maven.execution.MavenSession;
-import org.apache.maven.project.MavenProject;
-
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Properties;
-import java.util.Set;
+
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.project.MavenProject;
/**
* @since 1.0-beta-3
@@ -239,7 +238,7 @@ public void setEscapeString( String escapeString )
/**
* @since 1.0-beta-2
*/
- public List getProjectStartExpressions()
+ public List<String> getProjectStartExpressions()
{
return projectStartExpressions;
}
@@ -248,7 +247,7 @@ public List getProjectStartExpressions()
* @param projectStartExpressions
* @since 1.0-beta-2
*/
- public void setProjectStartExpressions( List projectStartExpressions )
+ public void setProjectStartExpressions( List<String> projectStartExpressions )
{
this.projectStartExpressions = projectStartExpressions;
}
View
32 maven-filtering/src/main/java/org/apache/maven/shared/filtering/DefaultMavenFileFilter.java
@@ -19,9 +19,21 @@
* under the License.
*/
+import java.io.File;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Properties;
+
import org.apache.maven.execution.MavenSession;
import org.apache.maven.project.MavenProject;
import org.apache.maven.settings.Settings;
+import org.apache.maven.shared.utils.StringUtils;
+import org.apache.maven.shared.utils.io.FileUtils;
+import org.apache.maven.shared.utils.io.FileUtils.FilterWrapper;
import org.codehaus.plexus.interpolation.InterpolationPostProcessor;
import org.codehaus.plexus.interpolation.PrefixAwareRecursionInterceptor;
import org.codehaus.plexus.interpolation.PrefixedObjectValueSource;
@@ -32,20 +44,8 @@
import org.codehaus.plexus.interpolation.ValueSource;
import org.codehaus.plexus.interpolation.multi.MultiDelimiterStringSearchInterpolator;
import org.codehaus.plexus.logging.AbstractLogEnabled;
-import org.apache.maven.shared.utils.io.FileUtils;
-import org.apache.maven.shared.utils.StringUtils;
import org.sonatype.plexus.build.incremental.BuildContext;
-import java.io.File;
-import java.io.IOException;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Properties;
-
/**
* @author Olivier Lamy
*
@@ -81,7 +81,7 @@ public void copyFile( File from, File to, boolean filtering, MavenProject mavenP
public void copyFile( MavenFileFilterRequest mavenFileFilterRequest )
throws MavenFilteringException
{
- List filterWrappers = getDefaultFilterWrappers( mavenFileFilterRequest );
+ List<FilterWrapper> filterWrappers = getDefaultFilterWrappers( mavenFileFilterRequest );
copyFile( mavenFileFilterRequest.getFrom(), mavenFileFilterRequest.getTo(),
mavenFileFilterRequest.isFiltering(), filterWrappers, mavenFileFilterRequest.getEncoding() );
@@ -212,7 +212,8 @@ public void copyFile( File from, File to, boolean filtering, List<FileUtils.Filt
{
if ( request.isInjectProjectBuildFilters() )
{
- List<String> buildFilters = new ArrayList( request.getMavenProject().getBuild().getFilters() );
+ @SuppressWarnings( "unchecked" )
+ List<String> buildFilters = new ArrayList<String>( request.getMavenProject().getBuild().getFilters() );
buildFilters.removeAll( request.getFileFilters() );
loadProperties( filterProperties, buildFilters, baseProps );
@@ -270,9 +271,8 @@ protected void loadProperties( Properties filterProperties, List<String> propert
Properties workProperties = new Properties();
workProperties.putAll( baseProps );
- for ( Iterator iterator = propertiesFilePaths.iterator(); iterator.hasNext(); )
+ for ( String filterFile : propertiesFilePaths )
{
- String filterFile = (String) iterator.next();
if ( StringUtils.isEmpty( filterFile ) )
{
// skip empty file name
View
2  maven-filtering/src/main/java/org/apache/maven/shared/filtering/MavenResourcesFiltering.java
@@ -69,7 +69,7 @@ void filterResources( List<Resource> resources, File outputDirectory, String enc
*
* @return {@link List} of {@link String}
*/
- List getDefaultNonFilteredFileExtensions();
+ List<String> getDefaultNonFilteredFileExtensions();
/**
* @param fileName the file name
View
29 ...a/org/apache/maven/shared/filtering/MultiDelimiterInterpolatorFilterReaderLineEnding.java
@@ -19,19 +19,18 @@
* under the License.
*/
-import org.codehaus.plexus.interpolation.InterpolationException;
-import org.codehaus.plexus.interpolation.Interpolator;
-import org.codehaus.plexus.interpolation.RecursionInterceptor;
-import org.codehaus.plexus.interpolation.SimpleRecursionInterceptor;
-import org.codehaus.plexus.interpolation.multi.DelimiterSpecification;
-
import java.io.BufferedReader;
import java.io.FilterReader;
import java.io.IOException;
import java.io.Reader;
-import java.util.HashSet;
-import java.util.Iterator;
import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.codehaus.plexus.interpolation.InterpolationException;
+import org.codehaus.plexus.interpolation.Interpolator;
+import org.codehaus.plexus.interpolation.RecursionInterceptor;
+import org.codehaus.plexus.interpolation.SimpleRecursionInterceptor;
+import org.codehaus.plexus.interpolation.multi.DelimiterSpecification;
/**
* A FilterReader implementation, that works with Interpolator interface instead of it's own interpolation
@@ -87,7 +86,7 @@
*/
private boolean preserveEscapeString = false;
- private LinkedHashSet delimiters = new LinkedHashSet();
+ private LinkedHashSet<DelimiterSpecification> delimiters = new LinkedHashSet<DelimiterSpecification>();
private String beginToken;
@@ -149,12 +148,11 @@ public boolean removeDelimiterSpec( String delimiterSpec )
return delimiters.remove( DelimiterSpecification.parse( delimiterSpec ) );
}
- public MultiDelimiterInterpolatorFilterReaderLineEnding setDelimiterSpecs( HashSet specs )
+ public MultiDelimiterInterpolatorFilterReaderLineEnding setDelimiterSpecs( Set<String> specs )
{
delimiters.clear();
- for ( Iterator it = specs.iterator(); it.hasNext(); )
+ for ( String spec : specs )
{
- String spec = (String) it.next();
delimiters.add( DelimiterSpecification.parse( spec ) );
markLength += spec.length() * 2;
}
@@ -275,9 +273,8 @@ public int read()
// have we found a delimiter?
int max = 0;
- for ( Iterator it = delimiters.iterator(); it.hasNext(); )
+ for ( DelimiterSpecification spec : delimiters )
{
- DelimiterSpecification spec = (DelimiterSpecification) it.next();
String begin = spec.getBegin();
// longest match wins
@@ -491,10 +488,8 @@ private void calculateMarkLength()
markLength += escapeString.length();
}
- for ( Iterator it = delimiters.iterator(); it.hasNext(); )
+ for ( DelimiterSpecification spec : delimiters )
{
-
- DelimiterSpecification spec = (DelimiterSpecification) it.next();
markLength += spec.getBegin().length();
markLength += spec.getEnd().length();
View
8 ...filtering/src/test/java/org/apache/maven/shared/filtering/DefaultMavenFileFilterTest.java
@@ -110,11 +110,11 @@ public void testMultiFilterFileInheritance()
File testDir = new File(getBasedir(), "src/test/units-files/MSHARED-177");
- List filters = new ArrayList();
+ List<String> filters = new ArrayList<String>();
- filters.add(new File(testDir, "first_filter_file.properties").getAbsolutePath());
- filters.add(new File(testDir, "second_filter_file.properties").getAbsolutePath());
- filters.add(new File(testDir, "third_filter_file.properties").getAbsolutePath());
+ filters.add( new File( testDir, "first_filter_file.properties" ).getAbsolutePath() );
+ filters.add( new File( testDir, "second_filter_file.properties" ).getAbsolutePath() );
+ filters.add( new File( testDir, "third_filter_file.properties" ).getAbsolutePath() );
final Properties filterProperties = new Properties();
View
78 ...g/src/test/java/org/apache/maven/shared/filtering/DefaultMavenResourcesFilteringTest.java
@@ -79,16 +79,16 @@ public void testSimpleFiltering()
File initialImageFile = new File( unitFilesDir, "happy_duke.gif" );
Resource resource = new Resource();
- List resources = new ArrayList();
+ List<Resource> resources = new ArrayList<Resource>();
resources.add( resource );
resource.setDirectory( unitFilesDir );
resource.setFiltering( true );
- List filtersFile = new ArrayList();
+ List<String> filtersFile = new ArrayList<String>();
filtersFile.add(
getBasedir() + "/src/test/units-files/maven-resources-filtering/empty-maven-resources-filtering.txt" );
- List nonFilteredFileExtensions = Collections.singletonList( "gif" );
+ List<String> nonFilteredFileExtensions = Collections.singletonList( "gif" );
mavenResourcesFiltering.filterResources( resources, outputDirectory, mavenProject, "UTF-8", filtersFile,
nonFilteredFileExtensions, new StubMavenSession() );
@@ -108,12 +108,12 @@ public void testSessionFiltering()
String unitFilesDir = getBasedir() + "/src/test/units-files/session-filtering";
Resource resource = new Resource();
- List resources = new ArrayList();
+ List<Resource> resources = new ArrayList<Resource>();
resources.add( resource );
resource.setDirectory( unitFilesDir );
resource.setFiltering( true );
- List filtersFile = new ArrayList();
+ List<String> filtersFile = new ArrayList<String>();
Settings settings = new Settings();
settings.setLocalRepository(
@@ -122,7 +122,7 @@ public void testSessionFiltering()
MavenSession session = new StubMavenSession( settings );
mavenResourcesFiltering.filterResources( resources, outputDirectory, mavenProject, "UTF-8", filtersFile,
- Collections.EMPTY_LIST, session );
+ Collections.<String>emptyList(), session );
Properties result = new Properties();
FileInputStream in = null;
@@ -161,16 +161,16 @@ public void testWithMavenResourcesExecution()
File initialImageFile = new File( unitFilesDir, "happy_duke.gif" );
Resource resource = new Resource();
- List resources = new ArrayList();
+ List<Resource> resources = new ArrayList<Resource>();
resources.add( resource );
resource.setDirectory( unitFilesDir );
resource.setFiltering( true );
- List filtersFile = new ArrayList();
+ List<String> filtersFile = new ArrayList<String>();
filtersFile.add(
getBasedir() + "/src/test/units-files/maven-resources-filtering/empty-maven-resources-filtering.txt" );
- List nonFilteredFileExtensions = Collections.singletonList( "gif" );
+ List<String> nonFilteredFileExtensions = Collections.singletonList( "gif" );
MavenResourcesExecution mavenResourcesExecution =
new MavenResourcesExecution( resources, outputDirectory, mavenProject, "UTF-8", filtersFile,
nonFilteredFileExtensions, new StubMavenSession() );
@@ -199,16 +199,16 @@ public void testWithMavenResourcesExecutionWithAdditionnalProperties()
File initialImageFile = new File( unitFilesDir, "happy_duke.gif" );
Resource resource = new Resource();
- List resources = new ArrayList();
+ List<Resource> resources = new ArrayList<Resource>();
resources.add( resource );
resource.setDirectory( unitFilesDir );
resource.setFiltering( true );
- List filtersFile = new ArrayList();
+ List<String> filtersFile = new ArrayList<String>();
filtersFile.add(
getBasedir() + "/src/test/units-files/maven-resources-filtering/empty-maven-resources-filtering.txt" );
- List nonFilteredFileExtensions = Collections.singletonList( "gif" );
+ List<String> nonFilteredFileExtensions = Collections.singletonList( "gif" );
Properties additionalProperties = new Properties();
additionalProperties.put( "greatDate", "1973-06-14" );
additionalProperties.put( "pom.version", "99.00" );
@@ -313,16 +313,16 @@ public void testAddingTokens()
File initialImageFile = new File( unitFilesDir, "happy_duke.gif" );
Resource resource = new Resource();
- List resources = new ArrayList();
+ List<Resource> resources = new ArrayList<Resource>();
resources.add( resource );
resource.setDirectory( unitFilesDir );
resource.setFiltering( true );
- List filtersFile = new ArrayList();
+ List<String> filtersFile = new ArrayList<String>();
filtersFile.add(
getBasedir() + "/src/test/units-files/maven-resources-filtering/empty-maven-resources-filtering.txt" );
- List nonFilteredFileExtensions = Collections.singletonList( "gif" );
+ List<String> nonFilteredFileExtensions = Collections.singletonList( "gif" );
MavenResourcesExecution mavenResourcesExecution =
new MavenResourcesExecution( resources, outputDirectory, mavenProject, "UTF-8", null,
@@ -355,13 +355,13 @@ public void testNoFiltering()
File initialImageFile = new File( unitFilesDir, "happy_duke.gif" );
Resource resource = new Resource();
- List resources = new ArrayList();
+ List<Resource> resources = new ArrayList<Resource>();
resources.add( resource );
resource.setDirectory( unitFilesDir );
resource.setFiltering( false );
mavenResourcesFiltering.filterResources( resources, outputDirectory, mavenProject, "UTF-8", null,
- Collections.EMPTY_LIST, new StubMavenSession() );
+ Collections.<String>emptyList(), new StubMavenSession() );
assertEquals( 7, outputDirectory.listFiles().length );
Properties result =
@@ -432,19 +432,19 @@ public void testIncludeOneFile()
String unitFilesDir = getBasedir() + "/src/test/units-files/maven-resources-filtering";
Resource resource = new Resource();
- List resources = new ArrayList();
+ List<Resource> resources = new ArrayList<Resource>();
resources.add( resource );
resource.setDirectory( unitFilesDir );
resource.setFiltering( true );
resource.addInclude( "includ*" );
- List filtersFile = new ArrayList();
+ List<String> filtersFile = new ArrayList<String>();
filtersFile.add(
getBasedir() + "/src/test/units-files/maven-resources-filtering/empty-maven-resources-filtering.txt" );
MavenResourcesExecution mavenResourcesExecution =
new MavenResourcesExecution( resources, outputDirectory, mavenProject, "UTF-8", filtersFile,
- Collections.EMPTY_LIST, new StubMavenSession() );
+ Collections.<String>emptyList(), new StubMavenSession() );
mavenResourcesFiltering.filterResources( mavenResourcesExecution );
File[] files = outputDirectory.listFiles();
@@ -468,20 +468,20 @@ public void testIncludeOneFileAndDirectory()
String unitFilesDir = getBasedir() + "/src/test/units-files/maven-resources-filtering";
Resource resource = new Resource();
- List resources = new ArrayList();
+ List<Resource> resources = new ArrayList<Resource>();
resources.add( resource );
resource.setDirectory( unitFilesDir );
resource.setFiltering( true );
resource.addInclude( "includ*" );
resource.addInclude( "**/includ*" );
- List filtersFile = new ArrayList();
+ List<String> filtersFile = new ArrayList<String>();
filtersFile.add(
getBasedir() + "/src/test/units-files/maven-resources-filtering/empty-maven-resources-filtering.txt" );
MavenResourcesExecution mavenResourcesExecution =
new MavenResourcesExecution( resources, outputDirectory, mavenProject, "UTF-8", filtersFile,
- Collections.EMPTY_LIST, new StubMavenSession() );
+ Collections.<String>emptyList(), new StubMavenSession() );
mavenResourcesFiltering.filterResources( mavenResourcesExecution );
File[] files = outputDirectory.listFiles();
@@ -509,20 +509,20 @@ public void testExcludeOneFile()
String unitFilesDir = getBasedir() + "/src/test/units-files/maven-resources-filtering";
Resource resource = new Resource();
- List resources = new ArrayList();
+ List<Resource> resources = new ArrayList<Resource>();
resources.add( resource );
resource.setDirectory( unitFilesDir );
resource.setFiltering( true );
resource.addExclude( "*.gif" );
resource.addExclude( "**/excludedir/**" );
- List filtersFile = new ArrayList();
+ List<String> filtersFile = new ArrayList<String>();
filtersFile.add(
getBasedir() + "/src/test/units-files/maven-resources-filtering/empty-maven-resources-filtering.txt" );
MavenResourcesExecution mavenResourcesExecution =
new MavenResourcesExecution( resources, outputDirectory, mavenProject, "UTF-8", filtersFile,
- Collections.EMPTY_LIST, new StubMavenSession() );
+ Collections.<String>emptyList(), new StubMavenSession() );
mavenResourcesFiltering.filterResources( mavenResourcesExecution );
File[] files = outputDirectory.listFiles();
@@ -555,7 +555,7 @@ public void testTargetAbsolutePath()
String unitFilesDir = getBasedir() + "/src/test/units-files/maven-resources-filtering";
Resource resource = new Resource();
- List resources = new ArrayList();
+ List<Resource> resources = new ArrayList<Resource>();
resources.add( resource );
resource.setDirectory( unitFilesDir );
resource.setFiltering( true );
@@ -573,13 +573,13 @@ public void testTargetAbsolutePath()
{
FileUtils.cleanDirectory( targetPathFile );
}
- List filtersFile = new ArrayList();
+ List<String> filtersFile = new ArrayList<String>();
filtersFile.add(
getBasedir() + "/src/test/units-files/maven-resources-filtering/empty-maven-resources-filtering.txt" );
MavenResourcesExecution mavenResourcesExecution =
new MavenResourcesExecution( resources, outputDirectory, mavenProject, "UTF-8", filtersFile,
- Collections.EMPTY_LIST, new StubMavenSession() );
+ Collections.<String>emptyList(), new StubMavenSession() );
mavenResourcesFiltering.filterResources( mavenResourcesExecution );
File[] files = targetPathFile.listFiles();
@@ -602,19 +602,19 @@ public void testTargetPath()
String unitFilesDir = getBasedir() + "/src/test/units-files/maven-resources-filtering";
Resource resource = new Resource();
- List resources = new ArrayList();
+ List<Resource> resources = new ArrayList<Resource>();
resources.add( resource );
resource.setDirectory( unitFilesDir );
resource.setFiltering( true );
resource.addInclude( "includ*" );
resource.setTargetPath( "testTargetPath" );
- List filtersFile = new ArrayList();
+ List<String> filtersFile = new ArrayList<String>();
filtersFile.add(
getBasedir() + "/src/test/units-files/maven-resources-filtering/empty-maven-resources-filtering.txt" );
MavenResourcesExecution mavenResourcesExecution =
new MavenResourcesExecution( resources, outputDirectory, mavenProject, "UTF-8", filtersFile,
- Collections.EMPTY_LIST, new StubMavenSession() );
+ Collections.<String>emptyList(), new StubMavenSession() );
mavenResourcesFiltering.filterResources( mavenResourcesExecution );
File targetPathFile = new File( outputDirectory, "testTargetPath" );
@@ -636,17 +636,17 @@ public void testEmptyDirectories()
MavenResourcesFiltering mavenResourcesFiltering =
(MavenResourcesFiltering) lookup( MavenResourcesFiltering.class.getName() );
- List resources = new ArrayList();
+ List<Resource> resources = new ArrayList<Resource>();
resources.add( new Resource()
{
{
setDirectory( getBasedir() + "/src/test/units-files/includeEmptyDirs" );
- setExcludes( Arrays.asList( new String[]{ "**/.gitignore" } ) );
+ setExcludes( Arrays.asList( "**/.gitignore" ) );
}
} );
MavenResourcesExecution mavenResourcesExecution =
new MavenResourcesExecution( resources, outputDirectory, mavenProject, "UTF-8", Collections.EMPTY_LIST,
- Collections.EMPTY_LIST, new StubMavenSession() );
+ Collections.<String>emptyList(), new StubMavenSession() );
mavenResourcesExecution.setIncludeEmptyDirs( true );
mavenResourcesFiltering.filterResources( mavenResourcesExecution );
@@ -700,7 +700,7 @@ public void testMSHARED81()
MavenResourcesFiltering mavenResourcesFiltering =
(MavenResourcesFiltering) lookup( MavenResourcesFiltering.class.getName() );
- List resources = new ArrayList();
+ List<Resource> resources = new ArrayList<Resource>();
resources.add( new Resource()
{
{
@@ -718,7 +718,7 @@ public void testMSHARED81()
File output = new File( outputDirectory, "MSHARED-81" );
MavenResourcesExecution mavenResourcesExecution =
new MavenResourcesExecution( resources, output, mavenProject, "UTF-8", Collections.EMPTY_LIST,
- Collections.EMPTY_LIST, new StubMavenSession() );
+ Collections.<String>emptyList(), new StubMavenSession() );
mavenResourcesExecution.setIncludeEmptyDirs( true );
mavenResourcesExecution.setEscapeString( "\\" );
@@ -764,7 +764,7 @@ public void testEdgeCases()
MavenResourcesFiltering mavenResourcesFiltering =
(MavenResourcesFiltering) lookup( MavenResourcesFiltering.class.getName() );
- List resources = new ArrayList();
+ List<Resource> resources = new ArrayList<Resource>();
resources.add( new Resource()
{
{
@@ -782,7 +782,7 @@ public void testEdgeCases()
File output = new File( outputDirectory, "edge-cases" );
MavenResourcesExecution mavenResourcesExecution =
new MavenResourcesExecution( resources, output, mavenProject, "UTF-8", Collections.EMPTY_LIST,
- Collections.EMPTY_LIST, new StubMavenSession() );
+ Collections.<String>emptyList(), new StubMavenSession() );
mavenResourcesExecution.setIncludeEmptyDirs( true );
mavenResourcesExecution.setEscapeString( "\\" );
View
6 maven-filtering/src/test/java/org/apache/maven/shared/filtering/EscapeStringTest.java
@@ -72,14 +72,14 @@ public void testEscape()
.getName() );
Resource resource = new Resource();
- List resources = new ArrayList();
+ List<Resource> resources = new ArrayList<Resource>();
resources.add( resource );
resource.setDirectory( unitDirectory.getPath() );
resource.setFiltering( true );
- List filtersFile = new ArrayList();
+ List<String> filtersFile = new ArrayList<String>();
- List nonFilteredFileExtensions = Collections.singletonList( "gif" );
+ List<String> nonFilteredFileExtensions = Collections.singletonList( "gif" );
MavenResourcesExecution mavenResourcesExecution = new MavenResourcesExecution( resources, outputDirectory,
mavenProject, "UTF-8",
View
17 ...ing/src/test/java/org/apache/maven/shared/filtering/IncrementalResourceFilteringTest.java
@@ -28,11 +28,12 @@
import java.util.HashSet;
import java.util.List;
import java.util.Properties;
+import java.util.Set;
import org.apache.maven.model.Resource;
-import org.codehaus.plexus.PlexusTestCase;
import org.apache.maven.shared.utils.io.FileUtils;
import org.apache.maven.shared.utils.io.IOUtil;
+import org.codehaus.plexus.PlexusTestCase;
import org.sonatype.plexus.build.incremental.ThreadBuildContext;
import org.sonatype.plexus.build.incremental.test.TestIncrementalBuildContext;
@@ -65,7 +66,7 @@ public void testSimpleIncrementalFiltering()
assertTime( "time", "file02.txt" );
// only one file is expected to change
- HashSet changedFiles = new HashSet();
+ Set<String> changedFiles = new HashSet<String>();
changedFiles.add( "file01.txt" );
TestIncrementalBuildContext ctx = new TestIncrementalBuildContext( unitDirectory, changedFiles, new HashMap() );
@@ -78,7 +79,7 @@ public void testSimpleIncrementalFiltering()
assertTrue( ctx.getRefreshFiles().contains( new File( outputDirectory, "file01.txt" ) ) );
// one file is expected to be deleted
- HashSet deletedFiles = new HashSet();
+ Set<String> deletedFiles = new HashSet<String>();
deletedFiles.add( "file01.txt" );
ctx = new TestIncrementalBuildContext( unitDirectory, new HashSet(), changedFiles, new HashMap() );
@@ -99,7 +100,7 @@ public void testOutputChange()
filter( "time" );
// all files are reprocessed after contents of output directory changed (e.g. was deleted)
- HashSet changedFiles = new HashSet();
+ Set<String> changedFiles = new HashSet<String>();
changedFiles.add( "target/IncrementalResourceFilteringTest" );
TestIncrementalBuildContext ctx = new TestIncrementalBuildContext( unitDirectory, changedFiles, new HashMap() );
ThreadBuildContext.setThreadBuildContext( ctx );
@@ -120,7 +121,7 @@ public void testFilterChange()
filter( "time" );
// all files are reprocessed after content of filters changes
- HashSet changedFiles = new HashSet();
+ Set<String> changedFiles = new HashSet<String>();
changedFiles.add( "filters.txt" );
TestIncrementalBuildContext ctx = new TestIncrementalBuildContext( unitDirectory, changedFiles, new HashMap() );
ThreadBuildContext.setThreadBuildContext( ctx );
@@ -141,7 +142,7 @@ public void testFilterDeleted()
filter( "time" );
// all files are reprocessed after content of filters changes
- HashSet deletedFiles = new HashSet();
+ Set<String> deletedFiles = new HashSet<String>();
deletedFiles.add( "filters.txt" );
TestIncrementalBuildContext ctx =
new TestIncrementalBuildContext( unitDirectory, new HashSet(), deletedFiles, new HashMap() );
@@ -192,12 +193,12 @@ private void filter( String time )
String unitFilesDir = new File( unitDirectory, "files" ).getPath();
Resource resource = new Resource();
- List resources = new ArrayList();
+ List<Resource> resources = new ArrayList<Resource>();
resources.add( resource );
resource.setDirectory( unitFilesDir );
resource.setFiltering( true );
- List filtersFile = new ArrayList();
+ List<String> filtersFile = new ArrayList<String>();
filtersFile.add( new File( unitDirectory, "filters.txt" ).getPath() );
mavenResourcesFiltering.filterResources( resources, outputDirectory, mavenProject, "UTF-8", filtersFile,
View
6 ...src/test/java/org/apache/maven/shared/filtering/MuliLinesMavenResourcesFilteringTest.java
@@ -76,15 +76,15 @@ public void testFilteringTokenOnce()
String unitFilesDir = getBasedir() + "/src/test/units-files/MRESOURCES-104";
Resource resource = new Resource();
- List resources = new ArrayList();
+ List<Resource> resources = new ArrayList<Resource>();
resources.add( resource );
resource.setDirectory( unitFilesDir );
resource.setFiltering( true );
- List filtersFile = new ArrayList();
+ List<String> filtersFile = new ArrayList<String>();
filtersFile.add( getBasedir() + "/src/test/units-files/MRESOURCES-104/test.properties" );
- List nonFilteredFileExtensions = Collections.singletonList( "gif" );
+ List<String> nonFilteredFileExtensions = Collections.singletonList( "gif" );
MavenResourcesExecution mavenResourcesExecution = new MavenResourcesExecution( resources, outputDirectory,
mavenProject, "UTF-8",
Please sign in to comment.
Something went wrong with that request. Please try again.