commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1613094 - in /commons/proper/exec/trunk/src: main/java/org/apache/commons/exec/ main/java/org/apache/commons/exec/environment/ main/java/org/apache/commons/exec/launcher/ main/java/org/apache/commons/exec/util/ test/java/org/apache/commons...
Date Thu, 24 Jul 2014 12:20:14 GMT
Author: ggregory
Date: Thu Jul 24 12:20:14 2014
New Revision: 1613094

URL: http://svn.apache.org/r1613094
Log:
Use final.

Modified:
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/CommandLine.java
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DaemonExecutor.java
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DefaultExecutor.java
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/environment/DefaultProcessingEnvironment.java
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/environment/EnvironmentUtils.java
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/launcher/VmsCommandLauncher.java
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/MapUtils.java
    commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilsTest.java

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/CommandLine.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/CommandLine.java?rev=1613094&r1=1613093&r2=1613094&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/CommandLine.java (original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/CommandLine.java Thu Jul
24 12:20:14 2014
@@ -127,7 +127,7 @@ public class CommandLine {
 
         if (other.getSubstitutionMap() != null)
         {
-            Map<String, Object> omap = new HashMap<String, Object>();
+            final Map<String, Object> omap = new HashMap<String, Object>();
             this.substitutionMap = omap;
             final Iterator<String> iterator = other.substitutionMap.keySet().iterator();
             while (iterator.hasNext())
@@ -178,7 +178,7 @@ public class CommandLine {
      */
     public CommandLine addArguments(final String[] addArguments, final boolean handleQuoting)
{
         if (addArguments != null) {
-            for (String addArgument : addArguments) {
+            for (final String addArgument : addArguments) {
                 addArgument(addArgument, handleQuoting);
             }
         }

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DaemonExecutor.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DaemonExecutor.java?rev=1613094&r1=1613093&r2=1613094&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DaemonExecutor.java (original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DaemonExecutor.java Thu
Jul 24 12:20:14 2014
@@ -34,8 +34,8 @@ public class DaemonExecutor extends Defa
      * @return the thread
      */
     @Override
-    protected Thread createThread(Runnable runnable, String name) {
-        Thread t = super.createThread(runnable, name);
+    protected Thread createThread(final Runnable runnable, final String name) {
+        final Thread t = super.createThread(runnable, name);
         t.setDaemon(true);
         return t;
     }

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DefaultExecutor.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DefaultExecutor.java?rev=1613094&r1=1613093&r2=1613094&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DefaultExecutor.java (original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DefaultExecutor.java Thu
Jul 24 12:20:14 2014
@@ -232,7 +232,7 @@ public class DefaultExecutor implements 
             return this.launcher.isFailure(exitValue);
         }
         else {
-            for (int exitValue2 : this.exitValues) {
+            for (final int exitValue2 : this.exitValues) {
                 if (exitValue2 == exitValue) {
                     return false;
                 }

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/environment/DefaultProcessingEnvironment.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/environment/DefaultProcessingEnvironment.java?rev=1613094&r1=1613093&r2=1613094&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/environment/DefaultProcessingEnvironment.java
(original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/environment/DefaultProcessingEnvironment.java
Thu Jul 24 12:20:14 2014
@@ -173,7 +173,7 @@ public class DefaultProcessingEnvironmen
 //            // TODO: I have no idea how to get it, someone must fix it
 //            executable = null;
 //        }
-        CommandLine commandLine = null;
+        final CommandLine commandLine = null;
 //        if (executable != null) {
 //            commandLine = new CommandLine(executable);
 //            commandLine.addArguments(arguments);

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/environment/EnvironmentUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/environment/EnvironmentUtils.java?rev=1613094&r1=1613093&r2=1613094&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/environment/EnvironmentUtils.java
(original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/environment/EnvironmentUtils.java
Thu Jul 24 12:20:14 2014
@@ -62,9 +62,9 @@ public class EnvironmentUtils
         }
         final String[] result = new String[environment.size()];
         int i = 0;
-        for (Entry<String, String> entry : environment.entrySet()) {
-            String key  = entry.getKey() == null ? "" : entry.getKey().toString();
-            String value = entry.getValue() == null ? "" : entry.getValue().toString();
+        for (final Entry<String, String> entry : environment.entrySet()) {
+            final String key  = entry.getKey() == null ? "" : entry.getKey().toString();
+            final String value = entry.getValue() == null ? "" : entry.getValue().toString();
             result[i] = key + "=" + value;
             i++;
         }

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/launcher/VmsCommandLauncher.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/launcher/VmsCommandLauncher.java?rev=1613094&r1=1613093&r2=1613094&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/launcher/VmsCommandLauncher.java
(original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/launcher/VmsCommandLauncher.java
Thu Jul 24 12:20:14 2014
@@ -90,7 +90,7 @@ public class VmsCommandLauncher extends 
             if (env != null) {
                 final Set<Entry<String, String>> entries = env.entrySet();
 
-                for (Entry<String, String> entry : entries) {
+                for (final Entry<String, String> entry : entries) {
                     out.print("$ ");
                     out.print(entry.getKey());
                     out.print(" == "); // define as global symbol
@@ -133,7 +133,7 @@ public class VmsCommandLauncher extends 
                 out.print(command);                
             }
             final String[] args = cmd.getArguments();
-            for (String arg : args) {
+            for (final String arg : args) {
                 out.println(" -");
                 out.print(arg);
             }

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/MapUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/MapUtils.java?rev=1613094&r1=1613093&r2=1613094&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/MapUtils.java (original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/MapUtils.java Thu
Jul 24 12:20:14 2014
@@ -64,7 +64,7 @@ public class MapUtils
 
         final Map<String, V> result = new HashMap<String, V>();
 
-        for (Map.Entry<K, V> entry : source.entrySet()) {
+        for (final Map.Entry<K, V> entry : source.entrySet()) {
             final K key = entry.getKey();
             final V value = entry.getValue();
             result.put(prefix + '.' + key.toString(), value);

Modified: commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilsTest.java?rev=1613094&r1=1613093&r2=1613094&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilsTest.java
(original)
+++ commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilsTest.java
Thu Jul 24 12:20:14 2014
@@ -97,7 +97,7 @@ public class EnvironmentUtilsTest {
 
         // ensure that we have the same value for upper and lowercase keys
         final Map<String, String> procEnvironment = EnvironmentUtils.getProcEnvironment();
-        for (Entry<String, String> entry : procEnvironment.entrySet()) {
+        for (final Entry<String, String> entry : procEnvironment.entrySet()) {
             final String key = entry.getKey();
             final String value = entry.getValue();
             assertEquals(value, procEnvironment.get(key.toLowerCase(Locale.ENGLISH)));
@@ -135,7 +135,7 @@ public class EnvironmentUtilsTest {
     public void testToStringWithNullKey() {
         final Map<String, String> env = new HashMap<String, String>();
         env.put(null, "TheNullKey");
-        String[] strings = EnvironmentUtils.toStrings(env);
+        final String[] strings = EnvironmentUtils.toStrings(env);
         assertEquals(1, strings.length);
         assertEquals("=TheNullKey", strings[0]);
     }
@@ -148,7 +148,7 @@ public class EnvironmentUtilsTest {
     public void testToStringWithNullValue() {
         final Map<String, String> env = new HashMap<String, String>();
         env.put("key", null);
-        String[] strings = EnvironmentUtils.toStrings(env);
+        final String[] strings = EnvironmentUtils.toStrings(env);
         assertEquals(1, strings.length);
         assertEquals("key=", strings[0]);
     }



Mime
View raw message