Genericizing excludeFieldList variable and updating for loop to foreach - LANG-336

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@772551 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2009-05-07 08:41:42 +00:00
parent ca3a3baa65
commit 7d744b2267
1 changed files with 2 additions and 3 deletions

View File

@ -179,10 +179,9 @@ public class HashCodeBuilder {
try {
register(object);
Field[] fields = clazz.getDeclaredFields();
List excludedFieldList = excludeFields != null ? Arrays.asList(excludeFields) : Collections.EMPTY_LIST;
List<String> excludedFieldList = excludeFields != null ? Arrays.asList(excludeFields) : Collections.EMPTY_LIST;
AccessibleObject.setAccessible(fields, true);
for (int i = 0; i < fields.length; i++) {
Field field = fields[i];
for (Field field : fields) {
if (!excludedFieldList.contains(field.getName())
&& (field.getName().indexOf('$') == -1)
&& (useTransients || !Modifier.isTransient(field.getModifiers()))