INRIA / INRIA/spoon

Get "full" CtType from a CtInvocation

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

Description

Hello.

Is it possible to get the "full" CtType of the target of an invocation?

For example, imagine we have two classes X and Y in **our** system (they aren't from Java or external dependencies).

`public class X{
public void m(){
new Y().m();
}
}`

`public class Y{
public void m(){
//code here
}
}`

I know I can get the declaration of Y from the invocation in X.m() like this: `invocation.getExecutable().getDeclaringType().getTypeDeclaration();`. However, when I explore said CtType it doesn't have the code present in Y.m(), which I'd like to explore as well. Is there any way I can do this?

(I know Spoon divides the code into three parts: structural part (declarations), code part (executables) and references to program elements)

Thank you,
Nuno

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.