| Summary: | [search] search doesn't find tsuper method calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] Objectteams | Reporter: | Stephan Herrmann <stephan.herrmann> | ||||||
| Component: | OTDT | Assignee: | Stephan Herrmann <stephan.herrmann> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | ||||||||
| Version: | 0.8 | ||||||||
| Target Milestone: | 0.8 M7 | ||||||||
| Hardware: | Other | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 193427 [details]
test & proposed fix
The indexer did not record any tsuper method calls.
Fixed by adding overrides to SourceElementParser that record method references
for tsuper and base in analogy to super.
Also contained: receiver type comparison was wrong for tsuper-calls, which
mimic this-calls (for codegen) but semantically are more like super-calls.
Without this fix test031 was now reporting too many occurrences.
Committed as r1438,9. . While verifying I found that tsuper calls are now even found when searching for the tsub method. So in the given example searching for references to SubTeam.R.bar(int) would actually find the tsuper call within this very method, which is wrong. Created attachment 194316 [details] additional tests & fix Additional tests witnessing the issue from comment 4. Note that tests need to create their pattern from java elements because the issue was caused by our work in http://trac.objectteams.org/ot/ticket/48 where we intentionally blank out the pattern's declaringQualification. Fixed by retrieving that lost qualification when resolving a non-virtual reference. Additional test & fix committed as r1464 The additional fix has passed all tests. Verified for 0.8M7 using build 201104281905 |
public team class SuperTeam { protected class R { void bar(int j) {} } } public team class SubTeam extends SuperTeam { @Override protected class R { void bar(int j) { tsuper.bar(3); } } } Searching for references to SuperTeam.R.bar does not find the tsuper call in SubTeam.R.bar, nor does the call-hierarchy show this call. (FUP of bug 331831).