emerge icon indicating copy to clipboard operation
emerge copied to clipboard

Java classes defined in another class could not be recognized properly

Open HickeyHsu opened this issue 3 years ago • 3 comments

For example:

import ast.Visitor;

public class Normalizer {
    visitors = new ArrayList<>();
    visitors.add(new VisitorA ());
    public class VisitorA extends Visitor{
    }
}

In this case, VisitorA will not generate a link with Normalizer; At the same time, imported ast.Visitor identified as node<ast.Visitor>in dependency_graph, and identified as node <visitor> in inheritance_graph. This causes the repeatedly appearing node to in complete_graph.

I haven`t tested in other language.

HickeyHsu avatar May 26 '22 06:05 HickeyHsu

Another problem: for import like :

import org.antlr.v4.runtime.*;

Tools fails to build proper nodes and edges

HickeyHsu avatar May 26 '22 07:05 HickeyHsu

For example:

import ast.Visitor;

public class Normalizer {
    visitors = new ArrayList<>();
    visitors.add(new VisitorA ());
    public class VisitorA extends Visitor{
    }
}

In this case, VisitorA will not generate a link with Normalizer; At the same time, imported ast.Visitor identified as node<ast.Visitor>in dependency_graph, and identified as node <visitor> in inheritance_graph. This causes the repeatedly appearing node to in complete_graph.

I haven`t tested in other language.

I made some rough changes to the code to make the improvements mentioned above. view at https://github.com/HickeyHsu/SoftwareNetGen

HickeyHsu avatar May 26 '22 08:05 HickeyHsu

@HickeyHsu Thanks for the feedback. I'll have a closer look at the issues and try to give you feedback in the following days. Probably this is the case, since the parsers can't really handle nested structures (yet) to extract them in a recursive way. I'll have a look at your modifications, looking forward 👋.

glato avatar May 29 '22 18:05 glato