Field (@NotNull String name) { if (!myFields.containsKey(name)) { List<Pair<Field, YamlMetaType>> fields = new SmartList<>(); for (YamlMetaType nextSubType : myTypes) { if (nextSubType instanceof YamlScalarType) { continue; } Field nextField = nextSubType.findFeatureByName(name); if (nextField != null && !name.equals(nextField.getName())) { // any name? continue; } if (nextField != null) { fields.add(Pair.create(nextField, nextSubType)); } } Field result = mergeFields(fields); myFields.put(name, result); } return myFields.get(name); }