commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject [lang] Use final where possible
Date Tue, 05 May 2015 19:07:03 GMT
Repository: commons-lang
Updated Branches:
  refs/heads/master 7fae5b0b1 -> dfc988886


Use final where possible


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/dfc98888
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/dfc98888
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/dfc98888

Branch: refs/heads/master
Commit: dfc9888860bf192cedde21e5e843bc3caad4b74b
Parents: 7fae5b0
Author: Benedikt Ritter <britter@apache.org>
Authored: Tue May 5 21:05:37 2015 +0200
Committer: Benedikt Ritter <britter@apache.org>
Committed: Tue May 5 21:05:37 2015 +0200

----------------------------------------------------------------------
 src/main/java/org/apache/commons/lang3/StringUtils.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/dfc98888/src/main/java/org/apache/commons/lang3/StringUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java
index 5ebadde..a8cd1d4 100644
--- a/src/main/java/org/apache/commons/lang3/StringUtils.java
+++ b/src/main/java/org/apache/commons/lang3/StringUtils.java
@@ -4197,16 +4197,16 @@ public class StringUtils {
      * @return the joined String.
      * @throws java.lang.IllegalArgumentException if a null varargs is provided
      */
-    public static String joinWith(final String separator, Object... objects) {
+    public static String joinWith(final String separator, final Object... objects) {
         if (objects == null) {
             throw new IllegalArgumentException("Object varargs must not be null");
         }
 
-        String sanitizedSeparator = defaultString(separator, StringUtils.EMPTY);
+        final String sanitizedSeparator = defaultString(separator, StringUtils.EMPTY);
 
-        StringBuilder result = new StringBuilder();
+        final StringBuilder result = new StringBuilder();
 
-        Iterator<Object> iterator = Arrays.asList(objects).iterator();
+        final Iterator<Object> iterator = Arrays.asList(objects).iterator();
         while (iterator.hasNext()) {
             result.append(ObjectUtils.toString(iterator.next()));
 


Mime
View raw message