*/
protected void _setTokenAndNotify(Token newToken)
throws IllegalActionException {
// Save to restore in case the change is rejected.
Token oldToken = _token;
Type oldVarType = _varType;
if (_varType instanceof StructuredType) {
try {
oldVarType = (Type) ((StructuredType) _varType).clone();
} catch (CloneNotSupportedException ex2) {
throw new InternalErrorException(
"Variable._setTokenAndNotify: "
+ " Cannot clone _varType" + ex2.getMessage());
}
}
boolean oldNoTokenYet = _noTokenYet;
String oldInitialExpression = _initialExpression;
Token oldInitialToken = _initialToken;
try {
_setToken(newToken);
NamedObj container = getContainer();
if (container != null) {
if (!oldVarType.equals(_varType)
&& (oldVarType != BaseType.UNKNOWN)) {
container.attributeTypeChanged(this);
}
container.attributeChanged(this);