File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
spring-beans/src/main/java/org/springframework/beans Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2020 the original author or authors.
2
+ * Copyright 2002-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -422,10 +422,13 @@ private PropertyEditor getCustomEditor(@Nullable Class<?> requiredType) {
422
422
}
423
423
if (editor == null ) {
424
424
// Find editor for superclass or interface.
425
- for (Iterator <Class <?>> it = this .customEditors .keySet ().iterator (); it .hasNext () && editor == null ;) {
426
- Class <?> key = it .next ();
425
+ for (Map .Entry <Class <?>, PropertyEditor > entry : this .customEditors .entrySet ()) {
426
+ if (editor != null ) {
427
+ break ;
428
+ }
429
+ Class <?> key = entry .getKey ();
427
430
if (key .isAssignableFrom (requiredType )) {
428
- editor = this . customEditors . get ( key );
431
+ editor = entry . getValue ( );
429
432
// Cache editor for search type, to avoid the overhead
430
433
// of repeated assignable-from checks.
431
434
if (this .customEditorCache == null ) {
You can’t perform that action at this time.
0 commit comments