Link between class in nested namespace make a namespace pop out of the root namespace

0 votes
asked Sep 9, 2020 in Bug by Benjamin

Hi there,

I try to use nested namespace to document my code.

When I try this :

@startuml test
namespace a {
    namespace b {
        class 1

        namespace c {
            class 3
            a.d.2 -> 3
        }
    }

    namespace d {
        class 2
    }
}
@enduml

I got this result where the sub namespace d of the namespace a pop out of a and become a new stand alone namespace : see result.

The expected result would be that the d namespace stay in the a namespace as the following graph if we remove the link between the classes 2 and 3 :

@startuml test
namespace a {
    namespace b {
        class 1

        namespace c {
            class 3
            a.d.2 -> 3
        }
    }

    namespace d {
        class 2
    }
}
@enduml

See result.

Anyone get a clue on this ? Is this a bug or do I miss something ?

Many thanks.

1 Answer

0 votes
answered Sep 9, 2020 by Serge Wenger Work (15,620 points)

If you declare link after Class2, it is OK 

@startuml
namespace a {
    namespace b {
        class 1

        namespace c {
            class 3

       }
    }

    namespace d {
        class 2
    }
 a.d.2 -> a.b.c.3
}
@enduml

http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuSfBp4qjBaXCJbL8LAZcKW02X4WII0GAadCIYuiL3BdW0WXboL1bg4gDuKfhkI0ackaf6AORmHKcwgNe6IdesW4PINh9UiPSjLmEgNafG0S30000

commented Sep 9, 2020 by Benjamin

Wow, such a quick answer surprise.

Many thanks ! smiley

...