summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
77bf900)
The descriptions for comoposite open types were not included in a reconstructed
open type, which affected resolution of subsequent composite attributes with
leaves of type union. Union leaves rely on description in order to find the
artificial JMX attribute in order to pass union value as string.
Change-Id: If6222e25840cb854e565ae476509d21ebc19ab3c
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
(cherry picked from commit
10438f09cbbeb252e58a7fb381e9dd723cc14e2e)
Map<String, OpenType<?>> openTypes = Maps.newHashMap();
final String[] names = new String[getOpenType().keySet().size()];
Map<String, OpenType<?>> openTypes = Maps.newHashMap();
final String[] names = new String[getOpenType().keySet().size()];
+ final String[] descriptions = new String[getOpenType().keySet().size()];
OpenType<?>[] itemTypes = new OpenType[names.length];
int i = 0;
OpenType<?>[] itemTypes = new OpenType[names.length];
int i = 0;
// fill names + item types in order to reconstruct the open type for current attribute
names[i] = yangToJavaAttrMapping.get(innerAttrNameStr);
// fill names + item types in order to reconstruct the open type for current attribute
names[i] = yangToJavaAttrMapping.get(innerAttrNameStr);
+ descriptions[i] = getOpenType().getDescription(names[i]);
itemTypes[i] = openTypes.get(innerAttrNameStr);
i++;
}
itemTypes[i] = openTypes.get(innerAttrNameStr);
i++;
}
CompositeDataSupport parsedValue;
try {
LOG.trace("Attribute {} with open type {}. Reconstructing open type.", attrName, getOpenType());
CompositeDataSupport parsedValue;
try {
LOG.trace("Attribute {} with open type {}. Reconstructing open type.", attrName, getOpenType());
- setOpenType(new CompositeType(getOpenType().getTypeName(), getOpenType().getDescription(), names, names, itemTypes));
- LOG.debug("Attribute {} with open type {}. Open type reconstructed to {}", attrName, getOpenType(), getOpenType());
+ setOpenType(new CompositeType(getOpenType().getTypeName(), getOpenType().getDescription(), names, descriptions, itemTypes));
+ LOG.debug("Attribute {}. Open type reconstructed to {}", attrName, getOpenType(), getOpenType());
parsedValue = new CompositeDataSupport(getOpenType(), items);
} catch (OpenDataException e) {
throw new IllegalStateException("An error occurred during restoration of composite type " + this
parsedValue = new CompositeDataSupport(getOpenType(), items);
} catch (OpenDataException e) {
throw new IllegalStateException("An error occurred during restoration of composite type " + this