<html>
<head>
<base href="http://bugzilla.ecoinformatics.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:cxh@eecs.berkeley.edu" title="Christopher Brooks <cxh@eecs.berkeley.edu>"> <span class="fn">Christopher Brooks</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW --- - references to parameter are not always renamed"
href="http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5723">bug 5723</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Hours Worked</td>
<td>
</td>
<td>1.00
</td>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>cxh@eecs.berkeley.edu
</td>
</tr>
<tr>
<td style="text-align:right;">Hours Left</td>
<td>0.00
</td>
<td>2.00
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - references to parameter are not always renamed"
href="http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5723#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - references to parameter are not always renamed"
href="http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5723">bug 5723</a>
from <span class="vcard"><a class="email" href="mailto:cxh@eecs.berkeley.edu" title="Christopher Brooks <cxh@eecs.berkeley.edu>"> <span class="fn">Christopher Brooks</span></a>
</span></b>
<pre>That's a strange bug.
I think the problem is with the $x syntax in the pattern PortParameter that is
in string mode.
ptolemy/actor/gui/RenameConfigurer.java generates a MoMLChangeRequest
that looks like:
<property name="x"><rename name="y"/></property>
MoMLParser parses it and calls ptolemy.data.expr.Variable.setName() which
finds the listeners and sets the expression in an unusual manner:
--start--
if (_valueListeners != null) {
Iterator listeners = _valueListeners.iterator();
while (listeners.hasNext()) {
ValueListener listener = (ValueListener) listeners
.next();
if (listener instanceof Variable) {
// The listener could be referencing this variable.
ParseTreeFreeVariableRenamer renamer = new
ParseTreeFreeVariableRenamer();
((Variable) listener)._parseIfNecessary();
renamer.renameVariables(
((Variable) listener)._parseTree,
(Variable) listener, this, name);
ParseTreeWriter writer = new ParseTreeWriter();
((Variable) listener)
.setExpression(writer
.parseTreeToExpression(((Variable)
listener)._parseTree));
changed.add(listener);
}
}
}
super.setName(name);
// With the new name, we may now shadow variables that
// were not previously shadowed. Invalidate those.
_invalidateShadowedSettables(getContainer());
validate();
--end---
I think the problem is that the $x expression is getting evaluated somewhere.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>