You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When asking to parse 2 classes a.A & b.B and a.A is using an external class c.C through b.B (see simple code below), the parser reports that a.A is using b.C instead of c.C (C belongs to package c and not b).
Source code you are trying to analyze/transform
// First file A.javapackagea;
importb.B;
publicclassA {
publicstaticvoidcallC(Bb) {
b.getC().xxx();
}
}
// Second file B.javapackageb;
importc.C; // external source not providedpublicinterfaceB {
CgetC();
}
Source code for your Spoon processing
Launcherlauncher = newLauncher();
launcher.addInputResource(inputSource);
CtModelmodel = launcher.buildModel();
for (CtElementctClass : model.getElements(e -> einstanceofCtClass || einstanceofCtInterface)) {
CtType<?> ctType = (CtType<?>) ctClass;
System.out.println(ctType.getQualifiedName() + " is using:");
for (CtTypeReference<?> type : ctType.getUsedTypes(true)) {
System.out.println(" - " + type.getQualifiedName());
}
}
Actual output
a.Aisusing:
- b.C
- b.Bb.Bisusing:
- c.C
Expected output
a.Aisusing:
- c.C
- b.Bb.Bisusing:
- c.C
Spoon Version
10.3.0
JVM Version
11
What operating system are you using?
macOS 11.7.4 (BigSur) - IntelliJ IDEA 2023.1
The text was updated successfully, but these errors were encountered:
Describe the bug
When asking to parse 2 classes a.A & b.B and a.A is using an external class c.C through b.B (see simple code below), the parser reports that a.A is using b.C instead of c.C (C belongs to package c and not b).
Source code you are trying to analyze/transform
Source code for your Spoon processing
Actual output
Expected output
Spoon Version
10.3.0
JVM Version
11
What operating system are you using?
macOS 11.7.4 (BigSur) - IntelliJ IDEA 2023.1
The text was updated successfully, but these errors were encountered: