[kepler-dev] [Bug 5723] references to parameter are not always renamed

bugzilla-daemon at ecoinformatics.org bugzilla-daemon at ecoinformatics.org
Fri Oct 12 12:56:15 PDT 2012


http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5723

Christopher Brooks <cxh at eecs.berkeley.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
       Hours Worked|                            |1.00
                 CC|                            |cxh at eecs.berkeley.edu
         Hours Left|0.00                        |2.00

--- Comment #1 from Christopher Brooks <cxh at eecs.berkeley.edu> ---
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.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-dev/attachments/20121012/d35e650a/attachment.html>


More information about the Kepler-dev mailing list