} else if (obj instanceof Sequence) {
Sequence seqType = (Sequence)obj;
tc = orb.create_sequence_tc((int) seqType.getBound(),
getTypeCode(orb, seqType.getElemtype(), typeMap, seenTypes));
} else if (obj instanceof Struct) {
Struct structType = (Struct)obj;
// TODO: check to see if this is a recursive type.
if (seenTypes.contains(new QName(structType.getName()))) {
tc = orb.create_recursive_tc(structType.getRepositoryID());
} else {
seenTypes.push(new QName(structType.getName()));
List list = structType.getMember();
StructMember[] members = new StructMember[list.size()];
for (int i = 0; i < members.length; ++i) {
MemberType member = (MemberType) list.get(i);
members[i] = new StructMember(member.getName(),
getTypeCode(orb, member.getIdltype(), typeMap, seenTypes),
null);
}
String name = getTypeCodeName(structType.getName());
tc = orb.create_struct_tc(structType.getRepositoryID(), name, members);
seenTypes.pop();
}
} else if (obj instanceof Union) {
tc = getUnionTypeCode(orb, obj, typeMap, seenTypes);
}