commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r772551 - /commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java
Date Thu, 07 May 2009 08:41:43 GMT
Author: bayard
Date: Thu May  7 08:41:42 2009
New Revision: 772551

URL: http://svn.apache.org/viewvc?rev=772551&view=rev
Log:
Genericizing excludeFieldList variable and updating for loop to foreach - LANG-336

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java?rev=772551&r1=772550&r2=772551&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java
(original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java
Thu May  7 08:41:42 2009
@@ -179,10 +179,9 @@
         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()))



Mime
View raw message