{
// loop through attributes: add fromAtt if they don't exist, combine them if they exist
outterLoop:
for (int i = 0; i < from.getAttributes().size(); i++)
{
Attribute fromAtt = (Attribute)from.getAttributes().get(i);
for (int j = 0; j < into.getAttributes().size(); j++)
{
Attribute intoAtt = (Attribute)into.getAttributes().get(j);
if (intoAtt.getName().equals(fromAtt.getName()))
{
intoAtt.getType().setName(
combineToMoreGeneralSimpleType(intoAtt.getType().getName(), fromAtt.getType().getName()));
continue outterLoop;
}
}
// fromAtt doesn't exist in into type, will add it right now
into.addAttribute(fromAtt);
}
//optional attributes: if there are atts in into that are not in from, make them optional
outterLoop:
for (int i = 0; i < into.getAttributes().size(); i++)
{
Attribute intoAtt = (Attribute)into.getAttributes().get(i);
for (int j = 0; j < from.getAttributes().size(); j++)
{
Attribute fromAtt = (Attribute)from.getAttributes().get(j);
if (fromAtt.getName().equals(intoAtt.getName()))
{
continue;
}
}
// intoAtt doesn't exist in into type, will add it right now