commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1195484 - in /commons/proper/vfs/trunk/core/src: main/java/org/apache/commons/vfs2/impl/ main/java/org/apache/commons/vfs2/tasks/ main/java/org/apache/commons/vfs2/util/ test/java/org/apache/commons/vfs2/test/
Date Mon, 31 Oct 2011 14:45:17 GMT
Author: ggregory
Date: Mon Oct 31 14:45:17 2011
New Revision: 1195484

URL: http://svn.apache.org/viewvc?rev=1195484&view=rev
Log:
Use Java 5 enhanced loops.

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/StandardFileSystemManager.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/VFSClassLoader.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/tasks/AbstractSyncTask.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/AbstractProviderTestCase.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/AbstractTestSuite.java

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java?rev=1195484&r1=1195483&r2=1195484&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java
Mon Oct 31 14:45:17 2011
@@ -1114,10 +1114,8 @@ public class DefaultFileSystemManager im
             final FileOperationProvider operationProvider)
             throws FileSystemException
     {
-        for (int i = 0; i < schemes.length; i++)
+        for (String scheme : schemes)
         {
-            final String scheme = schemes[i];
-
             if (!operationProviders.containsKey(scheme))
             {
                 final List<FileOperationProvider> providers = new ArrayList<FileOperationProvider>();

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/StandardFileSystemManager.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/StandardFileSystemManager.java?rev=1195484&r1=1195483&r2=1195484&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/StandardFileSystemManager.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/StandardFileSystemManager.java
Mon Oct 31 14:45:17 2011
@@ -341,9 +341,8 @@ public class StandardFileSystemManager
 
         // Make sure all required schemes are available
         final String[] requiredSchemes = getRequiredSchemes(providerDef);
-        for (int i = 0; i < requiredSchemes.length; i++)
+        for (String requiredScheme : requiredSchemes)
         {
-            final String requiredScheme = requiredSchemes[i];
             if (!hasProvider(requiredScheme))
             {
                 final String msg = Messages.getString("vfs.impl/skipping-provider-scheme.debug",
@@ -355,9 +354,8 @@ public class StandardFileSystemManager
 
         // Make sure all required classes are in classpath
         final String[] requiredClasses = getRequiredClasses(providerDef);
-        for (int i = 0; i < requiredClasses.length; i++)
+        for (String requiredClass : requiredClasses)
         {
-            final String requiredClass = requiredClasses[i];
             if (!findClass(requiredClass))
             {
                 final String msg = Messages.getString("vfs.impl/skipping-provider.debug",

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/VFSClassLoader.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/VFSClassLoader.java?rev=1195484&r1=1195483&r2=1195484&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/VFSClassLoader.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/VFSClassLoader.java
Mon Oct 31 14:45:17 2011
@@ -137,9 +137,8 @@ public class VFSClassLoader extends Secu
     private void addFileObjects(final FileSystemManager manager,
                                 final FileObject[] files) throws FileSystemException
     {
-        for (int i = 0; i < files.length; i++)
+        for (FileObject file : files)
         {
-            FileObject file = files[i];
             if (!file.exists())
             {
                 // Does not exist - skip

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/tasks/AbstractSyncTask.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/tasks/AbstractSyncTask.java?rev=1195484&r1=1195483&r2=1195484&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/tasks/AbstractSyncTask.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/tasks/AbstractSyncTask.java
Mon Oct 31 14:45:17 2011
@@ -328,9 +328,8 @@ public abstract class AbstractSyncTask
         if (detectMissingSourceFiles())
         {
             final FileObject[] allDestFiles = destFolder.findFiles(Selectors.SELECT_FILES);
-            for (int i = 0; i < allDestFiles.length; i++)
+            for (FileObject destFile : allDestFiles)
             {
-                final FileObject destFile = allDestFiles[i];
                 if (!destFiles.contains(destFile))
                 {
                     handleMissingSourceFile(destFile);

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java?rev=1195484&r1=1195483&r2=1195484&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java
Mon Oct 31 14:45:17 2011
@@ -451,9 +451,8 @@ public class DelegatingFileSystemOptions
         Map<String, List<Method>> schemeMethods = new TreeMap<String, List<Method>>();
 
         Method[] methods = fscb.getClass().getMethods();
-        for (int iterMethods = 0; iterMethods < methods.length; iterMethods++)
+        for (Method method : methods)
         {
-            Method method = methods[iterMethods];
             if (!Modifier.isPublic(method.getModifiers()))
             {
                 continue;

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/AbstractProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/AbstractProviderTestCase.java?rev=1195484&r1=1195483&r2=1195484&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/AbstractProviderTestCase.java
(original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/AbstractProviderTestCase.java
Mon Oct 31 14:45:17 2011
@@ -191,9 +191,9 @@ public abstract class AbstractProviderTe
         final Capability[] caps = getRequiredCaps();
         if (caps != null)
         {
-            for (int i = 0; i < caps.length; i++)
+            for (Capability cap2 : caps)
             {
-                final Capability cap = caps[i];
+                final Capability cap = cap2;
                 FileSystem fs = readFolder.getFileSystem();
                 if (!fs.hasCapability(cap))
                 {

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/AbstractTestSuite.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/AbstractTestSuite.java?rev=1195484&r1=1195483&r2=1195484&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/AbstractTestSuite.java
(original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/AbstractTestSuite.java
Mon Oct 31 14:45:17 2011
@@ -119,9 +119,9 @@ public abstract class AbstractTestSuite
 
         // Locate the test methods
         final Method[] methods = testClass.getMethods();
-        for (int i = 0; i < methods.length; i++)
+        for (Method method2 : methods)
         {
-            final Method method = methods[i];
+            final Method method = method2;
             if (!method.getName().startsWith("test")
                 || Modifier.isStatic(method.getModifiers())
                 || method.getReturnType() != Void.TYPE



Mime
View raw message