Check the Object from the serviceMethodCache again
I wrote a test annotationParsingFailureObservedByMultipleWaitingThreads() (modified from @JakeWharton 's annotationParsingFailureObservedByWaitingThreads) in RetrofitTest.java to mock the situation I mentioned in #4114 . And I found that the code in base:trunk branch does failed the test and throw a ClassCastException (3 failures out of 10 test attempts)
This pull request tries to deal with this extreme situation. To verify it, I have ran the test case for 20 times and all succeeded.
This resolves #4113
Excuse me, do you have any plan about this PR? (I am good with closing it because it's intended to deal with a pretty extreme situation, and we can replace the whole method with computeIfAbsent in the future) Thank you. @JakeWharton
I will get to it eventually, but probably not for a few weeks, unfortunately. Don't worry, it has been sitting in my notifications and won't get lost.
I will get to it eventually, but probably not for a few weeks, unfortunately. Don't worry, it has been sitting in my notifications and won't get lost.
Thanks for your response. Then I'll leave it open. Thank you.