konveyor / konveyor/dgi-code-analyzer

Java primitive types are not displayed in callgraph (e.g., int, long, double, boolean, etc.)

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
0
Forks
7
PR merge metrics
No merged PRs in 30d

Description

I noted that any Java primitive type is not displayed in the callgraph. So for example, the Calculator class in 7ep (https://github.com/rahlk/dgi-sample-applications/blob/main/7ep-demo/source/src/main/java/com/coveros/training/mathematics/Calculator.java) has two different methods for add:

```
/**
* Simply add two integers
*/
public static int add(int a, int b) {
return a + b;
}

/**
* Simply add two doubles.
*/
public static double add(double a, double b) {
return a + b;
}
```

However, after running the code analyzer, just **one** single entry appears inside the callgraph:

```
{
"id": "com.coveros.training.mathematics.Calculator.add",
"class": "com.coveros.training.mathematics.Calculator",
"method": "add",
"arguments": "[, ]",
"returnType": ""
},
```

In this case above we were expecting two different methods, with different arguments. Also, note that not just the arguments that are not appearing but the return types as well.

In `setResultToSum` method from `MathServlet` class you can see a that a sequence of commas appears instead of the primitive types:

```
{
"id": "com.coveros.training.mathematics.MathServlet.setResultToSum",
"class": "com.coveros.training.mathematics.MathServlet",
"method": "setResultToSum",
"arguments": "[com.coveros.training.mathematics.MathServlet, javax.servlet.http.HttpServletRequest, , ]",
"returnType": ""
},
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the analyzer output using Calculator.java from the linked 7ep sample and inspect the handling of Java method arguments and return types in the callgraph. Compare the overloaded add methods and MathServlet.setResultToSum with the expected signatures; done means primitive types appear and overloaded methods remain distinct.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.