google-code-export / umple

Automatically exported from code.google.com/p/umple
1 stars 0 forks source link

Fatal Error in response from umpleonline when declaring multiple symmetric reflexive associations within a class #574

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make a class in umpleonline
2. Give it two symmetric reflexive associations with different names
3. Use a webpage debugging tool to investigate the posts sent and responses 
received

What is the expected output? What do you see instead?
Upon adding a second symmetric reflexive association, an "addPositioning" post 
is sent, and the response is the following error and stack trace:

yo5 FATAL ERROR PARSING UMPLE DIAGRAM

cruise.umple.compiler.ErrorMessage.<init>(ErrorMessage.java:42)
cruise.umple.compiler.ErrorMessage.<init>(ErrorMessage.java:133)
cruise.umple.compiler.UmpleInternalParser.checkDuplicateAssociationNames(UmpleIn
ternalParser.java:2575)
cruise.umple.compiler.UmpleInternalParser.postTokenClassAnalysis(UmpleInternalPa
rser.java:1768)
cruise.umple.compiler.UmpleInternalParser.postTokenAnalysis(UmpleInternalParser.
java:1180)
cruise.umple.compiler.UmpleInternalParser.analyze(UmpleInternalParser.java:988)
cruise.umple.sync.UpdatePositioningAction.go(UpdatePositioningAction.java:71)
cruise.umple.PlaygroundMain.main(PlaygroundMain.java:67)

Then the diagram will not sync until one of the symmetric reflexive 
associations is removed textually. 

Original issue reported on code.google.com by CraigBry...@gmail.com on 28 May 2014 at 5:14

GoogleCodeExporter commented 9 years ago

Original comment by CraigBry...@gmail.com on 29 May 2014 at 7:25

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
This error also occurs with the Umple compiler outside of umpleonline if a 
class is given two symmetric reflexive associations with the same role name. 
Instead of giving the expected warning (E019 Duplicate Association), the 
following error appears:

Unable to create ErrorMessage due to aPosition

Original comment by CraigBry...@gmail.com on 29 May 2014 at 8:00

GoogleCodeExporter commented 9 years ago
This was a two part problem. The first problem, which caused the "FATAL ERROR", 
instead of a normal Umple syntax error message was that the token positions for 
symmetric reflexive associations were not set when the token was analyzed.

The second problem occurred when checking for duplicate association names. The 
symmetric reflexive associations were being checked at both ends for a role 
name. Since there is only one role name for this type of association, the empty 
role name was added to the list of names, and a second symmetric reflexive 
association (with any role name) would throw a duplicate association name 
error. 

Original comment by CraigBry...@gmail.com on 30 Jun 2014 at 3:21