You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kr...@apache.org on 2013/08/25 20:51:55 UTC

svn commit: r1517364 [2/3] - in /maven/plugins/trunk: maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/ maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/reader/ maven-eclipse-plugin/src/main/java/org/apache/maven/plu...

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseSpringBeansWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseSpringBeansWriter.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseSpringBeansWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseSpringBeansWriter.java Sun Aug 25 18:51:54 2013
@@ -93,18 +93,15 @@ public class MyEclipseSpringBeansWriter
         // maven's cwd stays at the top of hierarchical projects so we
         // do this with full path so it works as we descend through various modules (projects)
         File basedir = config.getEclipseProjectDirectory();
-        Iterator onConfigFiles =
-            getConfigurationFilesList( new File( basedir, (String) springConfig.get( "basedir" ) ),
-                                       (String) springConfig.get( "file-pattern" ) ).iterator();
 
-        while ( onConfigFiles.hasNext() )
-        {
-            String onConfigFileName = (String) onConfigFiles.next();
-            File onConfigFile = new File( onConfigFileName );
-            String relativeFileName = IdeUtils.toRelativeAndFixSeparator( basedir, onConfigFile, false );
+        for (Object o : getConfigurationFilesList(new File(basedir, (String) springConfig.get("basedir")),
+                (String) springConfig.get("file-pattern"))) {
+            String onConfigFileName = (String) o;
+            File onConfigFile = new File(onConfigFileName);
+            String relativeFileName = IdeUtils.toRelativeAndFixSeparator(basedir, onConfigFile, false);
 
-            writer.startElement( MYECLIPSE_SPRING_CONFIG );
-            writer.writeText( relativeFileName );
+            writer.startElement(MYECLIPSE_SPRING_CONFIG);
+            writer.writeText(relativeFileName);
             writer.endElement();
         }
         writer.endElement();
@@ -150,9 +147,8 @@ public class MyEclipseSpringBeansWriter
 
                 if ( subdirs != null )
                 {
-                    for ( int i = 0; i < subdirs.length; i++ )
-                    {
-                        configFiles.addAll( getConfigurationFilesList( subdirs[i], pattern ) );
+                    for (File subdir : subdirs) {
+                        configFiles.addAll(getConfigurationFilesList(subdir, pattern));
                     }
                 }
 

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadApplicationXMLWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadApplicationXMLWriter.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadApplicationXMLWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadApplicationXMLWriter.java Sun Aug 25 18:51:54 2013
@@ -158,9 +158,8 @@ public class RadApplicationXMLWriter
                                                     new String[] { "modules", "webModule" } );
 
             IdeDependency[] deps = config.getDeps();
-            for ( int index = 0; index < deps.length; index++ )
-            {
-                updateApplicationXml( applicationXmlDom, modulemapsXmlDom, deps[index] );
+            for (IdeDependency dep : deps) {
+                updateApplicationXml(applicationXmlDom, modulemapsXmlDom, dep);
             }
 
             removeUnusedEntries( applicationXmlDom, modulemapsXmlDom );
@@ -231,12 +230,10 @@ public class RadApplicationXMLWriter
     {
         String id = getIdFromMapping( mapping );
         Xpp3Dom[] children = applicationXmlDom.getChildren();
-        for ( int index = 0; index < children.length; index++ )
-        {
-            String childId = children[index].getAttribute( ID );
-            if ( childId != null && childId.equals( id ) )
-            {
-                return children[index];
+        for (Xpp3Dom aChildren : children) {
+            String childId = aChildren.getAttribute(ID);
+            if (childId != null && childId.equals(id)) {
+                return aChildren;
             }
         }
         return null;
@@ -395,32 +392,24 @@ public class RadApplicationXMLWriter
      */
     private void removeUnusedEntries( Xpp3Dom applicationXmlDom, Xpp3Dom modulemapsXmlDom )
     {
-        for ( int index = 0; index < this.modulemapsXmlDomChildren.length; index++ )
-        {
-            if ( this.modulemapsXmlDomChildren[index] != null )
-            {
+        for (Xpp3Dom aModulemapsXmlDomChildren : this.modulemapsXmlDomChildren) {
+            if (aModulemapsXmlDomChildren != null) {
                 Xpp3Dom[] newModulemapsXmlDomChildren = modulemapsXmlDom.getChildren();
-                for ( int newIndex = 0; newIndex < newModulemapsXmlDomChildren.length; newIndex++ )
-                {
-                    if ( ( newModulemapsXmlDomChildren[newIndex] != null )
-                        && ( newModulemapsXmlDomChildren[newIndex] == this.modulemapsXmlDomChildren[index] ) )
-                    {
-                        modulemapsXmlDom.removeChild( newIndex );
+                for (int newIndex = 0; newIndex < newModulemapsXmlDomChildren.length; newIndex++) {
+                    if ((newModulemapsXmlDomChildren[newIndex] != null)
+                            && (newModulemapsXmlDomChildren[newIndex] == aModulemapsXmlDomChildren)) {
+                        modulemapsXmlDom.removeChild(newIndex);
                         break;
                     }
                 }
             }
         }
-        for ( int index = 0; index < this.applicationXmlDomChildren.length; index++ )
-        {
-            if ( this.applicationXmlDomChildren[index] != null )
-            {
+        for (Xpp3Dom anApplicationXmlDomChildren : this.applicationXmlDomChildren) {
+            if (anApplicationXmlDomChildren != null) {
                 Xpp3Dom[] newApplicationXmlDomChildren = applicationXmlDom.getChildren();
-                for ( int newIndex = 0; newIndex < newApplicationXmlDomChildren.length; newIndex++ )
-                {
-                    if ( newApplicationXmlDomChildren[newIndex] == this.applicationXmlDomChildren[index] )
-                    {
-                        applicationXmlDom.removeChild( newIndex );
+                for (int newIndex = 0; newIndex < newApplicationXmlDomChildren.length; newIndex++) {
+                    if (newApplicationXmlDomChildren[newIndex] == anApplicationXmlDomChildren) {
+                        applicationXmlDom.removeChild(newIndex);
                         break;
                     }
                 }
@@ -503,10 +492,9 @@ public class RadApplicationXMLWriter
      */
     private String getContextRootFor( String artifactId )
     {
-        for ( int index = 0; index < webModulesFromPoms.length; index++ )
-        {
-            if ( webModulesFromPoms[index].getChild( "artifactId" ).getValue().equals( artifactId ) )
-                return new File( webModulesFromPoms[index].getChild( "contextRoot" ).getValue() ).getName();
+        for (Xpp3Dom webModulesFromPom : webModulesFromPoms) {
+            if (webModulesFromPom.getChild("artifactId").getValue().equals(artifactId))
+                return new File(webModulesFromPom.getChild("contextRoot").getValue()).getName();
         }
         return artifactId;
     }
@@ -527,7 +515,7 @@ public class RadApplicationXMLWriter
             log.info( Messages.getString( "EclipsePlugin.unchangedmanifest", xmlFile.getAbsolutePath() ) );
             return;
         }
-        Writer w = null;
+        Writer w;
         xmlFile.getParentFile().mkdirs();
         try
         {

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadEjbClasspathWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadEjbClasspathWriter.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadEjbClasspathWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadEjbClasspathWriter.java Sun Aug 25 18:51:54 2013
@@ -103,11 +103,9 @@ public class RadEjbClasspathWriter
             }
             Xpp3Dom classpath = readXMLFile( classpathFile );
             Xpp3Dom[] children = classpath.getChildren();
-            for ( int index = 0; index < children.length; index++ )
-            {
-                if ( LIB.equals( children[index].getAttribute( KIND ) )
-                    && TARGET_WEBSPHERE_CLASSES.equals( children[index].getAttribute( "path" ) ) )
-                {
+            for (Xpp3Dom aChildren : children) {
+                if (LIB.equals(aChildren.getAttribute(KIND))
+                        && TARGET_WEBSPHERE_CLASSES.equals(aChildren.getAttribute("path"))) {
                     return; // nothing to do!
                 }
             }
@@ -219,9 +217,8 @@ public class RadEjbClasspathWriter
             }
         } );
         Xpp3Dom resultClasspath = new Xpp3Dom( CLASSPATH );
-        for ( int index = 0; index < children.length; index++ )
-        {
-            resultClasspath.addChild( children[index] );
+        for (Xpp3Dom aChildren : children) {
+            resultClasspath.addChild(aChildren);
         }
         return resultClasspath;
     }

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadLibCopier.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadLibCopier.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadLibCopier.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadLibCopier.java Sun Aug 25 18:51:54 2013
@@ -79,19 +79,15 @@ public class RadLibCopier
         String[] oldFiles =
             FileUtils.getFilesFromExtension( destDir.getAbsolutePath(),
                                              new String[] { Constants.PROJECT_PACKAGING_JAR } );
-        for ( int index = 0; index < oldFiles.length; index++ )
-        {
-            if ( !new File( oldFiles[index] ).delete() )
-            {
-                log.error( Messages.getString( "Rad6LibCopier.cantdeletefile", new Object[] { oldFiles[index] } ) );
+        for (String oldFile : oldFiles) {
+            if (!new File(oldFile).delete()) {
+                log.error(Messages.getString("Rad6LibCopier.cantdeletefile", new Object[]{oldFile}));
             }
         }
-        for ( int index = 0; index < deps.length; index++ )
-        {
-            if ( !deps[index].isTestDependency() && !deps[index].isProvided() && !deps[index].isReferencedProject()
-                && !deps[index].isSystemScoped() )
-            {
-                copyFile( deps[index].getFile(), new File( destDir, deps[index].getFile().getName() ), log );
+        for (IdeDependency dep : deps) {
+            if (!dep.isTestDependency() && !dep.isProvided() && !dep.isReferencedProject()
+                    && !dep.isSystemScoped()) {
+                copyFile(dep.getFile(), new File(destDir, dep.getFile().getName()), log);
             }
         }
     }

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadManifestWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadManifestWriter.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadManifestWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadManifestWriter.java Sun Aug 25 18:51:54 2013
@@ -82,16 +82,14 @@ public class RadManifestWriter
 
         if ( metaInfBaseDirectory == null )
         {
-            for ( Iterator iterator = project.getResources().iterator(); iterator.hasNext(); )
-            {
-                metaInfBaseDirectory = ( (Resource) iterator.next() ).getDirectory();
+            for (Object o : project.getResources()) {
+                metaInfBaseDirectory = ((Resource) o).getDirectory();
 
-                File metaInfDirectoryFile = new File( metaInfBaseDirectory + File.separatorChar + META_INF_DIRECTORY );
+                File metaInfDirectoryFile = new File(metaInfBaseDirectory + File.separatorChar + META_INF_DIRECTORY);
 
-                log.debug( "Checking for existence of META-INF directory: " + metaInfDirectoryFile );
+                log.debug("Checking for existence of META-INF directory: " + metaInfDirectoryFile);
 
-                if ( metaInfDirectoryFile.exists() && !metaInfDirectoryFile.isDirectory() )
-                {
+                if (metaInfDirectoryFile.exists() && !metaInfDirectoryFile.isDirectory()) {
                     metaInfBaseDirectory = null;
                 }
             }
@@ -119,12 +117,8 @@ public class RadManifestWriter
         {
             boolean foundMetaInfBaseDirectory = false;
 
-            for ( int i = 0; i < sourceDirs.length; i++ )
-            {
-                EclipseSourceDir esd = sourceDirs[i];
-
-                if ( esd.getPath().equals( metaInfBaseDirectory ) )
-                {
+            for (EclipseSourceDir esd : sourceDirs) {
+                if (esd.getPath().equals(metaInfBaseDirectory)) {
                     foundMetaInfBaseDirectory = true;
                     break;
                 }

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadWebSettingsWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadWebSettingsWriter.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadWebSettingsWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadWebSettingsWriter.java Sun Aug 25 18:51:54 2013
@@ -182,27 +182,24 @@ public class RadWebSettingsWriter
         IdeDependency[] deps = config.getDeps();
         if ( deps != null )
         {
-            for ( int i = 0; i < deps.length; i++ )
-            {
-                final IdeDependency dependency = deps[i];
-                log.debug( "RadWebSettingsWriter: checking dependency " + dependency.toString() );
-
-                if ( dependency.isReferencedProject() && !dependency.isTestDependency() && !dependency.isProvided() )
-                {
-                    log.debug( "RadWebSettingsWriter: dependency " + dependency.toString()
-                        + " selected for inclusion as lib-module" );
+            for (final IdeDependency dependency : deps) {
+                log.debug("RadWebSettingsWriter: checking dependency " + dependency.toString());
+
+                if (dependency.isReferencedProject() && !dependency.isTestDependency() && !dependency.isProvided()) {
+                    log.debug("RadWebSettingsWriter: dependency " + dependency.toString()
+                            + " selected for inclusion as lib-module");
 
                     String depName = dependency.getEclipseProjectName();
                     String depJar = dependency.getArtifactId() + ".jar";
 
-                    writer.startElement( WEBSETTINGS_LIBMODULE );
+                    writer.startElement(WEBSETTINGS_LIBMODULE);
 
-                    writer.startElement( WEBSETTINGS_LM_JAR );
-                    writer.writeText( depJar );
+                    writer.startElement(WEBSETTINGS_LM_JAR);
+                    writer.writeText(depJar);
                     writer.endElement(); // jar
 
-                    writer.startElement( WEBSETTINGS_LM_PROJECT );
-                    writer.writeText( depName );
+                    writer.startElement(WEBSETTINGS_LM_PROJECT);
+                    writer.writeText(depName);
                     writer.endElement(); // project
 
                     writer.endElement(); // libmodule

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseSettingsWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseSettingsWriter.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseSettingsWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseSettingsWriter.java Sun Aug 25 18:51:54 2013
@@ -79,48 +79,40 @@ public class EclipseSettingsWriter
 			List compileSourceRoots = config.getProject().getCompileSourceRoots();
 			if ( compileSourceRoots != null )
 			{
-				Iterator it = compileSourceRoots.iterator();
-				while ( it.hasNext() )
-				{
-					String sourcePath = (String) it.next();
-                    String relativePath = IdeUtils.toRelativeAndFixSeparator( basedir, new File( sourcePath ), false );
-					coreSettings.put( PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding );
-				}
+                for (Object compileSourceRoot : compileSourceRoots) {
+                    String sourcePath = (String) compileSourceRoot;
+                    String relativePath = IdeUtils.toRelativeAndFixSeparator(basedir, new File(sourcePath), false);
+                    coreSettings.put(PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding);
+                }
 			}
 			List testCompileSourceRoots = config.getProject().getTestCompileSourceRoots();
             if ( testCompileSourceRoots != null )
 			{
-				Iterator it = testCompileSourceRoots.iterator();
-				while ( it.hasNext() )
-				{
-					String sourcePath = (String) it.next();
-                    String relativePath = IdeUtils.toRelativeAndFixSeparator( basedir, new File( sourcePath ), false );
-					coreSettings.put( PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding );
-				}
+                for (Object testCompileSourceRoot : testCompileSourceRoots) {
+                    String sourcePath = (String) testCompileSourceRoot;
+                    String relativePath = IdeUtils.toRelativeAndFixSeparator(basedir, new File(sourcePath), false);
+                    coreSettings.put(PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding);
+                }
 			}
 			List resources = config.getProject().getResources();
             if ( resources != null )
 			{
-				Iterator it = resources.iterator();
-				while ( it.hasNext() )
-				{
-					Resource resource = (Resource) it.next();
+                for (Object resource1 : resources) {
+                    Resource resource = (Resource) resource1;
                     String relativePath =
-                        IdeUtils.toRelativeAndFixSeparator( basedir, new File( resource.getDirectory() ), false );
-					coreSettings.put( PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding );
-				}
+                            IdeUtils.toRelativeAndFixSeparator(basedir, new File(resource.getDirectory()), false);
+                    coreSettings.put(PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding);
+                }
 			}
 			List testResources = config.getProject().getTestResources();
             if ( testResources != null )
 			{
-				Iterator it = testResources.iterator();
-				while ( it.hasNext() )
-				{
-					Resource resource = (Resource) it.next();
+                for (Object testResource : testResources) {
+                    Resource resource = (Resource) testResource;
                     String relativePath =
-                        IdeUtils.toRelativeAndFixSeparator( basedir, new File( resource.getDirectory() ), false );
-					coreSettings.put( PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding );
-				}
+                            IdeUtils.toRelativeAndFixSeparator(basedir, new File(resource.getDirectory()), false);
+                    coreSettings.put(PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding);
+                }
 			}
         }
 

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/EclipseWtpApplicationXMLWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/EclipseWtpApplicationXMLWriter.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/EclipseWtpApplicationXMLWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/EclipseWtpApplicationXMLWriter.java Sun Aug 25 18:51:54 2013
@@ -147,9 +147,8 @@ public class EclipseWtpApplicationXMLWri
                                                     new String[] { "modules", "webModule" } );
 
             IdeDependency[] deps = this.config.getDeps();
-            for ( int index = 0; index < deps.length; index++ )
-            {
-                updateApplicationXml( applicationXmlDom, modulemapsXmlDom, deps[index] );
+            for (IdeDependency dep : deps) {
+                updateApplicationXml(applicationXmlDom, modulemapsXmlDom, dep);
             }
 
             removeUnusedEntries( applicationXmlDom, modulemapsXmlDom );
@@ -205,31 +204,24 @@ public class EclipseWtpApplicationXMLWri
 
         String sourcePath = sourceDirectory.getAbsolutePath();
 
-        for ( int i = 0; i < files.length; i++ )
-        {
-            File file = files[i];
-
+        for (File file : files) {
             String dest = file.getAbsolutePath();
 
-            dest = dest.substring( sourcePath.length() + 1 );
+            dest = dest.substring(sourcePath.length() + 1);
 
-            File destination = new File( destinationDirectory, dest );
+            File destination = new File(destinationDirectory, dest);
 
-            if ( file.isFile() )
-            {
+            if (file.isFile()) {
                 destination = destination.getParentFile();
 
-                FileUtils.copyFileToDirectory( file, destination );
-            }
-            else if ( file.isDirectory() && !file.getName().equals( ".svn" ) && !file.getName().equals( "CVS" ) )
-            {
-                if ( !destination.exists() && !destination.mkdirs() )
-                {
-                    throw new IOException( "Could not create destination directory '" + destination.getAbsolutePath()
-                        + "'." );
+                FileUtils.copyFileToDirectory(file, destination);
+            } else if (file.isDirectory() && !file.getName().equals(".svn") && !file.getName().equals("CVS")) {
+                if (!destination.exists() && !destination.mkdirs()) {
+                    throw new IOException("Could not create destination directory '" + destination.getAbsolutePath()
+                            + "'.");
                 }
 
-                copyDirectoryStructure( file, destination );
+                copyDirectoryStructure(file, destination);
             }
         }
     }
@@ -294,12 +286,10 @@ public class EclipseWtpApplicationXMLWri
     {
         String id = getIdFromMapping( mapping );
         Xpp3Dom[] children = applicationXmlDom.getChildren();
-        for ( int index = 0; index < children.length; index++ )
-        {
-            String childId = children[index].getAttribute( EclipseWtpApplicationXMLWriter.ID );
-            if ( childId != null && childId.equals( id ) )
-            {
-                return children[index];
+        for (Xpp3Dom aChildren : children) {
+            String childId = aChildren.getAttribute(EclipseWtpApplicationXMLWriter.ID);
+            if (childId != null && childId.equals(id)) {
+                return aChildren;
             }
         }
         return null;
@@ -468,31 +458,23 @@ public class EclipseWtpApplicationXMLWri
      */
     private void removeUnusedEntries( Xpp3Dom applicationXmlDom, Xpp3Dom modulemapsXmlDom )
     {
-        for ( int index = 0; index < this.modulemapsXmlDomChildren.length; index++ )
-        {
-            if ( this.modulemapsXmlDomChildren[index] != null )
-            {
+        for (Xpp3Dom aModulemapsXmlDomChildren : this.modulemapsXmlDomChildren) {
+            if (aModulemapsXmlDomChildren != null) {
                 Xpp3Dom[] newModulemapsXmlDomChildren = modulemapsXmlDom.getChildren();
-                for ( int newIndex = 0; newIndex < newModulemapsXmlDomChildren.length; newIndex++ )
-                {
-                    if ( newModulemapsXmlDomChildren[newIndex] == this.modulemapsXmlDomChildren[index] )
-                    {
-                        modulemapsXmlDom.removeChild( newIndex );
+                for (int newIndex = 0; newIndex < newModulemapsXmlDomChildren.length; newIndex++) {
+                    if (newModulemapsXmlDomChildren[newIndex] == aModulemapsXmlDomChildren) {
+                        modulemapsXmlDom.removeChild(newIndex);
                         break;
                     }
                 }
             }
         }
-        for ( int index = 0; index < this.applicationXmlDomChildren.length; index++ )
-        {
-            if ( this.applicationXmlDomChildren[index] != null )
-            {
+        for (Xpp3Dom anApplicationXmlDomChildren : this.applicationXmlDomChildren) {
+            if (anApplicationXmlDomChildren != null) {
                 Xpp3Dom[] newApplicationXmlDomChildren = applicationXmlDom.getChildren();
-                for ( int newIndex = 0; newIndex < newApplicationXmlDomChildren.length; newIndex++ )
-                {
-                    if ( newApplicationXmlDomChildren[newIndex] == this.applicationXmlDomChildren[index] )
-                    {
-                        applicationXmlDom.removeChild( newIndex );
+                for (int newIndex = 0; newIndex < newApplicationXmlDomChildren.length; newIndex++) {
+                    if (newApplicationXmlDomChildren[newIndex] == anApplicationXmlDomChildren) {
+                        applicationXmlDom.removeChild(newIndex);
                         break;
                     }
                 }
@@ -578,15 +560,13 @@ public class EclipseWtpApplicationXMLWri
     {
         String artifactId = dependency.getArtifactId();
         String groupId = dependency.getGroupId();
-        for ( int index = 0; index < this.webModulesFromPoms.length; index++ )
-        {
-            Xpp3Dom webGroupId = this.webModulesFromPoms[index].getChild( "groupId" );
-            Xpp3Dom webArtifactId = this.webModulesFromPoms[index].getChild( "artifactId" );
-            Xpp3Dom webContextRoot = this.webModulesFromPoms[index].getChild( "contextRoot" );
+        for (Xpp3Dom webModulesFromPom : this.webModulesFromPoms) {
+            Xpp3Dom webGroupId = webModulesFromPom.getChild("groupId");
+            Xpp3Dom webArtifactId = webModulesFromPom.getChild("artifactId");
+            Xpp3Dom webContextRoot = webModulesFromPom.getChild("contextRoot");
 
-            if ( webContextRoot != null && webArtifactId != null && webArtifactId.getValue().equals( artifactId )
-                && webGroupId != null && webGroupId.getValue().equals( groupId ) )
-            {
+            if (webContextRoot != null && webArtifactId != null && webArtifactId.getValue().equals(artifactId)
+                    && webGroupId != null && webGroupId.getValue().equals(groupId)) {
                 return webContextRoot.getValue();
             }
         }
@@ -610,7 +590,7 @@ public class EclipseWtpApplicationXMLWri
             this.log.info( "Rad6CleanMojo.unchanged" + xmlFile.getAbsolutePath() );
             return;
         }
-        Writer w = null;
+        Writer w;
         xmlFile.getParentFile().mkdirs();
         try
         {

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/EclipseWtpComponentWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/EclipseWtpComponentWriter.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/EclipseWtpComponentWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/EclipseWtpComponentWriter.java Sun Aug 25 18:51:54 2013
@@ -159,14 +159,13 @@ public class EclipseWtpComponentWriter
             Xpp3Dom[] webResources =
                 IdeUtils.getPluginConfigurationDom( config.getProject(), JeeUtils.ARTIFACT_MAVEN_WAR_PLUGIN,
                                                     new String[] { "webResources", "resource" } );
-            for ( int index = 0; index < webResources.length; index++ )
-            {
-                File webResourceDirectory = new File( webResources[index].getChild( "directory" ).getValue() );
-                writer.startElement( ELT_WB_RESOURCE );
-                writer.addAttribute( ATTR_DEPLOY_PATH, "/" ); //$NON-NLS-1$
-                writer.addAttribute( ATTR_SOURCE_PATH,
-                                     IdeUtils.toRelativeAndFixSeparator( config.getEclipseProjectDirectory(),
-                                                                         webResourceDirectory, false ) );
+            for (Xpp3Dom webResource : webResources) {
+                File webResourceDirectory = new File(webResource.getChild("directory").getValue());
+                writer.startElement(ELT_WB_RESOURCE);
+                writer.addAttribute(ATTR_DEPLOY_PATH, "/"); //$NON-NLS-1$
+                writer.addAttribute(ATTR_SOURCE_PATH,
+                        IdeUtils.toRelativeAndFixSeparator(config.getEclipseProjectDirectory(),
+                                webResourceDirectory, false));
                 writer.endElement();
             }
 
@@ -204,16 +203,13 @@ public class EclipseWtpComponentWriter
 
         }
 
-        for ( int j = 0; j < sourceDirs.length; j++ )
-        {
-            EclipseSourceDir dir = sourceDirs[j];
+        for (EclipseSourceDir dir : sourceDirs) {
             // test src/resources are not added to wtpmodules
-            if ( !dir.isTest() )
-            {
+            if (!dir.isTest()) {
                 // <wb-resource deploy-path="/" source-path="/src/java" />
-                writer.startElement( ELT_WB_RESOURCE );
-                writer.addAttribute( ATTR_DEPLOY_PATH, target );
-                writer.addAttribute( ATTR_SOURCE_PATH, dir.getPath() );
+                writer.startElement(ELT_WB_RESOURCE);
+                writer.addAttribute(ATTR_DEPLOY_PATH, target);
+                writer.addAttribute(ATTR_SOURCE_PATH, dir.getPath());
                 writer.endElement();
             }
         }

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/EclipseWtpFacetsWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/EclipseWtpFacetsWriter.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/EclipseWtpFacetsWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/EclipseWtpFacetsWriter.java Sun Aug 25 18:51:54 2013
@@ -236,14 +236,12 @@ public class EclipseWtpFacetsWriter
             return;
         }
 
-        Iterator facetIterator = config.getProjectFacets().entrySet().iterator();
-        while ( facetIterator.hasNext() )
-        {
-            Entry facetEntry = (Entry) facetIterator.next();
+        for (Object o : config.getProjectFacets().entrySet()) {
+            Entry facetEntry = (Entry) o;
 
-            writer.startElement( ELT_INSTALLED );
-            writer.addAttribute( ATTR_FACET, (String) facetEntry.getKey() );
-            writer.addAttribute( ATTR_VERSION, (String) facetEntry.getValue() );
+            writer.startElement(ELT_INSTALLED);
+            writer.addAttribute(ATTR_FACET, (String) facetEntry.getKey());
+            writer.addAttribute(ATTR_VERSION, (String) facetEntry.getValue());
             writer.endElement(); // installed
         }
     }

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/AbstractIdeSupportMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/AbstractIdeSupportMojo.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/AbstractIdeSupportMojo.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/AbstractIdeSupportMojo.java Sun Aug 25 18:51:54 2013
@@ -543,7 +543,7 @@ public abstract class AbstractIdeSupport
                         createManagedVersionMap( getArtifactFactory(), project.getId(),
                                                  project.getDependencyManagement() );
 
-                    ArtifactResolutionResult artifactResolutionResult = null;
+                    ArtifactResolutionResult artifactResolutionResult;
 
                     try
                     {
@@ -580,54 +580,44 @@ public abstract class AbstractIdeSupport
                     // keep track of added reactor projects in order to avoid duplicates
                     Set emittedReactorProjectId = new HashSet();
 
-                    for ( Iterator i = artifactResolutionResult.getArtifactResolutionNodes().iterator(); i.hasNext(); )
-                    {
+                    for (Object o : artifactResolutionResult.getArtifactResolutionNodes()) {
 
-                        ResolutionNode node = (ResolutionNode) i.next();
+                        ResolutionNode node = (ResolutionNode) o;
                         int dependencyDepth = node.getDepth();
                         Artifact art = node.getArtifact();
                         // don't resolve jars for reactor projects
-                        if ( hasToResolveJar( art ) )
-                        {
-                            try
-                            {
-                                artifactResolver.resolve( art, node.getRemoteRepositories(), localRepository );
-                            }
-                            catch ( ArtifactNotFoundException e )
-                            {
-                                getLog().debug( e.getMessage(), e );
+                        if (hasToResolveJar(art)) {
+                            try {
+                                artifactResolver.resolve(art, node.getRemoteRepositories(), localRepository);
+                            } catch (ArtifactNotFoundException e) {
+                                getLog().debug(e.getMessage(), e);
                                 getLog().warn(
-                                               Messages.getString(
-                                                                   "AbstractIdeSupportMojo.artifactdownload", new Object[] { //$NON-NLS-1$
-                                                                   e.getGroupId(), e.getArtifactId(), e.getVersion(),
-                                                                       e.getMessage() } ) );
-                            }
-                            catch ( ArtifactResolutionException e )
-                            {
-                                getLog().debug( e.getMessage(), e );
+                                        Messages.getString(
+                                                "AbstractIdeSupportMojo.artifactdownload", new Object[]{ //$NON-NLS-1$
+                                                e.getGroupId(), e.getArtifactId(), e.getVersion(),
+                                                e.getMessage()}));
+                            } catch (ArtifactResolutionException e) {
+                                getLog().debug(e.getMessage(), e);
                                 getLog().warn(
-                                               Messages.getString(
-                                                                   "AbstractIdeSupportMojo.artifactresolution", new Object[] { //$NON-NLS-1$
-                                                                   e.getGroupId(), e.getArtifactId(), e.getVersion(),
-                                                                       e.getMessage() } ) );
+                                        Messages.getString(
+                                                "AbstractIdeSupportMojo.artifactresolution", new Object[]{ //$NON-NLS-1$
+                                                e.getGroupId(), e.getArtifactId(), e.getVersion(),
+                                                e.getMessage()}));
                             }
                         }
 
                         boolean includeArtifact = true;
-                        if ( getExcludes() != null )
-                        {
+                        if (getExcludes() != null) {
                             String artifactFullId = art.getGroupId() + ":" + art.getArtifactId();
-                            if ( getExcludes().contains( artifactFullId ) )
-                            {
-                                getLog().info( "excluded: " + artifactFullId );
+                            if (getExcludes().contains(artifactFullId)) {
+                                getLog().info("excluded: " + artifactFullId);
                                 includeArtifact = false;
                             }
                         }
 
-                        if ( includeArtifact
-                            && ( !( getUseProjectReferences() && isAvailableAsAReactorProject( art ) ) || emittedReactorProjectId.add( art.getGroupId()
-                                + '-' + art.getArtifactId() ) ) )
-                        {
+                        if (includeArtifact
+                                && (!(getUseProjectReferences() && isAvailableAsAReactorProject(art)) || emittedReactorProjectId.add(art.getGroupId()
+                                + '-' + art.getArtifactId()))) {
 
                             // the following doesn't work: art.getArtifactHandler().getPackaging() always returns "jar"
                             // also
@@ -642,38 +632,27 @@ public abstract class AbstractIdeSupport
                             // we need to check the manifest, if "Bundle-SymbolicName" is there the artifact can be
                             // considered
                             // an osgi bundle
-                            boolean isOsgiBundle = false;
+                            boolean isOsgiBundle;
                             String osgiSymbolicName = null;
-                            if ( art.getFile() != null )
-                            {
+                            if (art.getFile() != null) {
                                 JarFile jarFile = null;
-                                try
-                                {
-                                    jarFile = new JarFile( art.getFile(), false, ZipFile.OPEN_READ );
+                                try {
+                                    jarFile = new JarFile(art.getFile(), false, ZipFile.OPEN_READ);
 
                                     Manifest manifest = jarFile.getManifest();
-                                    if ( manifest != null )
-                                    {
+                                    if (manifest != null) {
                                         osgiSymbolicName =
-                                            manifest.getMainAttributes().getValue(
-                                                                                   new Attributes.Name(
-                                                                                                        "Bundle-SymbolicName" ) );
+                                                manifest.getMainAttributes().getValue(
+                                                        new Attributes.Name(
+                                                                "Bundle-SymbolicName"));
                                     }
-                                }
-                                catch ( IOException e )
-                                {
-                                    getLog().info( "Unable to read jar manifest from " + art.getFile() );
-                                }
-                                finally
-                                {
-                                    if ( jarFile != null )
-                                    {
-                                        try
-                                        {
+                                } catch (IOException e) {
+                                    getLog().info("Unable to read jar manifest from " + art.getFile());
+                                } finally {
+                                    if (jarFile != null) {
+                                        try {
                                             jarFile.close();
-                                        }
-                                        catch ( IOException e )
-                                        {
+                                        } catch (IOException e) {
                                             // ignore
                                         }
                                     }
@@ -683,18 +662,17 @@ public abstract class AbstractIdeSupport
                             isOsgiBundle = osgiSymbolicName != null;
 
                             IdeDependency dep =
-                                new IdeDependency( art.getGroupId(), art.getArtifactId(), art.getVersion(),
-                                                   art.getClassifier(), useProjectReference( art ),
-                                                   Artifact.SCOPE_TEST.equals( art.getScope() ),
-                                                   Artifact.SCOPE_SYSTEM.equals( art.getScope() ),
-                                                   Artifact.SCOPE_PROVIDED.equals( art.getScope() ),
-                                                   art.getArtifactHandler().isAddedToClasspath(), art.getFile(),
-                                                   art.getType(), isOsgiBundle, osgiSymbolicName, dependencyDepth,
-                                                   getProjectNameForArifact( art ) );
+                                    new IdeDependency(art.getGroupId(), art.getArtifactId(), art.getVersion(),
+                                            art.getClassifier(), useProjectReference(art),
+                                            Artifact.SCOPE_TEST.equals(art.getScope()),
+                                            Artifact.SCOPE_SYSTEM.equals(art.getScope()),
+                                            Artifact.SCOPE_PROVIDED.equals(art.getScope()),
+                                            art.getArtifactHandler().isAddedToClasspath(), art.getFile(),
+                                            art.getType(), isOsgiBundle, osgiSymbolicName, dependencyDepth,
+                                            getProjectNameForArifact(art));
                             // no duplicate entries allowed. System paths can cause this problem.
-                            if ( !dependencies.contains( dep ) )
-                            {
-                                dependencies.add( dep );
+                            if (!dependencies.contains(dep)) {
+                                dependencies.add(dep);
                             }
                         }
 
@@ -737,53 +715,46 @@ public abstract class AbstractIdeSupport
         // [MECLIPSE-388] Don't sort this, the order should be identical to getProject.getDependencies()
         Set artifacts = new LinkedHashSet();
 
-        for ( Iterator dependencies = getProject().getDependencies().iterator(); dependencies.hasNext(); )
-        {
-            Dependency dependency = (Dependency) dependencies.next();
+        for (Object o : getProject().getDependencies()) {
+            Dependency dependency = (Dependency) o;
 
             String groupId = dependency.getGroupId();
             String artifactId = dependency.getArtifactId();
             VersionRange versionRange;
-            try
-            {
-                versionRange = VersionRange.createFromVersionSpec( dependency.getVersion() );
-            }
-            catch ( InvalidVersionSpecificationException e )
-            {
+            try {
+                versionRange = VersionRange.createFromVersionSpec(dependency.getVersion());
+            } catch (InvalidVersionSpecificationException e) {
                 throw new MojoExecutionException(
-                                                  Messages.getString(
-                                                                      "AbstractIdeSupportMojo.unabletoparseversion", new Object[] { //$NON-NLS-1$
-                                                                      dependency.getArtifactId(),
-                                                                          dependency.getVersion(),
-                                                                          dependency.getManagementKey(), e.getMessage() } ),
-                                                  e );
+                        Messages.getString(
+                                "AbstractIdeSupportMojo.unabletoparseversion", new Object[]{ //$NON-NLS-1$
+                                dependency.getArtifactId(),
+                                dependency.getVersion(),
+                                dependency.getManagementKey(), e.getMessage()}),
+                        e);
             }
 
             String type = dependency.getType();
-            if ( type == null )
-            {
+            if (type == null) {
                 type = Constants.PROJECT_PACKAGING_JAR;
             }
             String classifier = dependency.getClassifier();
             boolean optional = dependency.isOptional();
             String scope = dependency.getScope();
-            if ( scope == null )
-            {
+            if (scope == null) {
                 scope = Artifact.SCOPE_COMPILE;
             }
 
             Artifact art =
-                getArtifactFactory().createDependencyArtifact( groupId, artifactId, versionRange, type, classifier,
-                                                               scope, optional );
+                    getArtifactFactory().createDependencyArtifact(groupId, artifactId, versionRange, type, classifier,
+                            scope, optional);
 
-            if ( scope.equalsIgnoreCase( Artifact.SCOPE_SYSTEM ) )
-            {
-                art.setFile( new File( dependency.getSystemPath() ) );
+            if (scope.equalsIgnoreCase(Artifact.SCOPE_SYSTEM)) {
+                art.setFile(new File(dependency.getSystemPath()));
             }
 
-            handleExclusions( art, dependency );
+            handleExclusions(art, dependency);
 
-            artifacts.add( art );
+            artifacts.add(art);
         }
 
         return artifacts;
@@ -799,10 +770,8 @@ public abstract class AbstractIdeSupport
     {
 
         List exclusions = new ArrayList();
-        for ( Iterator j = dependency.getExclusions().iterator(); j.hasNext(); )
-        {
-            Exclusion e = (Exclusion) j.next();
-            exclusions.add( e.getGroupId() + ":" + e.getArtifactId() ); //$NON-NLS-1$
+        for (Exclusion e : dependency.getExclusions()) {
+            exclusions.add(e.getGroupId() + ":" + e.getArtifactId()); //$NON-NLS-1$
         }
 
         ArtifactFilter newFilter = new ExcludesArtifactFilter( exclusions );
@@ -831,24 +800,19 @@ public abstract class AbstractIdeSupport
     {
         if ( reactorProjects != null )
         {
-            for ( Iterator iter = reactorProjects.iterator(); iter.hasNext(); )
-            {
-                MavenProject reactorProject = (MavenProject) iter.next();
+            for (Object reactorProject1 : reactorProjects) {
+                MavenProject reactorProject = (MavenProject) reactorProject1;
 
-                if ( reactorProject.getGroupId().equals( artifact.getGroupId() )
-                    && reactorProject.getArtifactId().equals( artifact.getArtifactId() ) )
-                {
-                    if ( reactorProject.getVersion().equals( artifact.getVersion() ) )
-                    {
+                if (reactorProject.getGroupId().equals(artifact.getGroupId())
+                        && reactorProject.getArtifactId().equals(artifact.getArtifactId())) {
+                    if (reactorProject.getVersion().equals(artifact.getVersion())) {
                         return reactorProject;
-                    }
-                    else
-                    {
+                    } else {
                         getLog().info(
-                                       "Artifact "
-                                           + artifact.getId()
-                                           + " already available as a reactor project, but with different version. Expected: "
-                                           + artifact.getVersion() + ", found: " + reactorProject.getVersion() );
+                                "Artifact "
+                                        + artifact.getId()
+                                        + " already available as a reactor project, but with different version. Expected: "
+                                        + artifact.getVersion() + ", found: " + reactorProject.getVersion());
                     }
                 }
             }
@@ -872,29 +836,23 @@ public abstract class AbstractIdeSupport
         if ( dependencyManagement != null && dependencyManagement.getDependencies() != null )
         {
             map = new HashMap();
-            for ( Iterator i = dependencyManagement.getDependencies().iterator(); i.hasNext(); )
-            {
-                Dependency d = (Dependency) i.next();
-
-                try
-                {
-                    VersionRange versionRange = VersionRange.createFromVersionSpec( d.getVersion() );
+            for (Dependency d : dependencyManagement.getDependencies()) {
+                try {
+                    VersionRange versionRange = VersionRange.createFromVersionSpec(d.getVersion());
                     Artifact artifact =
-                        artifactFactory.createDependencyArtifact( d.getGroupId(), d.getArtifactId(), versionRange,
-                                                                  d.getType(), d.getClassifier(), d.getScope(),
-                                                                  d.isOptional() );
-
-                    handleExclusions( artifact, d );
-                    map.put( d.getManagementKey(), artifact );
-                }
-                catch ( InvalidVersionSpecificationException e )
-                {
+                            artifactFactory.createDependencyArtifact(d.getGroupId(), d.getArtifactId(), versionRange,
+                                    d.getType(), d.getClassifier(), d.getScope(),
+                                    d.isOptional());
+
+                    handleExclusions(artifact, d);
+                    map.put(d.getManagementKey(), artifact);
+                } catch (InvalidVersionSpecificationException e) {
                     throw new MojoExecutionException(
-                                                      Messages.getString(
-                                                                          "AbstractIdeSupportMojo.unabletoparseversion", new Object[] { //$NON-NLS-1$
-                                                                          projectId, d.getVersion(),
-                                                                              d.getManagementKey(), e.getMessage() } ),
-                                                      e );
+                            Messages.getString(
+                                    "AbstractIdeSupportMojo.unabletoparseversion", new Object[]{ //$NON-NLS-1$
+                                    projectId, d.getVersion(),
+                                    d.getManagementKey(), e.getMessage()}),
+                            e);
                 }
             }
         }
@@ -940,89 +898,70 @@ public abstract class AbstractIdeSupport
         // local repository for reporting missing source jars
         List remoteRepos = includeRemoteRepositories ? getRemoteArtifactRepositories() : Collections.EMPTY_LIST;
 
-        for ( int j = 0; j < deps.length; j++ )
-        {
-            IdeDependency dependency = deps[j];
-
-            if ( dependency.isReferencedProject() || dependency.isSystemScoped() )
-            {
+        for (IdeDependency dependency : deps) {
+            if (dependency.isReferencedProject() || dependency.isSystemScoped()) {
                 // artifact not needed
                 continue;
             }
 
-            if ( getLog().isDebugEnabled() )
-            {
+            if (getLog().isDebugEnabled()) {
                 getLog().debug(
-                                "Searching for sources for " + dependency.getId() + ":" + dependency.getClassifier()
-                                    + " at " + dependency.getId() + ":" + inClassifier );
+                        "Searching for sources for " + dependency.getId() + ":" + dependency.getClassifier()
+                                + " at " + dependency.getId() + ":" + inClassifier);
             }
 
             Artifact baseArtifact =
-                artifactFactory.createArtifactWithClassifier( dependency.getGroupId(), dependency.getArtifactId(),
-                                                              dependency.getVersion(), dependency.getType(),
-                                                              dependency.getClassifier() );
+                    artifactFactory.createArtifactWithClassifier(dependency.getGroupId(), dependency.getArtifactId(),
+                            dependency.getVersion(), dependency.getType(),
+                            dependency.getClassifier());
             baseArtifact =
-                IdeUtils.resolveArtifact( artifactResolver, baseArtifact, remoteRepos, localRepository, getLog() );
-            if ( !baseArtifact.isResolved() )
-            {
+                    IdeUtils.resolveArtifact(artifactResolver, baseArtifact, remoteRepos, localRepository, getLog());
+            if (!baseArtifact.isResolved()) {
                 // base artifact does not exist - no point checking for javadoc/sources
                 continue;
             }
 
             Artifact artifact =
-                IdeUtils.createArtifactWithClassifier( dependency.getGroupId(), dependency.getArtifactId(),
-                                                       dependency.getVersion(), dependency.getClassifier(),
-                                                       inClassifier, artifactFactory );
-            File notAvailableMarkerFile = IdeUtils.getNotAvailableMarkerFile( localRepository, artifact );
+                    IdeUtils.createArtifactWithClassifier(dependency.getGroupId(), dependency.getArtifactId(),
+                            dependency.getVersion(), dependency.getClassifier(),
+                            inClassifier, artifactFactory);
+            File notAvailableMarkerFile = IdeUtils.getNotAvailableMarkerFile(localRepository, artifact);
 
-            if ( forceRecheck && notAvailableMarkerFile.exists() )
-            {
-                if ( !notAvailableMarkerFile.delete() )
-                {
+            if (forceRecheck && notAvailableMarkerFile.exists()) {
+                if (!notAvailableMarkerFile.delete()) {
                     getLog().warn(
-                                   Messages.getString( "AbstractIdeSupportMojo.unabletodeletenotavailablemarkerfile",
-                                                       notAvailableMarkerFile ) );
+                            Messages.getString("AbstractIdeSupportMojo.unabletodeletenotavailablemarkerfile",
+                                    notAvailableMarkerFile));
                 }
             }
 
-            if ( !notAvailableMarkerFile.exists() )
-            {
+            if (!notAvailableMarkerFile.exists()) {
                 artifact =
-                    IdeUtils.resolveArtifact( artifactResolver, artifact, remoteRepos, localRepository, getLog() );
-                if ( artifact.isResolved() )
-                {
-                    if ( "sources".equals( inClassifier ) )
-                    {
-                        dependency.setSourceAttachment( artifact.getFile() );
-                    }
-                    else if ( "javadoc".equals( inClassifier ) )
-                    {
-                        dependency.setJavadocAttachment( artifact.getFile() );
+                        IdeUtils.resolveArtifact(artifactResolver, artifact, remoteRepos, localRepository, getLog());
+                if (artifact.isResolved()) {
+                    if ("sources".equals(inClassifier)) {
+                        dependency.setSourceAttachment(artifact.getFile());
+                    } else if ("javadoc".equals(inClassifier)) {
+                        dependency.setJavadocAttachment(artifact.getFile());
                     }
-                }
-                else
-                {
-                    if ( includeRemoteRepositories )
-                    {
-                        try
-                        {
+                } else {
+                    if (includeRemoteRepositories) {
+                        try {
                             notAvailableMarkerFile.createNewFile();
                             getLog().debug(
-                                            Messages.getString( "AbstractIdeSupportMojo.creatednotavailablemarkerfile",
-                                                                notAvailableMarkerFile ) );
-                        }
-                        catch ( IOException e )
-                        {
+                                    Messages.getString("AbstractIdeSupportMojo.creatednotavailablemarkerfile",
+                                            notAvailableMarkerFile));
+                        } catch (IOException e) {
                             getLog().warn(
-                                           Messages.getString(
-                                                               "AbstractIdeSupportMojo.failedtocreatenotavailablemarkerfile",
-                                                               notAvailableMarkerFile ) );
+                                    Messages.getString(
+                                            "AbstractIdeSupportMojo.failedtocreatenotavailablemarkerfile",
+                                            notAvailableMarkerFile));
                         }
                     }
                     // add the dependencies to the list
                     // of those lacking the required
                     // artifact
-                    missingClassifierDependencies.add( dependency );
+                    missingClassifierDependencies.add(dependency);
                 }
             }
         }
@@ -1044,10 +983,9 @@ public abstract class AbstractIdeSupport
         {
             msg.append( Messages.getString( "AbstractIdeSupportMojo.sourcesnotavailable" ) ); //$NON-NLS-1$
 
-            for ( Iterator it = missingSourceDependencies.iterator(); it.hasNext(); )
-            {
-                IdeDependency art = (IdeDependency) it.next();
-                msg.append( Messages.getString( "AbstractIdeSupportMojo.sourcesmissingitem", art.getId() ) ); //$NON-NLS-1$
+            for (Object missingSourceDependency : missingSourceDependencies) {
+                IdeDependency art = (IdeDependency) missingSourceDependency;
+                msg.append(Messages.getString("AbstractIdeSupportMojo.sourcesmissingitem", art.getId())); //$NON-NLS-1$
             }
             msg.append( "\n" ); //$NON-NLS-1$
         }
@@ -1056,10 +994,9 @@ public abstract class AbstractIdeSupport
         {
             msg.append( Messages.getString( "AbstractIdeSupportMojo.javadocnotavailable" ) ); //$NON-NLS-1$
 
-            for ( Iterator it = missingJavadocDependencies.iterator(); it.hasNext(); )
-            {
-                IdeDependency art = (IdeDependency) it.next();
-                msg.append( Messages.getString( "AbstractIdeSupportMojo.javadocmissingitem", art.getId() ) ); //$NON-NLS-1$
+            for (Object missingJavadocDependency : missingJavadocDependencies) {
+                IdeDependency art = (IdeDependency) missingJavadocDependency;
+                msg.append(Messages.getString("AbstractIdeSupportMojo.javadocmissingitem", art.getId())); //$NON-NLS-1$
             }
             msg.append( "\n" ); //$NON-NLS-1$
         }

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/IdeUtils.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/IdeUtils.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/IdeUtils.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/IdeUtils.java Sun Aug 25 18:51:54 2013
@@ -288,16 +288,11 @@ public class IdeUtils
      */
     public static ArtifactVersion getArtifactVersion( String[] artifactIds, List /*<Dependency>*/ dependencies )
     {
-        for ( int j = 0; j < artifactIds.length; j++ )
-        {
-            String id = artifactIds[j];
-            Iterator depIter = dependencies.iterator();
-            while ( depIter.hasNext() )
-            {
-                Dependency dep = (Dependency) depIter.next();
-                if ( id.equals( dep.getArtifactId() ) )
-                {
-                    return VersionRange.createFromVersion( dep.getVersion() ).getRecommendedVersion();
+        for (String id : artifactIds) {
+            for (Object dependency : dependencies) {
+                Dependency dep = (Dependency) dependency;
+                if (id.equals(dep.getArtifactId())) {
+                    return VersionRange.createFromVersion(dep.getVersion()).getRecommendedVersion();
                 }
 
             }
@@ -365,15 +360,12 @@ public class IdeUtils
                 && index < subConfiguration.length; index++ )
             {
                 ArrayList newConfigurationDomList = new ArrayList();
-                for ( Iterator childElement = configurationDomList.iterator(); childElement.hasNext(); )
-                {
-                    Xpp3Dom child = (Xpp3Dom) childElement.next();
-                    Xpp3Dom[] deeperChild = child.getChildren( subConfiguration[index] );
-                    for ( int deeperIndex = 0; deeperIndex < deeperChild.length; deeperIndex++ )
-                    {
-                        if ( deeperChild[deeperIndex] != null )
-                        {
-                            newConfigurationDomList.add( deeperChild[deeperIndex] );
+                for (Object aConfigurationDomList : configurationDomList) {
+                    Xpp3Dom child = (Xpp3Dom) aConfigurationDomList;
+                    Xpp3Dom[] deeperChild = child.getChildren(subConfiguration[index]);
+                    for (Xpp3Dom aDeeperChild : deeperChild) {
+                        if (aDeeperChild != null) {
+                            newConfigurationDomList.add(aDeeperChild);
                         }
                     }
                 }
@@ -525,7 +517,7 @@ public class IdeUtils
                                                          String depClassifier, String inClassifier,
                                                          ArtifactFactory artifactFactory )
     {
-        String type = null;
+        String type;
 
         // the "sources" classifier maps to the "java-source" type
         if ( "sources".equals( inClassifier ) )
@@ -537,7 +529,7 @@ public class IdeUtils
             type = inClassifier;
         }
 
-        String finalClassifier = null;
+        String finalClassifier;
         if ( depClassifier == null )
         {
             finalClassifier = inClassifier;
@@ -590,7 +582,7 @@ public class IdeUtils
         String basedirPath = getCanonicalPath( basedir );
         String absolutePath = getCanonicalPath( fileToAdd );
 
-        String relative = null;
+        String relative;
 
         if ( absolutePath.equals( basedirPath ) )
         {
@@ -663,34 +655,29 @@ public class IdeUtils
     {
         String value = null;
 
-        for ( Iterator it = plugins.iterator(); it.hasNext(); )
-        {
-            Plugin plugin = (Plugin) it.next();
+        for (Object plugin1 : plugins) {
+            Plugin plugin = (Plugin) plugin1;
 
-            if ( plugin.getArtifactId().equals( ARTIFACT_MAVEN_COMPILER_PLUGIN ) )
-            {
+            if (plugin.getArtifactId().equals(ARTIFACT_MAVEN_COMPILER_PLUGIN)) {
                 // TODO: This may cause ClassCastExceptions eventually, if the dom impls differ.
                 Xpp3Dom o = (Xpp3Dom) plugin.getConfiguration();
 
                 // this is the default setting
-                if ( o != null && o.getChild( optionName ) != null )
-                {
-                    value = o.getChild( optionName ).getValue();
+                if (o != null && o.getChild(optionName) != null) {
+                    value = o.getChild(optionName).getValue();
                 }
 
                 List executions = plugin.getExecutions();
 
                 // a different source/target version can be configured for test sources compilation
-                for ( Iterator iter = executions.iterator(); iter.hasNext(); )
-                {
-                    PluginExecution execution = (PluginExecution) iter.next();
+                for (Object execution1 : executions) {
+                    PluginExecution execution = (PluginExecution) execution1;
 
                     // TODO: This may cause ClassCastExceptions eventually, if the dom impls differ.
                     o = (Xpp3Dom) execution.getConfiguration();
 
-                    if ( o != null && o.getChild( optionName ) != null )
-                    {
-                        value = o.getChild( optionName ).getValue();
+                    if (o != null && o.getChild(optionName) != null) {
+                        value = o.getChild(optionName).getValue();
                     }
                 }
             }

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/JeeUtils.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/JeeUtils.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/JeeUtils.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/ide/JeeUtils.java Sun Aug 25 18:51:54 2013
@@ -250,13 +250,10 @@ public class JeeUtils
         // if no version found try dependencies of referenced projects
         if ( version == null )
         {
-            Iterator it = project.getProjectReferences().keySet().iterator();
-            while ( it.hasNext() )
-            {
-                Object key = it.next();
-                MavenProject refProject = (MavenProject) project.getProjectReferences().get( key );
-                version = findEjbVersionInDependencies( refProject );
-                if ( version != null ) // version found in dependencies
+            for (Object key : project.getProjectReferences().keySet()) {
+                MavenProject refProject = (MavenProject) project.getProjectReferences().get(key);
+                version = findEjbVersionInDependencies(refProject);
+                if (version != null) // version found in dependencies
                 {
                     break;
                 }
@@ -281,13 +278,10 @@ public class JeeUtils
         // if no version found try dependencies of referenced projects
         if ( version == null )
         {
-            Iterator it = project.getProjectReferences().keySet().iterator();
-            while ( it.hasNext() )
-            {
-                Object key = it.next();
-                MavenProject refProject = (MavenProject) project.getProjectReferences().get( key );
-                version = findJeeVersionInDependencies( refProject );
-                if ( version != null ) // version found in dependencies
+            for (Object key : project.getProjectReferences().keySet()) {
+                MavenProject refProject = (MavenProject) project.getProjectReferences().get(key);
+                version = findJeeVersionInDependencies(refProject);
+                if (version != null) // version found in dependencies
                 {
                     break;
                 }
@@ -325,13 +319,10 @@ public class JeeUtils
         // if no version found try dependencies of referenced projects
         if ( version == null )
         {
-            Iterator it = project.getProjectReferences().keySet().iterator();
-            while ( it.hasNext() )
-            {
-                Object key = it.next();
-                MavenProject refProject = (MavenProject) project.getProjectReferences().get( key );
-                version = findServletVersionInDependencies( refProject );
-                if ( version != null ) // version found in dependencies
+            for (Object key : project.getProjectReferences().keySet()) {
+                MavenProject refProject = (MavenProject) project.getProjectReferences().get(key);
+                version = findServletVersionInDependencies(refProject);
+                if (version != null) // version found in dependencies
                 {
                     break;
                 }

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/InstallPluginsMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/InstallPluginsMojoTest.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/InstallPluginsMojoTest.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/InstallPluginsMojoTest.java Sun Aug 25 18:51:54 2013
@@ -288,7 +288,7 @@ public class InstallPluginsMojoTest
 
     private File locateArtifact( Artifact artifact )
     {
-        URL resource = null;
+        URL resource;
 
         String sourcepath =
             artifact.getGroupId().replace( '.', '/' ) + "/" + artifact.getArtifactId() + "/" + artifact.getVersion()
@@ -318,8 +318,8 @@ public class InstallPluginsMojoTest
         String type = artifact.getType();
 
         ArtifactRepository localRepo = createLocalRepository();
-        MavenProjectBuilder projectBuilder = createProjectBuilder( typeList.indexOf( type ) > -1, installAsJar );
-        ArchiverManager archiverManager = createArchiverManager( typeList.indexOf( type ) > -1, installAsJar );
+        MavenProjectBuilder projectBuilder = createProjectBuilder(typeList.contains(type), installAsJar );
+        ArchiverManager archiverManager = createArchiverManager(typeList.contains(type), installAsJar );
         InputHandler inputHandler = createInputHandler();
 
         Log log = new SystemStreamLog();
@@ -415,7 +415,7 @@ public class InstallPluginsMojoTest
 
                 if ( installAsJar != null )
                 {
-                    model.addProperty( InstallPluginsMojo.PROP_UNPACK_PLUGIN, "" + ( !installAsJar.booleanValue() ) );
+                    model.addProperty( InstallPluginsMojo.PROP_UNPACK_PLUGIN, "" + ( !installAsJar) );
                 }
 
                 MavenProject project = new MavenProject( model );

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/TempEclipseWorkspace.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/TempEclipseWorkspace.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/TempEclipseWorkspace.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/TempEclipseWorkspace.java Sun Aug 25 18:51:54 2013
@@ -100,10 +100,8 @@ public class TempEclipseWorkspace
 
         if ( projectsToLink != null && projectsToLink.length != 0 )
         {
-            for ( int i = 0; i < projectsToLink.length; i++ )
-            {
-                String projectToLink = projectsToLink[i];
-                writeLocationFile( projectToLink );
+            for (String projectToLink : projectsToLink) {
+                writeLocationFile(projectToLink);
             }
         }
 

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/AbstractEclipsePluginIT.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/AbstractEclipsePluginIT.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/AbstractEclipsePluginIT.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/AbstractEclipsePluginIT.java Sun Aug 25 18:51:54 2013
@@ -150,12 +150,9 @@ public abstract class AbstractEclipsePlu
         {
             String path = System.getProperty( "java.library.path" );
             String[] paths = StringUtils.split( path, System.getProperty( "path.separator" ) );
-            for ( int j = 0; j < paths.length; j++ )
-            {
-                String pt = paths[j];
-                if ( new File( pt, "mvn" ).exists() )
-                {
-                    System.setProperty( "maven.home", new File( pt ).getAbsoluteFile().getParent() );
+            for (String pt : paths) {
+                if (new File(pt, "mvn").exists()) {
+                    System.setProperty("maven.home", new File(pt).getAbsoluteFile().getParent());
                     break;
                 }
 
@@ -209,19 +206,16 @@ public abstract class AbstractEclipsePlu
 
         containers.add( getContainer() );
 
-        for ( Iterator iter = containers.iterator(); iter.hasNext(); )
-        {
-            PlexusContainer container = (PlexusContainer) iter.next();
+        for (Object container1 : containers) {
+            PlexusContainer container = (PlexusContainer) container1;
 
-            if ( container != null )
-            {
+            if (container != null) {
                 container.dispose();
 
                 ClassRealm realm = container.getContainerRealm();
 
-                if ( realm != null )
-                {
-                    realm.getWorld().disposeRealm( realm.getId() );
+                if (realm != null) {
+                    realm.getWorld().disposeRealm(realm.getId());
                 }
             }
         }
@@ -440,17 +434,13 @@ public abstract class AbstractEclipsePlu
 
         File buildLog = null;
 
-        for ( int i = 0; i < trace.length; i++ )
-        {
-            StackTraceElement element = trace[i];
-
+        for (StackTraceElement element : trace) {
             String methodName = element.getMethodName();
 
-            if ( methodName.startsWith( "test" ) && !methodName.equals( "testProject" ) )
-            {
+            if (methodName.startsWith("test") && !methodName.equals("testProject")) {
                 String classname = element.getClassName();
 
-                buildLog = new File( BUILD_OUTPUT_DIRECTORY, classname + "_" + element.getMethodName() + ".build.log" );
+                buildLog = new File(BUILD_OUTPUT_DIRECTORY, classname + "_" + element.getMethodName() + ".build.log");
 
                 break;
             }
@@ -530,17 +520,13 @@ public abstract class AbstractEclipsePlu
     {
         File[] expectedDirectories = getExpectedDirectories( basedir );
 
-        for ( int i = 0; i < expectedDirectories.length; i++ )
-        {
-            File expectedDirectory = expectedDirectories[i];
-            File[] expectedFilesToCompare = getExpectedFilesToCompare( expectedDirectory );
+        for (File expectedDirectory : expectedDirectories) {
+            File[] expectedFilesToCompare = getExpectedFilesToCompare(expectedDirectory);
 
-            for ( int j = 0; j < expectedFilesToCompare.length; j++ )
-            {
-                File expectedFile = expectedFilesToCompare[j];
-                File actualFile = getActualFile( projectOutputDir, basedir, expectedFile );
+            for (File expectedFile : expectedFilesToCompare) {
+                File actualFile = getActualFile(projectOutputDir, basedir, expectedFile);
 
-                assertFileEquals( expectedFile, actualFile );
+                assertFileEquals(expectedFile, actualFile);
             }
         }
     }
@@ -654,7 +640,7 @@ public abstract class AbstractEclipsePlu
     private String preprocess( File file, Map variables )
         throws MojoExecutionException
     {
-        String result = null;
+        String result;
         try
         {
             result = FileUtils.fileRead( file, "UTF-8" );
@@ -709,13 +695,11 @@ public abstract class AbstractEclipsePlu
         String result = str;
         if ( variables != null && !variables.isEmpty() )
         {
-            Iterator iter = variables.entrySet().iterator();
-            while ( iter.hasNext() )
-            {
-                Map.Entry entry = (Entry) iter.next();
+            for (Object o : variables.entrySet()) {
+                Entry entry = (Entry) o;
                 String variable = (String) entry.getKey();
                 String replacement = (String) entry.getValue();
-                result = StringUtils.replace( result, variable, replacement );
+                result = StringUtils.replace(result, variable, replacement);
             }
         }
 
@@ -741,7 +725,7 @@ public abstract class AbstractEclipsePlu
 
     protected void assertDoesNotContain( String message, String full, String substring )
     {
-        if ( full == null || full.indexOf( substring ) != -1 )
+        if ( full == null || full.contains(substring))
         {
             StringBuilder buf = new StringBuilder();
             if ( message != null )
@@ -795,29 +779,22 @@ public abstract class AbstractEclipsePlu
         File[] allFiles = basedir.listFiles();
         if ( allFiles != null )
         {
-            for ( int i = 0; i < allFiles.length; i++ )
-            {
-                File currentFile = allFiles[i];
-                if ( currentFile.isDirectory() )
-                {
-                    if ( currentFile.getName().equals( EXPECTED_DIRECTORY_NAME ) )
-                    {
-                        expectedDirectories.add( currentFile );
-                    }
-                    else
-                    {
-                        subdirectories.add( currentFile );
+            for (File currentFile : allFiles) {
+                if (currentFile.isDirectory()) {
+                    if (currentFile.getName().equals(EXPECTED_DIRECTORY_NAME)) {
+                        expectedDirectories.add(currentFile);
+                    } else {
+                        subdirectories.add(currentFile);
                     }
                 }
             }
         }
         if ( !subdirectories.isEmpty() )
         {
-            for ( Iterator iter = subdirectories.iterator(); iter.hasNext(); )
-            {
-                File subdirectory = (File) iter.next();
-                File[] subdirectoryFiles = getExpectedDirectories( subdirectory );
-                expectedDirectories.addAll( Arrays.asList( subdirectoryFiles ) );
+            for (Object subdirectory1 : subdirectories) {
+                File subdirectory = (File) subdirectory1;
+                File[] subdirectoryFiles = getExpectedDirectories(subdirectory);
+                expectedDirectories.addAll(Arrays.asList(subdirectoryFiles));
             }
         }
         return (File[]) expectedDirectories.toArray( new File[expectedDirectories.size()] );
@@ -835,26 +812,20 @@ public abstract class AbstractEclipsePlu
         File[] allFiles = expectedDirectory.listFiles();
         if ( allFiles != null )
         {
-            for ( int i = 0; i < allFiles.length; i++ )
-            {
-                File currentFile = allFiles[i];
-                if ( currentFile.isDirectory() )
-                {
-                    subdirectories.add( currentFile );
-                }
-                else
-                {
-                    expectedFiles.add( currentFile );
+            for (File currentFile : allFiles) {
+                if (currentFile.isDirectory()) {
+                    subdirectories.add(currentFile);
+                } else {
+                    expectedFiles.add(currentFile);
                 }
             }
         }
         if ( !subdirectories.isEmpty() )
         {
-            for ( Iterator iter = subdirectories.iterator(); iter.hasNext(); )
-            {
-                File subdirectory = (File) iter.next();
-                File[] subdirectoryFiles = getExpectedFilesToCompare( subdirectory );
-                expectedFiles.addAll( Arrays.asList( subdirectoryFiles ) );
+            for (Object subdirectory1 : subdirectories) {
+                File subdirectory = (File) subdirectory1;
+                File[] subdirectoryFiles = getExpectedFilesToCompare(subdirectory);
+                expectedFiles.addAll(Arrays.asList(subdirectoryFiles));
             }
         }
 

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriterUnitTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriterUnitTest.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriterUnitTest.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriterUnitTest.java Sun Aug 25 18:51:54 2013
@@ -154,13 +154,12 @@ public class EclipseClasspathWriterUnitT
         Document doc = builder.build( new File( basedir, ".classpath" ) );
 
         XPath javadocUrls = XPath.newInstance( "//attribute/@value" );
-        for ( Iterator it = javadocUrls.selectNodes( doc ).iterator(); it.hasNext(); )
-        {
-            Attribute attribute = (Attribute) it.next();
-            URL jarUrl = new URL( attribute.getValue() );
-            URL fileUrl = ( (JarURLConnection) jarUrl.openConnection() ).getJarFileURL();
+        for (Object o : javadocUrls.selectNodes(doc)) {
+            Attribute attribute = (Attribute) o;
+            URL jarUrl = new URL(attribute.getValue());
+            URL fileUrl = ((JarURLConnection) jarUrl.openConnection()).getJarFileURL();
             String host = fileUrl.getHost();
-            assertTrue( "Unexpected host: \"" + host + "\"", "".equals( host ) || "localhost".equals( host ) );
+            assertTrue("Unexpected host: \"" + host + "\"", "".equals(host) || "localhost".equals(host));
         }
     }
 

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/writers/EclipseProjectWriterTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/writers/EclipseProjectWriterTest.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/writers/EclipseProjectWriterTest.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/writers/EclipseProjectWriterTest.java Sun Aug 25 18:51:54 2013
@@ -113,7 +113,7 @@ public class EclipseProjectWriterTest
         IOUtil.close( w );
         // parse the file we just created in order to keep manually-added linkedResources
         // pre setup
-        Reader reader = null;
+        Reader reader;
         reader = new InputStreamReader( new FileInputStream( dotProject ), "UTF-8" );
         Xpp3Dom dom = Xpp3DomBuilder.build( reader );
         Xpp3Dom linkedResourcesElement = dom.getChild( "linkedResources" );

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/writers/EclipseWtpComponent15WriterTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/writers/EclipseWtpComponent15WriterTest.java?rev=1517364&r1=1517363&r2=1517364&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/writers/EclipseWtpComponent15WriterTest.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/writers/EclipseWtpComponent15WriterTest.java Sun Aug 25 18:51:54 2013
@@ -110,14 +110,13 @@ public class EclipseWtpComponent15Writer
         XPath archiveNames = XPath.newInstance( "//dependent-module/@archiveName" );
 
         assertEquals( "Must be 2 modules", 2, archiveNames.selectNodes( doc ).size() );
-        for ( Iterator it = archiveNames.selectNodes( doc ).iterator(); it.hasNext(); )
-        {
-            Attribute attribute = (Attribute) it.next();
+        for (Object o : archiveNames.selectNodes(doc)) {
+            Attribute attribute = (Attribute) o;
 
             String archiveName = attribute.getValue();
-            String extension = archiveName.substring( archiveName.lastIndexOf( "." ) + 1 ).toLowerCase();
+            String extension = archiveName.substring(archiveName.lastIndexOf(".") + 1).toLowerCase();
 
-            assertEquals( "Must be of type jar", "jar", extension );
+            assertEquals("Must be of type jar", "jar", extension);
         }
 
     }

Added: maven/plugins/trunk/maven-javadoc-plugin/javadoc-options-javadoc-resources.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/javadoc-options-javadoc-resources.xml?rev=1517364&view=auto
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/javadoc-options-javadoc-resources.xml (added)
+++ maven/plugins/trunk/maven-javadoc-plugin/javadoc-options-javadoc-resources.xml Sun Aug 25 18:51:54 2013
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<javadocOptions>
+  <javadocResourcesDirectory>src/main/javadoc</javadocResourcesDirectory>
+</javadocOptions>