Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XmlGraph builds graph with redundant nodes. #556

Open
starkda opened this issue Apr 18, 2024 · 1 comment
Open

XmlGraph builds graph with redundant nodes. #556

starkda opened this issue Apr 18, 2024 · 1 comment

Comments

@starkda
Copy link
Contributor

starkda commented Apr 18, 2024

During application of XmlGraph, I noticed that the graph built using XmlGraph.build() method may generate multiple nodes with the same name. Such problem arises when initial skeleton has more than one classes.
For example, if we have 2 classes in skeleton:

<?xml version="1.0" encoding="UTF-8"?>
<skeleton date="2024-04-18T16:18:26.737175379Z"
          schema="xsd/skeleton.xsd"
          version="1.0-SNAPSHOT">
   <app id="/home/djovi/IdeaProjects/untitled17">
      <package id="org.example.memer">
         <class id="Memer"><!--Package: org.example.memer; name: org.example.memer.Memer; file: org.example.memer.Memer-->
            <attributes>
               <attribute final="false" public="false" static="false" type="I">kek</attribute>
               <attribute final="false"
                          public="false"
                          static="false"
                          type="Ljava/lang/String">name</attribute>
            </attributes>
            <methods>
               
               <method abstract="false"
                       bridge="false"
                       ctor="false"
                       desc="()V"
                       name="four"
                       static="false"
                       visibility="public">
                  <args/>
                  <return>V</return>
               </method>
               <method abstract="false"
                       bridge="false"
                       ctor="false"
                       desc="()V"
                       name="five"
                       static="false"
                       visibility="public">
                  <args/>
                  <return>V</return>
                  <ops>
                     <op code="put">name</op>
                  </ops>
               </method>
            </methods>
         </class>
      </package>
      <package id="org.example">
         <class id="Worker"><!--Package: org.example; name: org.example.Worker; file: org.example.Worker-->
            <attributes>
               <attribute final="false"
                          public="false"
                          static="false"
                          type="Ljava/lang/String">name</attribute>
               <attribute final="false"
                          public="false"
                          static="false"
                          type="Ljava/lang/String">kek</attribute>
            </attributes>
            <methods>
               
               
               <method abstract="false"
                       bridge="false"
                       ctor="false"
                       desc="()V"
                       name="one"
                       static="false"
                       visibility="public">
                  <args/>
                  <return>V</return>
                  <ops>
                     <op code="put">name</op>
                  </ops>
               </method>
               <method abstract="false"
                       bridge="false"
                       ctor="false"
                       desc="()V"
                       name="two"
                       static="false"
                       visibility="public">
                  <args/>
                  <return>V</return>
                  <ops>
                     <op code="put">name</op>
                  </ops>
               </method>
               <method abstract="false"
                       bridge="false"
                       ctor="false"
                       desc="()V"
                       name="three"
                       static="false"
                       visibility="public">
                  <args/>
                  <return>V</return>
                  <ops>
                     <op code="put">name</op>
                  </ops>
               </method>
               <method abstract="false"
                       bridge="false"
                       ctor="false"
                       desc="()V"
                       name="four"
                       static="false"
                       visibility="public">
                  <args/>
                  <return>V</return>
                  <ops>
                     <op code="put">kek</op>
                  </ops>
               </method>
               <method abstract="false"
                       bridge="false"
                       ctor="false"
                       desc="()V"
                       name="five"
                       static="false"
                       visibility="public">
                  <args/>
                  <return>V</return>
                  <ops>
                     <op code="put">kek</op>
                  </ops>
               </method>
            </methods>
         </class>
      </package>
   </app>
</skeleton>

XmlGraph.build(skeleton, "org.example.memer", "Memer")
will build graph with 5 nodes instead of 2.

@starkda
Copy link
Contributor Author

starkda commented Apr 18, 2024

@yegor256 what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant