Skip to content

Commit

Permalink
fix NPE when context method has no declaration in model
Browse files Browse the repository at this point in the history
  • Loading branch information
pvojtechovsky committed May 1, 2017
1 parent 784bea0 commit 7e30b1c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ public <S extends T> CtExecutableReference<S> getOverridingExecutable(
@Override
public boolean isOverriding(CtExecutableReference<?> executable) {
CtExecutable<?> exec = executable.getDeclaration();
if (exec == null) {
CtExecutable<?> thisExec = getDeclaration();
if (exec == null || thisExec == null) {
//the declaration of this executable is not in spoon model
//use light detection algorithm, which ignores generic types
final boolean isSame = getSimpleName().equals(executable.getSimpleName()) && getParameters().equals(executable.getParameters()) && getActualTypeArguments().equals(executable.getActualTypeArguments());
Expand Down

0 comments on commit 7e30b1c

Please sign in to comment.