[BUG] Connector unexpectedly changes diagram type

0 votes
asked Feb 28, 2017 in Bug by anonymous
edited Feb 28, 2017

While working on my class diagrams, I noticed that all the icons in the generated image were changing to something completely different unexpectedly. Consider this example:

@startuml
interface Entity
interface SubEntity
Entity *-- SubEntity
@enduml
 
The diagram above is generated correctly, but I was able to narrow down the problem to the following line, if we change the star * for the "o" letter:
 
Entity o-- SubEntity
 
Instead of only changing the class diagram connector from composition to aggregation (i.e. solid to hollow diamond), all the shapes in the diagram change to something else entirely --circle shapes.
 
I was able to work around the problem by re-adding the interface qualifier when the connector is about to be added:
 
interface Entity o-- interface SubEntity
 
Since there's a workaround, this is not urgent or anything, but it's something worth addressing. Regards.

1 Answer

0 votes
answered Feb 28, 2017 by Serge Wenger Work (15,620 points)

Hello,

The diagram type change. Here is a workaround to set the diagram type to class instead of component:

@startuml
class aaa
hide aaa
interface Entity
interface SubEntity
Entity *-- SubEntity
@enduml
 
It would be nice to have a skinparam (or somemthing else) to force the diagram type.
commented Feb 28, 2017 by anonymous
I tested that, but it didn't work. Notice that, in my original diagram example, I'm specifically using the o-- and not the *-- connector as you're using in your example.

After changing your *-- into my o-- I get:  java.lang.IllegalArgumentException newtype=ENTITY
commented Feb 28, 2017 by plantuml (294,960 points)
Ok, here we have a nice bug!
We're going to fix it.
Thanks for the report.
commented Mar 1, 2017 by Serge Wenger Work (15,620 points)
Sorry the workaround was :
@startuml
class aaa
hide aaa
interface "Entity" as E
interface "SubEntity" as SE
E o-- SE
@enduml
commented Mar 1, 2017 by anonymous
I think I should note that the small test case I provided was simply a part of a much larger diagram that already had other interfaces and classes defined in it. The fact that other classes already existed in the larger diagram was not enough to "force" or prevent the diagram type from changing, which seems to be the intention of defining and hiding a class in this case.
commented Mar 1, 2017 by plantuml (294,960 points)
This is not easy to fix.
It's due to the fact that "entity" is a keyword (not very documented, through...)
For example, you can have:
@startuml
Entity foo1
Class class2
@enduml

As you have guessed, the parser is confused between class diagram and component diagram.
We are still investigating this...
...