Fix handling of static imports from subclasses#904
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #904 +/- ##
============================================
- Coverage 86.98% 86.97% -0.02%
- Complexity 1959 1965 +6
============================================
Files 77 77
Lines 6330 6348 +18
Branches 1223 1229 +6
============================================
+ Hits 5506 5521 +15
- Misses 420 421 +1
- Partials 404 406 +2 ☔ View full report in Codecov by Sentry. |
yuxincs
left a comment
There was a problem hiding this comment.
Changes LGTM, but I have one clarifying question due to my unfamiliarity with the rest of the codebase.
| methodSymbol = baseSymbol; | ||
| } | ||
| } | ||
| return methodSymbol; |
There was a problem hiding this comment.
question: I'm a bit confused about the previous code. It suggests that we actually want the methodSymbol and we only resolve to baseSymbol under certain conditions (i.e., interface method corresponding to one from java.lang.Object). But it seems with the updated code that we actually always want baseSymbol?
Am I missing something?
There was a problem hiding this comment.
Yes, that's a good question, this was due to my misunderstanding before. Basically, always getting the base symbol is safe, since if there is no different base symbol the baseSymbol() method just returns this. I didn't understand this before; more detail in this comment. In the next EP version the getSymbol overload for MethodInvocationTree will always call baseSymbol(), so in some cases it may get called twice, but that is fine.
Fixes #764