logger.warning("Encountered recursively defined data "
+ "when calculating " + name + " - ABORTING");
return; // break out of infinite loops.
}
SimpleData oldValue = value;
SimpleData newValue = null;
String newAlias = null;
SubscribingExpressionContext context = null;
// attempt to perform the calculation up to 10 times. (This should
// be more than generous - even one retry should be rare.)
int retryCount = 10;
while (retryCount-- > 0 && extChanges.isDirty()) {
context = new SubscribingExpressionContext(data, prefix, this,
name, currentSubscriptions);
ListStack stack = new ListStack();
int changeCount = -1;
try {
calcNameSet.add(name);
changeCount = extChanges.getUnhandledChangeCount();
script.run(stack, context);
newAlias = (String) stack.peekDescriptor();
newValue = (SimpleData) stack.pop();
if (newValue != null && newAlias == null)
newValue = (SimpleData) newValue.getEditable(false);
} catch (ExecutionException e) {
logger.warning("Error executing " + name + ": " + e);
newValue = null;
} finally {
calcNameSet.remove(name);