// Expanding arraydefs in AliasDef
Set<EObject> aliasdefs = EcoreUtil2.findAllByType(EcoreUtil.getAllProperContents(tu, true), AliasDef.class);
for(EObject obj : aliasdefs) {
AliasDef alias = (AliasDef) obj;
if(alias.getContainedType() instanceof ArrayDef)
expand(alias);
}
// Expanding arraydefs in Fields
Set<EObject> fields = EcoreUtil2.findAllByType(EcoreUtil.getAllProperContents(tu, true), Field.class);