Error generating uml when same file included in two different uml diagram

0 votes
asked Apr 28, 2015 in Bug by anonymous

See page : http://plantuml.sourceforge.net/preprocessing.html

The error is visible in the conditions section.

 

When a file contains multiple PlantUML diagrams and said diagrams all include the same PlantUML file (a style definition file) an error occured after the first diagram.

-> File already included ...

commented Apr 28, 2015 by anonymous
Seems to be a regression that appear in build 8022

1 Answer

0 votes
answered Apr 28, 2015 by plantuml (295,800 points)
 
Best answer
Ok, thanks for the feedback.

This should be fixed in the last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

If it's ok for you, we will release a new version with this correction.

Thanks again
commented Apr 28, 2015 by anonymous
Problem solved.

Thank you for your prompitude (? alactrity ? the speed to provide a fix to this problem).
commented Jun 7, 2015 by plantuml (295,800 points)
This implementation has been slightly changed in V8026, but it should continue to work.
commented Feb 2, 2016 by anonymous
I recently updated my PlantUML plugin for Eclipse to latest version 8035, and it seems the problem is poping up again.
commented Feb 2, 2016 by plantuml (295,800 points)
Could you post here a minimum non-working example ?
The problem should be slightly different this time, because http://plantuml.com/preprocessing.html looks fine this time.
Thanks.
commented Feb 2, 2016 by anonymous
As a short example, just try the following content for _test_.uml file.

@startuml
!include _style_.cfg
!include _style_.cfg
Bob ->> Alice: Hello
@enduml

And the following content for _style_.cfg file.

@startuml
!ifndef _STYLE_CFG_
!define _STYLE_CFG_
hide footbox
!endif
@enduml

When running plantuml from command line, I have the following error.
> Error line 3 in file: /tmp/_test_.uml
> Some diagram description contains errors

With the Eclipse plugin, the error is strangely different.
> @startuml
> hide footbox
> File already included /tmp/_style_.cfg
>  Syntax Error?

Best regards,
François.
commented Feb 2, 2016 by plantuml (295,800 points)
Thanks for the example.
We have two options here:
- either we ignore the second inclusion (but without any error message)
- or we do include a second time the file

Which behaviour are you expecting ?
commented Feb 2, 2016 by anonymous
I think it is more or less the same for me, even if the real cases are not so trivial as including twice the same file from one file.

Assuming that the current syntax for the inclusions and the defines are close to the C syntax, I would perhaps also follow the same principles for this multiple inclusion problem.
commented Feb 2, 2016 by plantuml (295,800 points)
We choose the easiest to implement.
So here is a beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar
That beta ignores second inclusion.
You can test it from command line. (Testing from Eclipse is not possible for a beta release)
Is it working for you?
commented Feb 3, 2016 by anonymous
This is working as expected.
Thank you.
...