maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1479169 - in /maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly: archive/ archive/phase/ archive/phase/wrappers/ archive/task/ artifact/ filter/ format/ interpolation/ io/
Date Sat, 04 May 2013 20:01:46 GMT
Author: krosenvold
Date: Sat May  4 20:01:45 2013
New Revision: 1479169

URL: http://svn.apache.org/r1479169
Log:
Java 5 stuff

Modified:
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/DefaultAssemblyArchiver.java
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/ManifestCreationFinalizer.java
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/DependencySetAssemblyPhase.java
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/FileItemAssemblyPhase.java
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/RepositoryAssemblyPhase.java
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/wrappers/RepoInfoWrapper.java
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddDependencySetsTask.java
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddFileSetsTask.java
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolver.java
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/AbstractLineAggregatingHandler.java
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/ComponentsXmlArchiverFileFilter.java
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/SimpleAggregatingDescriptorHandler.java
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/format/FileSetFormatter.java
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/interpolation/AssemblyInterpolator.java
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/io/DefaultAssemblyReader.java

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/DefaultAssemblyArchiver.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/DefaultAssemblyArchiver.java?rev=1479169&r1=1479168&r2=1479169&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/DefaultAssemblyArchiver.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/DefaultAssemblyArchiver.java
Sat May  4 20:01:45 2013
@@ -233,24 +233,21 @@ public class DefaultAssemblyArchiver
         final List<ContainerDescriptorHandler> handlers = new ArrayList<ContainerDescriptorHandler>();
         final List<String> hints = new ArrayList<String>();
 
-        if ( ( requestedContainerDescriptorHandlers != null ) && !requestedContainerDescriptorHandlers.isEmpty()
)
+        if ( !requestedContainerDescriptorHandlers.isEmpty() )
         {
-            for ( final Iterator<ContainerDescriptorHandlerConfig> it = requestedContainerDescriptorHandlers.iterator();
it.hasNext(); )
+            for ( final ContainerDescriptorHandlerConfig config : requestedContainerDescriptorHandlers
)
             {
-                final ContainerDescriptorHandlerConfig config = it.next();
-
                 final String hint = config.getHandlerName();
                 final ContainerDescriptorHandler handler = containerDescriptorHandlers.get(
hint );
 
                 if ( handler == null )
                 {
                     throw new InvalidAssemblerConfigurationException(
-                                                                      "Cannot find ContainerDescriptorHandler
with hint: "
-                                                                          + hint );
+                        "Cannot find ContainerDescriptorHandler with hint: " + hint );
                 }
 
-                getLogger().debug( "Found container descriptor handler with hint: " + hint
+ " (component: " + handler
-                                       + ")" );
+                getLogger().debug(
+                    "Found container descriptor handler with hint: " + hint + " (component:
" + handler + ")" );
 
                 if ( config.getConfiguration() != null )
                 {
@@ -434,8 +431,8 @@ public class DefaultAssemblyArchiver
                     PlexusConfiguration.class, ExpressionEvaluator.class, (Class<?>)
containerRealm[1],
                     ConfigurationListener.class } );
 
-            configureComponent.invoke( configurator, new Object[] { component, configuration,
expressionEvaluator,
-                containerRealm[0], listener } );
+            configureComponent.invoke( configurator, component, configuration, expressionEvaluator,
containerRealm[0],
+                                       listener );
         }
         catch ( final NoSuchMethodException e )
         {

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/ManifestCreationFinalizer.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/ManifestCreationFinalizer.java?rev=1479169&r1=1479168&r2=1479169&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/ManifestCreationFinalizer.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/ManifestCreationFinalizer.java
Sat May  4 20:01:45 2013
@@ -133,10 +133,10 @@ public class ManifestCreationFinalizer
                     return Collections.singletonList( "META-INF/MANIFEST.MF" );
                 }
             }
-            catch ( final ManifestException e )
+            catch ( final ManifestException ignore )
             {
             }
-            catch ( final DependencyResolutionRequiredException e )
+            catch ( final DependencyResolutionRequiredException ignore )
             {
             }
         }

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/DependencySetAssemblyPhase.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/DependencySetAssemblyPhase.java?rev=1479169&r1=1479168&r2=1479169&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/DependencySetAssemblyPhase.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/DependencySetAssemblyPhase.java
Sat May  4 20:01:45 2013
@@ -51,6 +51,7 @@ public class DependencySetAssemblyPhase
     @Requirement
     private ArchiverManager archiverManager;
 
+    @SuppressWarnings( "UnusedDeclaration" )
     public DependencySetAssemblyPhase()
     {
         // used for plexus init

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/FileItemAssemblyPhase.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/FileItemAssemblyPhase.java?rev=1479169&r1=1479168&r2=1479169&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/FileItemAssemblyPhase.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/FileItemAssemblyPhase.java
Sat May  4 20:01:45 2013
@@ -20,7 +20,6 @@ package org.apache.maven.plugin.assembly
  */
 
 import java.io.File;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
@@ -59,10 +58,8 @@ public class FileItemAssemblyPhase
         final File basedir = configSource.getBasedir();
 
         final FileFormatter fileFormatter = new FileFormatter( configSource, getLogger()
);
-        for ( final Iterator<FileItem> i = fileList.iterator(); i.hasNext(); )
+        for ( final FileItem fileItem : fileList )
         {
-            final FileItem fileItem = i.next();
-
             final String sourcePath = fileItem.getSource();
 
             // ensure source file is in absolute path for reactor build to work
@@ -77,9 +74,8 @@ public class FileItemAssemblyPhase
                 source = new File( basedir, sourcePath );
             }
 
-            source =
-                fileFormatter.format( source, fileItem.isFiltered(), fileItem.getLineEnding(),
-                                      configSource.getEncoding() );
+            source = fileFormatter.format( source, fileItem.isFiltered(), fileItem.getLineEnding(),
+                                           configSource.getEncoding() );
 
             String destName = fileItem.getDestName();
 
@@ -110,7 +106,8 @@ public class FileItemAssemblyPhase
 
             try
             {
-                archiver.addFile( source, target, TypeConversionUtils.modeToInt( fileItem.getFileMode(),
getLogger() ) );
+                archiver.addFile( source, target,
+                                  TypeConversionUtils.modeToInt( fileItem.getFileMode(),
getLogger() ) );
             }
             catch ( final ArchiverException e )
             {

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/RepositoryAssemblyPhase.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/RepositoryAssemblyPhase.java?rev=1479169&r1=1479168&r2=1479169&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/RepositoryAssemblyPhase.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/RepositoryAssemblyPhase.java
Sat May  4 20:01:45 2013
@@ -20,7 +20,6 @@ package org.apache.maven.plugin.assembly
  */
 
 import java.io.File;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
@@ -56,6 +55,7 @@ public class RepositoryAssemblyPhase
     @Requirement
     private RepositoryAssembler repositoryAssembler;
 
+    @SuppressWarnings( "UnusedDeclaration" )
     public RepositoryAssemblyPhase()
     {
         // used for plexus.
@@ -70,6 +70,7 @@ public class RepositoryAssemblyPhase
     /**
      * {@inheritDoc}
      */
+    @SuppressWarnings( "ResultOfMethodCallIgnored" )
     public void execute( final Assembly assembly, final Archiver archiver,
                          final AssemblerConfigurationSource configSource, final AssemblyContext
context )
         throws ArchiveCreationException, AssemblyFormattingException, InvalidAssemblerConfigurationException
@@ -78,10 +79,8 @@ public class RepositoryAssemblyPhase
 
         final File tempRoot = configSource.getTemporaryRootDirectory();
 
-        for ( final Iterator<Repository> i = repositoriesList.iterator(); i.hasNext();
)
+        for ( final Repository repository : repositoriesList )
         {
-            final Repository repository = i.next();
-
             final String outputDirectory =
                 AssemblyFormatUtils.getOutputDirectory( repository.getOutputDirectory(),
configSource.getProject(),
                                                         null, configSource.getFinalName(),
configSource );
@@ -96,7 +95,8 @@ public class RepositoryAssemblyPhase
             try
             {
                 getLogger().debug( "Assembling repository to: " + repositoryDirectory );
-                repositoryAssembler.buildRemoteRepository( repositoryDirectory, wrap( repository
), wrap( configSource ) );
+                repositoryAssembler.buildRemoteRepository( repositoryDirectory, wrap( repository
),
+                                                           wrap( configSource ) );
                 getLogger().debug( "Finished assembling repository to: " + repositoryDirectory
);
             }
             catch ( final RepositoryAssemblyException e )

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/wrappers/RepoInfoWrapper.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/wrappers/RepoInfoWrapper.java?rev=1479169&r1=1479168&r2=1479169&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/wrappers/RepoInfoWrapper.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/wrappers/RepoInfoWrapper.java
Sat May  4 20:01:45 2013
@@ -24,7 +24,6 @@ import org.apache.maven.plugin.assembly.
 import org.apache.maven.shared.repository.model.RepositoryInfo;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 /**
@@ -57,10 +56,8 @@ public class RepoInfoWrapper
             final List<GroupVersionAlignmentWrapper> l =
                 new ArrayList<GroupVersionAlignmentWrapper>( alignments.size() );
 
-            for ( final Iterator<GroupVersionAlignment> it = alignments.iterator();
it.hasNext(); )
+            for ( final GroupVersionAlignment alignment : alignments )
             {
-                final GroupVersionAlignment alignment = it.next();
-
                 l.add( new GroupVersionAlignmentWrapper( alignment ) );
             }
 

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddDependencySetsTask.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddDependencySetsTask.java?rev=1479169&r1=1479168&r2=1479169&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddDependencySetsTask.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddDependencySetsTask.java
Sat May  4 20:01:45 2013
@@ -117,10 +117,8 @@ public class AddDependencySetsTask
             logger.debug( "Project " + project.getId() + " has no dependencies. Skipping
dependency set addition." );
         }
 
-        for ( final Iterator<DependencySet> i = dependencySets.iterator(); i.hasNext();
)
+        for ( final DependencySet dependencySet : dependencySets )
         {
-            final DependencySet dependencySet = i.next();
-
             addDependencySet( dependencySet, archiver, configSource );
         }
     }
@@ -152,21 +150,19 @@ public class AddDependencySetsTask
 
         logger.debug( "Adding " + dependencyArtifacts.size() + " dependency artifacts." );
 
-        for ( final Iterator<Artifact> j = dependencyArtifacts.iterator(); j.hasNext();
)
+        for ( final Artifact depArtifact : dependencyArtifacts )
         {
-            final Artifact depArtifact = j.next();
-
             MavenProject depProject;
             try
             {
-                depProject =
-                    projectBuilder.buildFromRepository( depArtifact, configSource.getRemoteRepositories(),
-                                                        configSource.getLocalRepository()
);
+                depProject = projectBuilder.buildFromRepository( depArtifact, configSource.getRemoteRepositories(),
+                                                                 configSource.getLocalRepository()
);
             }
             catch ( final ProjectBuildingException e )
             {
-                logger.debug( "Error retrieving POM of module-dependency: " + depArtifact.getId()
+ "; Reason: "
-                                + e.getMessage() + "\n\nBuilding stub project instance."
);
+                logger.debug(
+                    "Error retrieving POM of module-dependency: " + depArtifact.getId() +
"; Reason: " + e.getMessage()
+                        + "\n\nBuilding stub project instance." );
 
                 depProject = buildProjectStub( depArtifact );
             }
@@ -203,7 +199,7 @@ public class AddDependencySetsTask
             mapping = defaultOutputFileNameMapping;
         }
 
-        if ( ( dir == null || dir.indexOf( "${" ) < 0 ) && ( mapping == null ||
mapping.indexOf( "${" ) < 0 ) )
+        if ( ( dir == null || !dir.contains( "${" ) ) && ( mapping == null || !mapping.contains(
"${" ) ) )
         {
             logger.warn( "NOTE: Your assembly specifies a dependencySet that matches multiple
artifacts, but specifies a concrete output format. "
                             + "THIS MAY RESULT IN ONE OR MORE ARTIFACTS BEING OBSCURED!\n\nOutput
directory: '"
@@ -212,6 +208,7 @@ public class AddDependencySetsTask
         }
     }
 
+    @SuppressWarnings( "ResultOfMethodCallIgnored" )
     private void addFilteredUnpackedArtifact( final DependencySet dependencySet, final Artifact
depArtifact,
                                               final MavenProject depProject, final Archiver
archiver,
                                               final AssemblerConfigurationSource configSource
)
@@ -396,18 +393,17 @@ public class AddDependencySetsTask
             final List<Artifact> attachments = project.getAttachedArtifacts();
             if ( attachments != null )
             {
-                for ( final Iterator<Artifact> attachmentIt = attachments.iterator();
attachmentIt.hasNext(); )
+                for ( final Artifact attachment : attachments )
                 {
-                    final Artifact attachment = attachmentIt.next();
-
                     if ( attachment.getFile() != null )
                     {
                         dependencyArtifacts.add( attachment );
                     }
                     else
                     {
-                        logger.warn( "Cannot include attached artifact: " + project.getId()
+ " for project: "
-                                        + project.getId() + "; it doesn't have an associated
file or directory." );
+                        logger.warn(
+                            "Cannot include attached artifact: " + project.getId() + " for
project: " + project.getId()
+                                + "; it doesn't have an associated file or directory." );
                     }
                 }
             }

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddFileSetsTask.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddFileSetsTask.java?rev=1479169&r1=1479168&r2=1479169&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddFileSetsTask.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddFileSetsTask.java
Sat May  4 20:01:45 2013
@@ -35,7 +35,6 @@ import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Iterator;
 import java.util.List;
 
 /**
@@ -87,10 +86,8 @@ public class AddFileSetsTask
             }
         }
 
-        for ( final Iterator<FileSet> i = fileSets.iterator(); i.hasNext(); )
+        for ( final FileSet fileSet : fileSets )
         {
-            final FileSet fileSet = i.next();
-
             addFileSet( fileSet, archiver, configSource, archiveBaseDir );
         }
     }
@@ -193,7 +190,7 @@ public class AddFileSetsTask
             sourceDirectory = basedir.getAbsolutePath();
         }
 
-        File fileSetDir = null;
+        File fileSetDir;
 
         if ( archiveBaseDir == null )
         {
@@ -230,11 +227,6 @@ public class AddFileSetsTask
         this.project = project;
     }
 
-    public MavenProject getModuleProject()
-    {
-        return moduleProject;
-    }
-
     public void setModuleProject( final MavenProject moduleProject )
     {
         this.moduleProject = moduleProject;

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolver.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolver.java?rev=1479169&r1=1479168&r2=1479169&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolver.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/artifact/DefaultDependencyResolver.java
Sat May  4 20:01:45 2013
@@ -138,10 +138,8 @@ public class DefaultDependencyResolver
 
         final List<Artifact> missing = new ArrayList<Artifact>();
         final Set<Artifact> resolved = new LinkedHashSet<Artifact>();
-        for ( final Iterator<Artifact> it = dependencyArtifacts.iterator(); it.hasNext();
)
+        for ( final Artifact depArtifact : dependencyArtifacts )
         {
-            final Artifact depArtifact = it.next();
-
             try
             {
                 resolver.resolve( depArtifact, repos, configSource.getLocalRepository() );
@@ -151,8 +149,8 @@ public class DefaultDependencyResolver
             {
                 if ( getLogger().isDebugEnabled() )
                 {
-                    getLogger().debug( "Failed to resolve: " + depArtifact.getId() + " for
assembly: "
-                                           + assembly.getId() );
+                    getLogger().debug(
+                        "Failed to resolve: " + depArtifact.getId() + " for assembly: " +
assembly.getId() );
                 }
                 missing.add( depArtifact );
             }
@@ -160,8 +158,8 @@ public class DefaultDependencyResolver
             {
                 if ( getLogger().isDebugEnabled() )
                 {
-                    getLogger().debug( "Failed to resolve: " + depArtifact.getId() + " for
assembly: "
-                                           + assembly.getId() );
+                    getLogger().debug(
+                        "Failed to resolve: " + depArtifact.getId() + " for assembly: " +
assembly.getId() );
                 }
                 missing.add( depArtifact );
             }
@@ -282,7 +280,8 @@ public class DefaultDependencyResolver
                     {
                         getDependencySetResolutionRequirements( assembly,
                                                                 ModuleSetAssemblyPhase.getDependencySets(
binaries ),
-                                                                requirements, projects.toArray(
new MavenProject[] {} ) );
+                                                                requirements,
+                                                                projects.toArray( new MavenProject[projects.size()]
) );
                     }
                 }
             }
@@ -375,16 +374,12 @@ public class DefaultDependencyResolver
         final List<ArtifactRepository> remoteRepos = new ArrayList<ArtifactRepository>();
         final Set<String> encounteredUrls = new HashSet<String>();
 
-        for ( final Iterator<List<ArtifactRepository>> listIterator = repoLists.iterator();
listIterator.hasNext(); )
+        for ( final List<ArtifactRepository> repositoryList : repoLists )
         {
-            final List<ArtifactRepository> repositoryList = listIterator.next();
-
             if ( ( repositoryList != null ) && !repositoryList.isEmpty() )
             {
-                for ( final Iterator<ArtifactRepository> it = repositoryList.iterator();
it.hasNext(); )
+                for ( final ArtifactRepository repo : repositoryList )
                 {
-                    final ArtifactRepository repo = it.next();
-
                     if ( !encounteredUrls.contains( repo.getUrl() ) )
                     {
                         remoteRepos.add( repo );

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/AbstractLineAggregatingHandler.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/AbstractLineAggregatingHandler.java?rev=1479169&r1=1479168&r2=1479169&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/AbstractLineAggregatingHandler.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/AbstractLineAggregatingHandler.java
Sat May  4 20:01:45 2013
@@ -158,7 +158,7 @@ public abstract class AbstractLineAggreg
         {
             reader = new BufferedReader( new InputStreamReader( fileInfo.getContents(), getEncoding()
) );
 
-            String line = null;
+            String line;
             while ( ( line = reader.readLine() ) != null )
             {
                 if ( !lines.contains( line ) )
@@ -173,14 +173,4 @@ public abstract class AbstractLineAggreg
         }
     }
 
-    protected final Map<String, List<String>> getCatalog()
-    {
-        return catalog;
-    }
-
-    protected final void setCatalog( final Map<String, List<String>> catalog
)
-    {
-        this.catalog = catalog;
-    }
-
 }

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/ComponentsXmlArchiverFileFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/ComponentsXmlArchiverFileFilter.java?rev=1479169&r1=1479168&r2=1479169&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/ComponentsXmlArchiverFileFilter.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/ComponentsXmlArchiverFileFilter.java
Sat May  4 20:01:45 2013
@@ -39,7 +39,6 @@ import java.io.OutputStreamWriter;
 import java.io.Reader;
 import java.io.Writer;
 import java.util.Collections;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -75,17 +74,14 @@ public class ComponentsXmlArchiverFileFi
         {
             final Xpp3Dom[] children = newDom.getChildren();
 
-            for ( int i = 0; i < children.length; i++ )
+            for ( final Xpp3Dom component : children )
             {
-                final Xpp3Dom component = children[i];
-
                 if ( components == null )
                 {
                     components = new LinkedHashMap<String, Xpp3Dom>();
                 }
 
-                final String role = component.getChild( "role" )
-                                             .getValue();
+                final String role = component.getChild( "role" ).getValue();
                 final Xpp3Dom child = component.getChild( "role-hint" );
                 final String roleHint = child != null ? child.getValue() : "";
 
@@ -134,10 +130,8 @@ public class ComponentsXmlArchiverFileFi
                 final Xpp3Dom componentDom = new Xpp3Dom( "components" );
                 dom.addChild( componentDom );
 
-                for ( final Iterator<Xpp3Dom> i = components.values()
-                                                            .iterator(); i.hasNext(); )
+                for ( final Xpp3Dom component : components.values() )
                 {
-                    final Xpp3Dom component = i.next();
                     componentDom.addChild( component );
                 }
 

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/SimpleAggregatingDescriptorHandler.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/SimpleAggregatingDescriptorHandler.java?rev=1479169&r1=1479168&r2=1479169&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/SimpleAggregatingDescriptorHandler.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/SimpleAggregatingDescriptorHandler.java
Sat May  4 20:01:45 2013
@@ -55,8 +55,6 @@ public class SimpleAggregatingDescriptor
 
     private String outputPath;
 
-    private final String commentChars = "#";
-
     // calculated, temporary values.
 
     private boolean overrideFilterAction;
@@ -107,12 +105,11 @@ public class SimpleAggregatingDescriptor
             // FIXME if it is a properties file, encoding should be ISO-8859-1
             writer = new FileWriter( f ); // platform encoding
 
+            String commentChars = "#";
             writer.write( commentChars + " Aggregated on " + new Date() + " from: " );
 
-            for ( final Iterator<String> it = filenames.iterator(); it.hasNext(); )
+            for ( final String filename : filenames )
             {
-                final String filename = it.next();
-
                 writer.write( "\n" + commentChars + " " + filename );
             }
 

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/format/FileSetFormatter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/format/FileSetFormatter.java?rev=1479169&r1=1479168&r2=1479169&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/format/FileSetFormatter.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/format/FileSetFormatter.java
Sat May  4 20:01:45 2013
@@ -45,6 +45,7 @@ public class FileSetFormatter
         this.logger = logger;
     }
 
+    @SuppressWarnings( "ResultOfMethodCallIgnored" )
     public File formatFileSetForAssembly( File fileSetDir, org.apache.maven.plugin.assembly.model.FileSet
set )
         throws AssemblyFormattingException, IOException
     {
@@ -84,10 +85,8 @@ public class FileSetFormatter
                 formattedDir.mkdirs();
 
                 FileFormatter fileFormatter = new FileFormatter( configSource, logger );
-                for ( int i = 0; i < files.length; i++ )
+                for ( String file : files )
                 {
-                    String file = files[i];
-                    
                     logger.debug( "Filtering: " + file );
 
                     File targetFile = new File( formattedDir, file );
@@ -97,9 +96,8 @@ public class FileSetFormatter
                     File sourceFile = new File( fileSetDir, file );
                     try
                     {
-                        sourceFile =
-                            fileFormatter.format( sourceFile, set.isFiltered(), lineEndingHint,
formattedDir,
-                                                  configSource.getEncoding() );
+                        sourceFile = fileFormatter.format( sourceFile, set.isFiltered(),
lineEndingHint, formattedDir,
+                                                           configSource.getEncoding() );
                         AssemblyFileUtils.copyFile( sourceFile, targetFile );
                     }
                     catch ( AssemblyFormattingException e )

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/interpolation/AssemblyInterpolator.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/interpolation/AssemblyInterpolator.java?rev=1479169&r1=1479168&r2=1479169&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/interpolation/AssemblyInterpolator.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/interpolation/AssemblyInterpolator.java
Sat May  4 20:01:45 2013
@@ -45,7 +45,6 @@ import java.io.File;
 import java.io.IOException;
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
 import java.util.Set;
@@ -127,15 +126,13 @@ public class AssemblyInterpolator
         {
             final StringBuilder sb = new StringBuilder();
 
-            sb.append( "One or more minor errors occurred while interpolating the assembly
with ID: "
-                            + assembly.getId() + ":\n" );
+            sb.append( "One or more minor errors occurred while interpolating the assembly
with ID: " ).append(
+                assembly.getId() ).append( ":\n" );
 
             @SuppressWarnings( "unchecked" )
             final List<ObjectInterpolationWarning> warnings = objectInterpolator.getWarnings();
-            for ( final Iterator<ObjectInterpolationWarning> it = warnings.iterator();
it.hasNext(); )
+            for ( final ObjectInterpolationWarning warning : warnings )
             {
-                final ObjectInterpolationWarning warning = it.next();
-
                 sb.append( '\n' ).append( warning );
             }
 

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/io/DefaultAssemblyReader.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/io/DefaultAssemblyReader.java?rev=1479169&r1=1479168&r2=1479169&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/io/DefaultAssemblyReader.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/io/DefaultAssemblyReader.java
Sat May  4 20:01:45 2013
@@ -32,7 +32,6 @@ import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
@@ -71,12 +70,17 @@ import org.codehaus.plexus.util.xml.pull
 /**
  * @version $Id$
  */
+@SuppressWarnings( "JavaDoc" )
 @org.codehaus.plexus.component.annotations.Component( role = AssemblyReader.class )
 public class DefaultAssemblyReader
     extends AbstractLogEnabled
     implements AssemblyReader
 {
 
+    public DefaultAssemblyReader()
+    {
+    }
+
     public List<Assembly> readAssemblies( final AssemblerConfigurationSource configSource
)
         throws AssemblyReadException, InvalidAssemblerConfigurationException
     {
@@ -112,19 +116,19 @@ public class DefaultAssemblyReader
         if ( ( descriptors != null ) && ( descriptors.length > 0 ) )
         {
             locator.setStrategies( strategies );
-            for ( int i = 0; i < descriptors.length; i++ )
+            for ( String descriptor1 : descriptors )
             {
-                getLogger().info( "Reading assembly descriptor: " + descriptors[i] );
-                addAssemblyFromDescriptor( descriptors[i], locator, configSource, assemblies
);
+                getLogger().info( "Reading assembly descriptor: " + descriptor1 );
+                addAssemblyFromDescriptor( descriptor1, locator, configSource, assemblies
);
             }
         }
 
         if ( ( descriptorRefs != null ) && ( descriptorRefs.length > 0 ) )
         {
             locator.setStrategies( refStrategies );
-            for ( int i = 0; i < descriptorRefs.length; i++ )
+            for ( String descriptorRef : descriptorRefs )
             {
-                addAssemblyForDescriptorReference( descriptorRefs[i], configSource, assemblies
);
+                addAssemblyForDescriptorReference( descriptorRef, configSource, assemblies
);
             }
         }
 
@@ -166,9 +170,9 @@ public class DefaultAssemblyReader
 
             if ( paths != null )
             {
-                for ( int i = 0; i < paths.length; i++ )
+                for ( String path : paths )
                 {
-                    addAssemblyFromDescriptor( paths[i], locator, configSource, assemblies
);
+                    addAssemblyFromDescriptor( path, locator, configSource, assemblies );
                 }
             }
         }
@@ -187,9 +191,8 @@ public class DefaultAssemblyReader
 
         // check unique IDs
         final Set<String> ids = new HashSet<String>();
-        for ( final Iterator<Assembly> i = assemblies.iterator(); i.hasNext(); )
+        for ( final Assembly assembly : assemblies )
         {
-            final Assembly assembly = i.next();
             if ( !ids.add( assembly.getId() ) )
             {
                 getLogger().warn( "The assembly id " + assembly.getId() + " is used more
than once." );
@@ -467,10 +470,8 @@ public class DefaultAssemblyReader
 
         final List<String> componentLocations = assembly.getComponentDescriptors();
 
-        for ( final Iterator<String> it = componentLocations.iterator(); it.hasNext();
)
+        for ( String location : componentLocations )
         {
-            String location = it.next();
-
             // allow expressions in path to component descriptor... MASSEMBLY-486
             try
             {
@@ -498,12 +499,12 @@ public class DefaultAssemblyReader
             catch ( final IOException e )
             {
                 throw new AssemblyReadException( "Error reading component descriptor: " +
location + " (resolved to: "
-                    + resolvedLocation.getSpecification() + ")", e );
+                                                     + resolvedLocation.getSpecification()
+ ")", e );
             }
             catch ( final XmlPullParserException e )
             {
                 throw new AssemblyReadException( "Error reading component descriptor: " +
location + " (resolved to: "
-                    + resolvedLocation.getSpecification() + ")", e );
+                                                     + resolvedLocation.getSpecification()
+ ")", e );
             }
             finally
             {
@@ -525,44 +526,36 @@ public class DefaultAssemblyReader
         final List<ContainerDescriptorHandlerConfig> containerHandlerDescriptors =
             component.getContainerDescriptorHandlers();
 
-        for ( final Iterator<ContainerDescriptorHandlerConfig> it = containerHandlerDescriptors.iterator();
it.hasNext(); )
+        for ( final ContainerDescriptorHandlerConfig cfg : containerHandlerDescriptors )
         {
-            final ContainerDescriptorHandlerConfig cfg = it.next();
             assembly.addContainerDescriptorHandler( cfg );
         }
 
         final List<DependencySet> dependencySetList = component.getDependencySets();
 
-        for ( final Iterator<DependencySet> it = dependencySetList.iterator(); it.hasNext();
)
+        for ( final DependencySet dependencySet : dependencySetList )
         {
-            final DependencySet dependencySet = it.next();
             assembly.addDependencySet( dependencySet );
         }
 
         final List<FileSet> fileSetList = component.getFileSets();
 
-        for ( final Iterator<FileSet> it = fileSetList.iterator(); it.hasNext(); )
+        for ( final FileSet fileSet : fileSetList )
         {
-            final FileSet fileSet = it.next();
-
             assembly.addFileSet( fileSet );
         }
 
         final List<FileItem> fileList = component.getFiles();
 
-        for ( final Iterator<FileItem> it = fileList.iterator(); it.hasNext(); )
+        for ( final FileItem fileItem : fileList )
         {
-            final FileItem fileItem = it.next();
-
             assembly.addFile( fileItem );
         }
 
         final List<Repository> repositoriesList = component.getRepositories();
 
-        for ( final Iterator<Repository> it = repositoriesList.iterator(); it.hasNext();
)
+        for ( final Repository repository : repositoriesList )
         {
-            final Repository repository = it.next();
-
             assembly.addRepository( repository );
         }
 



Mime
View raw message