expectedMemberCount = expectedTypeCode.member_count();
} catch (BadKind badKind) { // impossible
}
if (expectedMemberCount != value.length) {
clearData();
throw new InvalidValue();
}
allocComponents(value);
for (int i=0; i<value.length; i++) {
if (value[i] != null) {
memberName = value[i].id;
String expectedMemberName = null;
try {
expectedMemberName = expectedTypeCode.member_name(i);
} catch (BadKind badKind) { // impossible
} catch (Bounds bounds) { // impossible
}
if ( ! (expectedMemberName.equals(memberName) || memberName.equals(""))) {
clearData();
// _REVISIT_ More info
throw new TypeMismatch();
}
memberAny = value[i].value;
TypeCode expectedMemberType = null;
try {
expectedMemberType = expectedTypeCode.member_type(i);
} catch (BadKind badKind) { // impossible
} catch (Bounds bounds) { // impossible
}
if (! expectedMemberType.equal(memberAny.type())) {
clearData();
// _REVISIT_ More info
throw new TypeMismatch();
}
try {
// Creates the appropriate subtype without copying the Any
memberDynAny = DynAnyUtil.createMostDerivedDynAny(memberAny, orb, false);
} catch (InconsistentTypeCode itc) {
throw new InvalidValue();
}
addComponent(i, memberName, memberAny, memberDynAny);
} else {
clearData();
// _REVISIT_ More info
throw new InvalidValue();
}
}
index = (value.length == 0 ? NO_INDEX : 0);
representations = REPRESENTATION_COMPONENTS;
}