// Operate on a copy of the attribute list to avoid
// ConcurrentModificationException.
List copy = new LinkedList(attributeList());
Iterator parameters = copy.iterator();
while (parameters.hasNext()) {
Attribute attribute = (Attribute) parameters.next();
String name = attribute.getName();
int n = name.indexOf(" (parameter)");
if (n >= 0) {
// Attribute is a parameter.
name = name.substring(0, n);
if (container.getAttribute(name) == null) {
// Entry is obsolete. Delete it.
try {
attribute.setContainer(null);
} catch (KernelException ex) {
// Should not occur.
throw new InternalErrorException(ex);
}
}
} else {
n = name.indexOf(" (port-parameter)");
if (n >= 0) {
// Attribute is a port parameter.
name = name.substring(0, n);
if (!(container instanceof Entity)
|| ((Entity) container).getPort(name) == null) {
// Entry is obsolete. Delete it.
try {
attribute.setContainer(null);
} catch (KernelException ex) {
// Should not occur.
throw new InternalErrorException(ex);
}
}
} else {
n = name.indexOf(" (port)");
if (n >= 0) {
// Attribute is a port parameter.
name = name.substring(0, n);
if (!(container instanceof Entity)
|| ((Entity) container).getPort(name) == null) {
// Entry is obsolete. Delete it.
try {
attribute.setContainer(null);
} catch (KernelException ex) {
// Should not occur.
throw new InternalErrorException(ex);
}
}
}
}
}
}
parameters = container.attributeList(Settable.class).iterator();
while (parameters.hasNext()) {
NamedObj attribute = (NamedObj) parameters.next();
if (((Settable) attribute).getVisibility() == Settable.FULL) {
String modifier = " (parameter)";
if (attribute instanceof PortParameter) {
modifier = " (port-parameter)";
}
String name = attribute.getName() + modifier;
if (getAttribute(name) == null) {
try {
new StringParameter(this, name);
} catch (KernelException e) {
throw new InternalErrorException(e);