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();
}
memberDynAny = value[i].value;
memberAny = getAny(memberDynAny);
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();
}
addComponent(i, memberName, memberAny, memberDynAny);
} else {
clearData();
// _REVISIT_ More info
throw new InvalidValue();
}
}
index = (value.length == 0 ? NO_INDEX : 0);
representations = REPRESENTATION_COMPONENTS;
}