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

0 votes
asked Apr 28, 2015 in Bug by anonymous

See page :

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,000 points)
Best answer
Ok, thanks for the feedback.

This should be fixed in the last beta

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,000 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,000 points)
Could you post here a minimum non-working example ?
The problem should be slightly different this time, because looks fine this time.
commented Feb 2, 2016 by anonymous
As a short example, just try the following content for _test_.uml file.

!include _style_.cfg
!include _style_.cfg
Bob ->> Alice: Hello

And the following content for _style_.cfg file.

!ifndef _STYLE_CFG_
!define _STYLE_CFG_
hide footbox

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,
commented Feb 2, 2016 by plantuml (295,000 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,000 points)
We choose the easiest to implement.
So here is a beta
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.