commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject [lang] Revert "Allocate array of the correct size"
Date Tue, 19 Jan 2016 07:10:03 GMT
Repository: commons-lang
Updated Branches:
  refs/heads/master e01b8eb3f -> 8bb352631


Revert "Allocate array of the correct size"

This reverts commit 60b32953a968e5623f82a6b27d6c679bc17c48e5.

Following the advices from http://shipilev.net/blog/2016/arrays-wisdom-ancients/
this seems to be faster and safer on current VMs.


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

Branch: refs/heads/master
Commit: 8bb3526317408fba3ae351719feb68703aa5fdbb
Parents: e01b8eb
Author: Benedikt Ritter <britter@apache.org>
Authored: Tue Jan 19 08:07:51 2016 +0100
Committer: Benedikt Ritter <britter@apache.org>
Committed: Tue Jan 19 08:07:51 2016 +0100

----------------------------------------------------------------------
 .../apache/commons/lang3/builder/ReflectionToStringBuilder.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/8bb35263/src/main/java/org/apache/commons/lang3/builder/ReflectionToStringBuilder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/builder/ReflectionToStringBuilder.java
b/src/main/java/org/apache/commons/lang3/builder/ReflectionToStringBuilder.java
index 6c2199b..b2b63a6 100644
--- a/src/main/java/org/apache/commons/lang3/builder/ReflectionToStringBuilder.java
+++ b/src/main/java/org/apache/commons/lang3/builder/ReflectionToStringBuilder.java
@@ -346,7 +346,7 @@ public class ReflectionToStringBuilder extends ToStringBuilder {
                 list.add(e.toString());
             }
         }
-        return list.toArray(new String[list.size()]);
+        return list.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
     }
 
 


Mime
View raw message