mirror of
https://github.com/apache/activemq.git
synced 2025-02-13 13:36:07 +00:00
sbe fix on collections toArray(Object[])
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@390374 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e44aee930e
commit
2af7d9836e
@ -66,7 +66,7 @@ class ContainerValueCollection extends ContainerCollectionSupport implements Col
|
|||||||
public Object[] toArray(Object[] result){
|
public Object[] toArray(Object[] result){
|
||||||
List list=container.getItemList();
|
List list=container.getItemList();
|
||||||
synchronized(list){
|
synchronized(list){
|
||||||
if(result.length<list.size()){
|
if(result.length<=list.size()){
|
||||||
int count=0;
|
int count=0;
|
||||||
result=(Object[]) java.lang.reflect.Array.newInstance(result.getClass().getComponentType(),list.size());
|
result=(Object[]) java.lang.reflect.Array.newInstance(result.getClass().getComponentType(),list.size());
|
||||||
for(Iterator i=list.iterator();i.hasNext();){
|
for(Iterator i=list.iterator();i.hasNext();){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user