-
-
Notifications
You must be signed in to change notification settings - Fork 358
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: stackoverflow on AbstractTypingContext #1817
review: fix: stackoverflow on AbstractTypingContext #1817
Conversation
@pvojtechovsky could you review this one? |
l.buildModel(); | ||
|
||
CtType<?> propertyComparator = l.getModel().getElements(new NamedElementFilter<CtType>(CtType.class, "PropertyComparator")).get(0); | ||
CtMethod method = propertyComparator.getMethodsByName("compare").get(0); |
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.
Which call failed on StackOverflowError?
A) getMethodsByName
B) getSignature
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.
getMethodsByName
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.
So why did you removed this method call from the test??
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.
:D sorry I answer yesterday evening and actually I was wrong: it's getAllMethods which led to the bug. My test wasn't failing after all yesterday.
@@ -0,0 +1,156 @@ | |||
/* |
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.
Could you delete as much as possible from this file, so there remains only the code needed to reproduce error?
I do not see there what code caused problem. Or is some combination of all TypeMembers??
// we are in a case where we compare Thing<?> with Thing<? super X> | ||
// here we choose to not care about X to avoid recursive calls, for example in the case of: | ||
// T extends Comparable<? super T> | ||
if (scopeBoundWildcard.getBoundingType().equals(scopeMethod.getFactory().Type().getDefaultBoundingType())) { |
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.
May this happen too?
T extends Comparable<? super List<? extends T>>
I guess it will end wit stackoverflow too.
Anyway your solution is good fast fix. My example is quite wild and it will need some time until somebody come to such problem again.
It seems to be OK for me. I will merge it tomorrow after your feedback - whether you want to improve it or keep it as it is. |
@pvojtechovsky for me it's ready now. |
Thank You Simon ;-) |
Fix #1783