This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit fbb43e52ca6ecab0cf6dacb3d7c849cab62f24d9
Author: juanpablo <[email protected]>
AuthorDate: Sat Dec 23 12:50:10 2017 +0100

    convert iterator to enhanced for loop, suppress unused warnings on inner 
class (it's accessed through reflection)
---
 .../main/java/org/apache/wiki/VariableManager.java    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/jspwiki-war/src/main/java/org/apache/wiki/VariableManager.java 
b/jspwiki-war/src/main/java/org/apache/wiki/VariableManager.java
index 5299d78..d41ce51 100644
--- a/jspwiki-war/src/main/java/org/apache/wiki/VariableManager.java
+++ b/jspwiki-war/src/main/java/org/apache/wiki/VariableManager.java
@@ -21,7 +21,6 @@ package org.apache.wiki;
 import java.lang.reflect.Method;
 import java.security.Principal;
 import java.util.Date;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
 import java.util.ResourceBundle;
@@ -247,7 +246,7 @@ public class VariableManager
         {
             //
             //  Using reflection to get system variables adding a new system 
variable
-            //  now only invloves creating a new method in the SystemVariables 
class
+            //  now only involves creating a new method in the SystemVariables 
class
             //  with a name starting with get and the first character of the 
name of
             //  the variable capitalized. Example:
             //    public String getMysysvar(){
@@ -368,8 +367,8 @@ public class VariableManager
      *  is not meant to be a public class.
      *
      *  @since 2.7.0
-     *
      */
+    @SuppressWarnings( "unused" )
     private static class SystemVariables
     {
         private WikiContext m_context;
@@ -431,10 +430,11 @@ public class VariableManager
         {
                StringBuilder res = new StringBuilder();
 
-            for( Iterator< String > i = 
m_context.getEngine().getAllInterWikiLinks().iterator(); i.hasNext(); )
+            for( String link : m_context.getEngine().getAllInterWikiLinks() )
             {
-                if( res.length() > 0 ) res.append(", ");
-                String link = i.next();
+                if( res.length() > 0 ) {
+                    res.append(", ");
+                }
                 res.append( link );
                 res.append( " --> " );
                 res.append( m_context.getEngine().getInterWikiURL(link) );
@@ -446,11 +446,12 @@ public class VariableManager
         {
                StringBuilder res = new StringBuilder();
 
-            for( Iterator< String > i = 
m_context.getEngine().getAllInlinedImagePatterns().iterator(); i.hasNext(); )
+            for( String ptrn : 
m_context.getEngine().getAllInlinedImagePatterns() )
             {
-                if( res.length() > 0 ) res.append(", ");
+                if( res.length() > 0 ) {
+                    res.append(", ");
+                }
 
-                String ptrn = i.next();
                 res.append(ptrn);
             }
 

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to