-
-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
review: fix issue related with overridden methods retrieved from getAllMethods #1375
Changes from 5 commits
ef8d3b8
6e150c0
c3196c2
75cb6c9
0822d4b
dd1bada
9145ff4
5385808
94db191
07e74f4
6592482
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -423,6 +423,9 @@ private CtTypeReference<?> getEnclosingType(CtTypeReference<?> typeRef) { | |
*/ | ||
@Override | ||
protected CtTypeReference<?> adaptTypeParameter(CtTypeParameter typeParam) { | ||
if (typeParam == null) { | ||
return null; | ||
} | ||
CtFormalTypeDeclarer declarer = typeParam.getTypeParameterDeclarer(); | ||
if ((declarer instanceof CtType<?>) == false) { | ||
return null; | ||
|
@@ -643,7 +646,7 @@ private CtTypeReference<?> adaptTypeForNewMethod(CtTypeReference<?> typeRef) { | |
if (typeRef instanceof CtTypeParameterReference) { | ||
CtTypeParameterReference typeParamRef = (CtTypeParameterReference) typeRef; | ||
CtTypeParameter typeParam = typeParamRef.getDeclaration(); | ||
if (typeParam.getTypeParameterDeclarer() instanceof CtExecutable) { | ||
if (typeParam != null && typeParam.getTypeParameterDeclarer() instanceof CtExecutable) { | ||
//the parameter is declared in scope of Method or Constructor | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If In what situtation it happens? Is it really correct to ignore that null? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was happening in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So it sounds like another bug of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ok I'm working on it, it seems to be related with my recent changes with CtTypeParameter on method parameters.
I'll change that. |
||
return typeRef.clone(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This set should not be needed anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right! Please remove it too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I may have found an issue which prevent me from removing the set, see #1407. I propose to keep it as it is (it works well now) and to remove it later if needed following the change made for #1407
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would first merge this, with a clean implementation, and maybe a temporary behavioral change highlighted in the test diff. And then, we can concentrate on #1407.