diff --git a/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java b/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java index a34165e4a..f93136bb3 100644 --- a/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java +++ b/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java @@ -551,7 +551,7 @@ public class ExceptionUtils { frames.add(trace.get(j)); } } - return frames.toArray(new String[0]); + return frames.toArray(new String[frames.size()]); } /** diff --git a/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java b/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java index bf2c968d9..826ccb5b7 100644 --- a/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java +++ b/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java @@ -886,7 +886,7 @@ public class TypeUtils { } } - return types.toArray(new Type[0]); + return types.toArray(new Type[types.size()]); } /**