commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1362218 - /commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/LargeTarTestCase.java
Date Mon, 16 Jul 2012 19:16:39 GMT
Author: ggregory
Date: Mon Jul 16 19:16:39 2012
New Revision: 1362218

URL: http://svn.apache.org/viewvc?rev=1362218&view=rev
Log:
Use Java 5 for each loop.

Modified:
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/LargeTarTestCase.java

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/LargeTarTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/LargeTarTestCase.java?rev=1362218&r1=1362217&r2=1362218&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/LargeTarTestCase.java
(original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/LargeTarTestCase.java
Mon Jul 16 19:16:39 2012
@@ -126,27 +126,29 @@ public void setUp() throws Exception {
    * @param files a list of files to search.
    * @return {@code true} if {@code expectedFile} is in {@code files}. 
    */
-  protected boolean fileExists(String expectedFile, List<FileObject> files) {
-    Iterator<FileObject> iter = files.iterator();
-    while (iter.hasNext()) {
-      FileObject file = iter.next();
-      if(file.getName().getBaseName().equals(expectedFile)) {
-        return true;
-      }
+    protected boolean fileExists(String expectedFile, List<FileObject> files)
+    {
+        for (FileObject file : files)
+        {
+            if (file.getName().getBaseName().equals(expectedFile))
+            {
+                return true;
+            }
+        }
+        return false;
     }
 
-    return false;
-  }
-
-  protected boolean endsWith(String testString, String[] testList) {
-    for(int i=0; i < testList.length; ++i) {
-      String testItem = testList[i];
-      if(testString.endsWith(testItem)) {
-        return true;
-      }
+    protected boolean endsWith(String testString, String[] testList)
+    {
+        for (String string : testList)
+        {
+            if (testString.endsWith(string))
+            {
+                return true;
+            }
+        }
+        return false;
     }
-    return false;
-  }
 
   //@SuppressWarnings("unused")
   protected void createLargeFile(String path, final String name) throws Exception {



Mime
View raw message