File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
src/test/java/org/apache/commons/beanutils2 Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change 3636import java .util .List ;
3737import java .util .Map ;
3838import java .util .Set ;
39+ import java .util .TreeSet ;
3940
4041import org .apache .commons .beanutils2 .priv .PrivateBeanFactory ;
4142import org .apache .commons .beanutils2 .priv .PrivateDirect ;
4243import org .apache .commons .beanutils2 .priv .PublicSubBean ;
44+ import org .apache .commons .lang3 .StringUtils ;
4345import org .junit .jupiter .api .AfterEach ;
4446import org .junit .jupiter .api .BeforeEach ;
4547import org .junit .jupiter .api .Test ;
@@ -156,17 +158,8 @@ private static PropertyDescriptor findNameDescriptor(final PropertyDescriptor[]
156158 * <p>
157159 * If there are no keys, an empty string is returned.
158160 */
159- private String keysToString (final Map <?, ?> map ) {
160- final Object [] mapKeys = map .keySet ().toArray ();
161- Arrays .sort (mapKeys );
162- final StringBuilder buf = new StringBuilder ();
163- for (int i = 0 ; i < mapKeys .length ; ++i ) {
164- if (i != 0 ) {
165- buf .append (", " );
166- }
167- buf .append (mapKeys [i ]);
168- }
169- return buf .toString ();
161+ private String keysToString (final Map <String , ?> map ) {
162+ return StringUtils .join (new TreeSet <>(map .keySet ()), ", " );
170163 }
171164
172165 /**
You can’t perform that action at this time.
0 commit comments