logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1431424 - in /logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core: config/TestConfigurator.java util/JunitTestRunnerFilter.java util/Transformer.java
Date Thu, 10 Jan 2013 15:27:55 GMT
Author: ggregory
Date: Thu Jan 10 15:27:55 2013
New Revision: 1431424

URL: http://svn.apache.org/viewvc?rev=1431424&view=rev
Log:
Convert 'for' loops to enhanced 'for' loops.

Modified:
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/TestConfigurator.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/JunitTestRunnerFilter.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/Transformer.java

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/TestConfigurator.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/TestConfigurator.java?rev=1431424&r1=1431423&r2=1431424&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/TestConfigurator.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/TestConfigurator.java
Thu Jan 10 15:27:55 2013
@@ -243,9 +243,9 @@ public class TestConfigurator {
     public void testBadFileName() throws Exception {
         StringBuilder dir = new StringBuilder("/VeryLongDirectoryName");
 
-        for (int i = 0; i < CHARS.length; ++i) {
-            dir.append(CHARS[i]);
-            dir.append(CHARS[i].toUpperCase());
+        for (String element : CHARS) {
+            dir.append(element);
+            dir.append(element.toUpperCase());
         }
         final String value = FILESEP.equals("/") ? dir.toString() + "/test.log" : "1:/target/bad:file.log";
         System.setProperty("testfile", value);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/JunitTestRunnerFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/JunitTestRunnerFilter.java?rev=1431424&r1=1431423&r2=1431424&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/JunitTestRunnerFilter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/JunitTestRunnerFilter.java
Thu Jan 10 15:27:55 2013
@@ -47,8 +47,8 @@ public class JunitTestRunnerFilter imple
         return "\tat java.lang.reflect.Method.invoke(X)\n" + in;
     }
 
-    for (int i = 0; i < patterns.length; i++) {
-        if(util.match(patterns[i], in)) {
+    for (String pattern : patterns) {
+        if(util.match(pattern, in)) {
             return null;
         }
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/Transformer.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/Transformer.java?rev=1431424&r1=1431423&r2=1431424&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/Transformer.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/Transformer.java
Thu Jan 10 15:27:55 2013
@@ -40,8 +40,8 @@ public class Transformer {
       // Initialization of input and output omitted
       while ((line = input.readLine()) != null) {
         // apply all filters
-        for (int i = 0; i < filters.length; i++) {
-          line = filters[i].filter(line);
+        for (Filter filter : filters) {
+          line = filter.filter(line);
         }
         if (line != null) {
           output.println(line);



Mime
View raw message