From 7d744b22679d0389f23d75c1bba1637f97d2f77c Mon Sep 17 00:00:00 2001 From: Henri Yandell Date: Thu, 7 May 2009 08:41:42 +0000 Subject: [PATCH] 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 --- .../org/apache/commons/lang/builder/HashCodeBuilder.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java b/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java index 447c3a95e..06265b83e 100644 --- a/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java +++ b/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java @@ -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 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()))