[kepler-dev] [Bug 4547] documentation for file parameter includes an error

bugzilla-daemon at ecoinformatics.org bugzilla-daemon at ecoinformatics.org
Sun Jan 3 12:26:45 PST 2010


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

--- Comment #3 from Christopher Brooks <cxh at eecs.berkeley.edu> 2010-01-03 12:26:44 PST ---
Viewing the documentation for FileParameter works fine in the ptII tree,
but fails in Kepler, probably because of something about the Kepler
customizations to the documentation viewer.

However, if I modify ptolemy/vergil/actor/DocManager.java to include the
stack trace:
  _exception = "Error evaluating DocAttribute parameter:\n" + e
        + ptolemy.kernel.util.KernelException.stackTraceToString(e);

Then I get the stack trace below, which does not include a call to 
ptolemy/ptolemy/vergil/basic/KeplerDocumentationAttribute.java

Looking at the code, I see that DocAttribute has description as a
StringParameter.

I think this should be changed to a StringAttribute so that the contents
of the description are not evaluated and so that $ID is not expanded.

I made this change in my tree and found it was necessary to add a MoMLFilter
for this change because the configuration has files that
ptolemy/configs/basicUtilities.xml include lines like:

 <property name="description" class="ptolemy.data.expr.StringParameter"
value="To edit the documentation that appears&#10;when the user double clicks
on this icon,&#10;right click on the _background_ of the model and
select&#10;Documentation-&gt;Customize Documentation.&#10;The description you
are currently editing&#10;will not appear when the user double clicks on the
Documentation icon.">

The MoMLFilter looks for DocAttributes and changes the class of
description from StringParameter to StringAttribute.

The question is: should this change go in to the Ptolemy tree, or is
the problem really in Kepler? 

I think the description should be a StringAttribute, not a StringParameter.
However, this change would require updating many files because the filter
would mark the files as modified.


Anyway, here's the stack trace from Kepler

ptolemy.data.expr.Variable._evaluate(Variable.java:1656) at
ptolemy.data.expr.Variable.getToken(Variable.java:578) at
ptolemy.data.expr.StringParameter.stringValue(StringParameter.java:95) at
ptolemy.vergil.actor.DocManager. (DocManager.java:164) at
ptolemy.vergil.actor.DocViewer._init(DocViewer.java:652) at
ptolemy.vergil.actor.DocViewer. (DocViewer.java:115) at
ptolemy.vergil.actor.DocTableau. (DocTableau.java:90) at
ptolemy.vergil.basic.GetDocumentationAction.showDocAttributeTableau(GetDocumentationAction.java:442)
at
ptolemy.vergil.basic.GetDocumentationAction.showDocumentation(GetDocumentationAction.java:161)
at
ptolemy.vergil.basic.GetDocumentationAction.actionPerformed(GetDocumentationAction.java:120)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1882) at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2202) at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258) at
javax.swing.AbstractButton.doClick(AbstractButton.java:334) at
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1050) at
apple.laf.CUIAquaMenuItem.doClick(CUIAquaMenuItem.java:119) at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1091)
at java.awt.Component.processMouseEvent(Component.java:5602) at
javax.swing.JComponent.processMouseEvent(JComponent.java:3129) at
java.awt.Component.processEvent(Component.java:5367) at
java.awt.Container.processEvent(Container.java:2010) at
java.awt.Component.dispatchEventImpl(Component.java:4068) at
java.awt.Container.dispatchEventImpl(Container.java:2068) at
java.awt.Component.dispatchEvent(Component.java:3903) at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256) at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3936) at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866) at
java.awt.Container.dispatchEventImpl(Container.java:2054) at
java.awt.Window.dispatchEventImpl(Window.java:1801) at
java.awt.Component.dispatchEvent(Component.java:3903) at
java.awt.EventQueue.dispatchEvent(EventQueue.java:463) at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184) at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176) at
java.awt.EventDispatchThread.run(EventDispatchThread.java:110) Caused by:
ptolemy.data.expr.UndefinedConstantOrIdentifierException: The ID ID is
undefined. at
ptolemy.data.expr.ParseTreeEvaluator.visitLeafNode(ParseTreeEvaluator.java:674)
at ptolemy.data.expr.ASTPtLeafNode.visit(ASTPtLeafNode.java:125) at
ptolemy.data.expr.ParseTreeEvaluator._evaluateChild(ParseTreeEvaluator.java:1310)
at
ptolemy.data.expr.ParseTreeEvaluator._evaluateAllChildren(ParseTreeEvaluator.java:1264)
at
ptolemy.data.expr.ParseTreeEvaluator.visitSumNode(ParseTreeEvaluator.java:1116)
at ptolemy.data.expr.ASTPtSumNode.visit(ASTPtSumNode.java:128) at
ptolemy.data.expr.ParseTreeEvaluator.evaluateParseTree(ParseTreeEvaluator.java:104)
at ptolemy.data.expr.Variable._evaluate(Variable.java:1644) ... 36 more Caused
by: ptolemy.data.expr.UndefinedConstantOrIdentifierException: The ID ID is
undefined. at
ptolemy.data.expr.ParseTreeEvaluator.visitLeafNode(ParseTreeEvaluator.java:674)
at ptolemy.data.expr.ASTPtLeafNode.visit(ASTPtLeafNode.java:125) at
ptolemy.data.expr.ParseTreeEvaluator._evaluateChild(ParseTreeEvaluator.java:1310)
at
ptolemy.data.expr.ParseTreeEvaluator._evaluateAllChildren(ParseTreeEvaluator.java:1264)
at
ptolemy.data.expr.ParseTreeEvaluator.visitSumNode(ParseTreeEvaluator.java:1116)
at ptolemy.data.expr.ASTPtSumNode.visit(ASTPtSumNode.java:128) at
ptolemy.data.expr.ParseTreeEvaluator.evaluateParseTree(ParseTreeEvaluator.java:104)
at ptolemy.data.expr.Variable._evaluate(Variable.java:1644) at
ptolemy.data.expr.Variable.getToken(Variable.java:578) at
ptolemy.data.expr.StringParameter.stringValue(StringParameter.java:95) at
ptolemy.vergil.actor.DocManager. (DocManager.java:164) at
ptolemy.vergil.actor.DocViewer._init(DocViewer.java:652) at
ptolemy.vergil.actor.DocViewer. (DocViewer.java:115) at
ptolemy.vergil.actor.DocTableau. (DocTableau.java:90) at
ptolemy.vergil.basic.GetDocumentationAction.showDocAttributeTableau(GetDocumentationAction.java:442)
at
ptolemy.vergil.basic.GetDocumentationAction.showDocumentation(GetDocumentationAction.java:161)
at
ptolemy.vergil.basic.GetDocumentationAction.actionPerformed(GetDocumentationAction.java:120)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1882) at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2202) at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258) at
javax.swing.AbstractButton.doClick(AbstractButton.java:334) at
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1050) at
apple.laf.CUIAquaMenuItem.doClick(CUIAquaMenuItem.java:119) at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1091)
at java.awt.Component.processMouseEvent(Component.java:5602) at
javax.swing.JComponent.processMouseEvent(JComponent.java:3129) at
java.awt.Component.processEvent(Component.java:5367) at
java.awt.Container.processEvent(Container.java:2010) at
java.awt.Component.dispatchEventImpl(Component.java:4068) at
java.awt.Container.dispatchEventImpl(Container.java:2068) at
java.awt.Component.dispatchEvent(Component.java:3903) at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256) at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3936) at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866) at
java.awt.Container.dispatchEventImpl(Container.java:2054) at
java.awt.Window.dispatchEventImpl(Window.java:1801) at
java.awt.Component.dispatchEvent(Component.java:3903) at
java.awt.EventQueue.dispatchEvent(EventQueue.java:463) at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184) at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176) at
java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

-- 
Configure bugmail: http://bugzilla.ecoinformatics.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the Kepler-dev mailing list