INRIA / INRIA/spoon

Bug: ClassNotFoundException when calling getActualMethod() on an invocation of a method of an inner class

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

Description

When executing the following processor
```
public class InvocationProcessor extends AbstractProcessor> {
@Override
public void process(CtInvocation element) {
CtExecutableReference executable = element.getExecutable();
Method method = executable.getActualMethod();
}
```

on the class
```
public final class Outer {
public final class Inner {
public Inner foo() {
return new Inner();
}
public Inner bar() {
return foo();
}
}
}
```

a SpoonClassNotFoundException("cannot load class Outer$Inner") with "ClassNotFoundException: Outer$Inner" as its cause is thrown when calling `executable.getActualMethod()`.

~~Actually foo() returns an object of type Inner, so the processor shouldn't trigger.~~

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.