[Uml-devel] [Bug 135527] Javascript wrong Code Generation

Antoine Dopffer adopffer at nerdshack.com
Thu Feb 15 21:54:27 UTC 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=135527         




------- Additional Comments From adopffer nerdshack com  2007-02-15 22:54 -------
I can't exactly reproduce this bug in version 1.5.6.
Here is what I get:
Given a class A and a class B, I draw a composition between A and B
----         ------
| A | <>-----|  B  |
-----        ------- 
The generated javascript code is
File A.js:
----------------------------------
**
  * class A
  */

A = function ()
{
  this._init ();
}


/**
 * _init sets all A attributes to their default value. Make sure to call this
 * method within your class constructor
 */
A.prototype._init = function ()
{

  /**Aggregations: */

  /**Compositions: */
  this.m_A = new A ();

}
-----------------------

File B.js:

-----------------------
**
  * class A
  */

A = function ()
{
  this._init ();
}


/**
 * _init sets all A attributes to their default value. Make sure to call this
 * method within your class constructor
 */
A.prototype._init = function ()
{

  /**Aggregations: */

  /**Compositions: */
  this.m_A = new A ();

}
--------------------------------

According to me, there are two errors:
1) There shouldn't be a composant m_A in class B but a composant m_B in class A (In this case, the C++ generated code doesn't generate any composants in any classes. The C++ generated code generates a composant m_B if only I add a attribute of class B in class A)
2) There shouldn't be a composant m_A in class A. In my example, there is only one composant m_A in class A. That's better than many  but still incorrect

PS : The generated code is identical in trunk




More information about the umbrello-devel mailing list