You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2019/11/22 17:18:09 UTC

[commons-lang] branch master updated: [LANG-1500] Test may fail due to a different order of fields returned by reflection api #480.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git


The following commit(s) were added to refs/heads/master by this push:
     new f25b44b  [LANG-1500] Test may fail due to a different order of fields returned by reflection api #480.
f25b44b is described below

commit f25b44b25ff966fe9fff18f489fd9087eb3ae291
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Nov 22 12:18:04 2019 -0500

    [LANG-1500] Test may fail due to a different order of fields returned by
    reflection api #480.
---
 src/changes/changes.xml                                             | 1 +
 src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 6279240..772104a 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -81,6 +81,7 @@ The <action> type attribute can be add,update,fix,remove.
     <action issue="LANG-1177" type="add" dev="ggregory" due-to="Liel Fridman">Added indexesOf methods and simplified removeAllOccurences #471.</action>
     <action issue="LANG-1498" type="add" dev="ggregory" due-to="Lysergid, Gary Gregory">Add support of lambda value evaluation for defaulting methods #416.</action>
     <action issue="LANG-1463" type="fix" dev="ggregory" due-to="bbeckercscc, Gary Gregory">StringUtils abbreviate returns String of length greater than maxWidth #477.</action>
+    <action issue="LANG-1500" type="fix" dev="ggregory" due-to="contextshuffling">StringUtils abbreviate returns String of length greater than maxWidth #477.</action>
   </release>
 
   <release version="3.9" date="2019-04-09" description="New features and bug fixes. Requires Java 8, supports Java 9, 10, 11.">
diff --git a/src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java b/src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java
index a1569da..666d72e 100644
--- a/src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java
+++ b/src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java
@@ -190,6 +190,7 @@ public class HashCodeBuilder implements Builder<Integer> {
         }
         try {
             register(object);
+            // The elements in the returned array are not sorted and are not in any particular order.
             final Field[] fields = clazz.getDeclaredFields();
             Arrays.sort(fields, Comparator.comparing(Field::getName));
             AccessibleObject.setAccessible(fields, true);