google-code-export / umple

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

State attribute in State Machines remains uppercased when converted into Java, Ruby, and C++ code #627

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Write a state machine in Umple, and pick an uppercased name for the state 
variable (see example in 
http://cruise.eecs.uottawa.ca/umpleonline/?example=manualexamples/BasicStateMach
ines2&diagramtype=state where "GarageDoor" is used to represent the state in 
Umple).
2. Generate Java and/or Ruby code.
3. Look at the resulting instance variable representing the state (i.e. 
`private GarageDoor GarageDoor` in Java and `private UNKNOWN ID: type 
GarageDoor` in Ruby).

What is the expected output? What do you see instead?
It is expected to have a lowercase variable name as that's the convention. It 
also makes the code confusing as the enum and the instance variable have the 
exact same name.

The solution I am thinking about is to always convert the variable name to 
lowercase when generating Java and Ruby code in the case of state machines.

Original issue reported on code.google.com by nmaad...@gmail.com on 9 Sep 2014 at 11:49

GoogleCodeExporter commented 9 years ago

Original comment by TimothyCLethbridge on 10 Sep 2014 at 12:35

GoogleCodeExporter commented 9 years ago
Just found out that the same problem is occurring with C++ (Umple Online is 
showing a correct decapitalized variable name though).

Original comment by nmaad...@gmail.com on 17 Sep 2014 at 8:29

GoogleCodeExporter commented 9 years ago
A good place to start would be to look at the java and Ruby translator classes, 
that take the raw names and convert to language-specific naming conventions, 
e.g. camelCase, which is what we want

Original comment by TimothyCLethbridge on 17 Sep 2014 at 9:45

GoogleCodeExporter commented 9 years ago
Issue seems to be fixed. Patch sent by email, and pending feedback/approval.

Original comment by nmaad...@gmail.com on 19 Sep 2014 at 4:20

GoogleCodeExporter commented 9 years ago

Original comment by TimothyCLethbridge on 20 Sep 2014 at 6:47