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:
parent
ca3a3baa65
commit
7d744b2267
|
@ -179,10 +179,9 @@ public class HashCodeBuilder {
|
||||||
try {
|
try {
|
||||||
register(object);
|
register(object);
|
||||||
Field[] fields = clazz.getDeclaredFields();
|
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);
|
AccessibleObject.setAccessible(fields, true);
|
||||||
for (int i = 0; i < fields.length; i++) {
|
for (Field field : fields) {
|
||||||
Field field = fields[i];
|
|
||||||
if (!excludedFieldList.contains(field.getName())
|
if (!excludedFieldList.contains(field.getName())
|
||||||
&& (field.getName().indexOf('$') == -1)
|
&& (field.getName().indexOf('$') == -1)
|
||||||
&& (useTransients || !Modifier.isTransient(field.getModifiers()))
|
&& (useTransients || !Modifier.isTransient(field.getModifiers()))
|
||||||
|
|
Loading…
Reference in New Issue