INRIA / INRIA/spoon

Wrong CtExecutableReference if source classpath modified

Open
#2,998 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
2k
Forks
392
Avg merge
11h 24m
Merged PRs (30d)
36

Description

Hi!
I'm having an issue that happens when modifying the source classpath of the spoon Launcher. If I add some jars, it seems the spoon model gets built incorrectly. In particular the `CtExecutableReference` that one gets from an invocation clearly points to a method with a different signature (but same name).
Here is the code of the methods:
```
public Optional> queryState(Class stateClass, Class entityClass, UUID linearId) {
return this.queryState(stateClass, entityClass, "linearId", linearId);
}
public Optional> queryState(Class stateClass, Class entityClass, String attributeName, Object value) {
//Other non-relevant code
}
```
And here are the screenshots of intelliJ debugger:
When running with more classes on classpath (wrong executable reference):
![WrongExecutable](https://user-images.githubusercontent.com/26648467/58543323-8cc6e780-81ff-11e9-8484-9dadf6b8d2cf.png)
When running with less classes on classpath (correct executable reference):
![CorrectExecutable](https://user-images.githubusercontent.com/26648467/58543362-9fd9b780-81ff-11e9-9862-c6ed1452e327.png)

I know it is really hard to debug something like this; it's just hard on my side to reproduce the bug in an easy way.
Do you have any idea why this might happen?
Thanks!
Luca

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.