GNOME Bugzilla – Bug 325151
100% cpu in uml_create_documentation_tag()
Last modified: 2005-12-31 10:58:02 UTC
The line wrapping code from http://bugzilla.gnome.org/show_bug.cgi?id=303744 has issues. When loading an old diagram it gets passed a "WrapCount" of 0 and does not recover from its wrapping loop. Sample diagram to reproduce follows.
Created attachment 56472 [details] A diagram with class comments
Sorry about that, I was under the impression that I had handled that by initializing the WrapPoint to a minimum of 17 characters(the size of the documentation = string. But apparently this code does not get executed when the file is read in. Thanks for finding this. Obviously by the time I got around to testing it I no longer had any diagrams without a comment length setting in it and didn't think to try the combination.
Created attachment 56494 [details] [review] Should fix the problem with the wrapping of comments in older diagrams This change makes sure that the wrap point for comments is at least as long as the {Documentation = tag.
Created attachment 56566 [details] [review] cvs diff -u > bug325151.diff Attached the patch how we would have liked it: With CangeLog entry and 'diff -u'. I've applied it now although I'm not completely happy with the feature the endless loop seems gone. At least it (i.e. the superfluous 'documentation =' prefix) breaks diagram compatibility. You may want to compare the diagram from above with the diagram from the UML spec 1.5, page 286 http://www.omg.org/cgi-bin/apps/doc?formal/03-03-01.pdf
Wow! With a unified diff the new bugzilla is really nice. Follow http://bugzilla.gnome.org/attachment.cgi?id=56566&action=diff [the Diff link under actions]
The diagram on page 286 is displaying several classes selected from various packages. The notation, which has been entered as a comment in the attached diagram, is not a comment at all. It is a notation which indicates the package which contains/owns the class/element being displayed. I have been using UML from very early on, and while I have seen this notation use in the specifications, and seen it used in many tools, I have never seen it explained or described in any of the specification! However documentation is defined as a tagged value of an element. See page 91 of the referenced document. "Documentation is a comment, description, or explanation of the element to which it is attached." As you probably already know the element is the MetaClass for all of UML. So the documentation for an element (Class, Attribute, Operation, Association ...) is a tagged value and can be displayed in the diagram as such. The proper display of a tagged '{' <tag name> '=' <tag value> '}'. So the 'documentation =' prefix is not superfluous as you may think. It is actually proper for displaying documentation. Free form documentation can be added to a diagram by using a "Note". In fact if the UML ever gets to the point where it is truely 1.5 compliant and then can be extended to be 2.0 compliant, the documentation tagged value may have to be removed as I can't find any reference to this in the 2.0 specification.
I'm not questioning the use of tags in UML. But your implementation does *enforce* a visual representation which IMO should be optional. Thus the reference to a diagram redrawn from the UML specification 1.5 - which is not possible at all anymore with your addition. OTOH with not hard-coded document tag both reperesentations would be possible. The user can always write the extra { documentation = ... } in the comment field.