Fix 1.4 compatibility issue.

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@416631 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrian T. Co 2006-06-23 08:21:32 +00:00
parent ac86d4d01e
commit 4bcac89d49
1 changed files with 2 additions and 1 deletions

View File

@ -24,6 +24,7 @@ import java.util.Properties;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Arrays;
import java.lang.reflect.Method;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
@ -218,7 +219,7 @@ public final class ReflectionUtil {
public static Field[] getAllFields(Class targetClass) {
List fieldList = new ArrayList();
while (targetClass != null) {
Collections.addAll(fieldList, targetClass.getDeclaredFields());
fieldList.addAll(Arrays.asList(targetClass.getDeclaredFields()));
targetClass = targetClass.getSuperclass();
}
return (Field[])fieldList.toArray(new Field[0]);