buildAnnotations(al, model.getAnnotations());
}
public static void setVisibleScope(Declaration model) {
Scope s=model.getContainer();
while (s!=null) {
if (s instanceof Declaration) {
if (model.isShared()) {
if (!((Declaration) s).isShared()) {
model.setVisibleScope(s.getContainer());
break;
}
}
else {
model.setVisibleScope(s);
break;
}
}
else if (s instanceof Package) {
//TODO: unshared packages!
/*if (!((Package) s).isShared()) {
model.setVisibleScope(s);
}*/
if (!model.isShared()) {
model.setVisibleScope(s);
}
//null visible scope means visible everywhere
break;
}
else {
model.setVisibleScope(s);
break;
}
s = s.getContainer();
}
}