Allow to provide manual metadata for keys that are not unique

Closes gh-12193
This commit is contained in:
Stephane Nicoll
2018-05-02 16:04:02 +02:00
parent 782d8c63da
commit 79c222da78
3 changed files with 58 additions and 0 deletions

View File

@@ -150,6 +150,10 @@ public class ConfigurationMetadata {
return null;
}
candidates.removeIf((itemMetadata) -> !itemMetadata.hasSameType(metadata));
if (candidates.size() > 1 && metadata.getType() != null) {
candidates.removeIf((itemMetadata) ->
!metadata.getType().equals(itemMetadata.getType()));
}
if (candidates.size() == 1) {
return candidates.get(0);
}