Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332790 - [search] search doesn't find tsuper method calls
Summary: [search] search doesn't find tsuper method calls
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTDT (show other bugs)
Version: 0.8   Edit
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: 0.8 M7   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-16 15:12 EST by Stephan Herrmann CLA
Modified: 2011-04-29 15:19 EDT (History)
0 users

See Also:


Attachments
test & proposed fix (8.52 KB, patch)
2011-04-16 18:36 EDT, Stephan Herrmann CLA
no flags Details | Diff
additional tests & fix (5.81 KB, patch)
2011-04-28 16:35 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2010-12-16 15:12:17 EST
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).
Comment 1 Stephan Herrmann CLA 2011-04-16 18:36:06 EDT
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.
Comment 2 Stephan Herrmann CLA 2011-04-16 18:39:18 EDT
Committed as r1438,9.
Comment 3 Stephan Herrmann CLA 2011-04-16 18:44:51 EDT
.
Comment 4 Stephan Herrmann CLA 2011-04-28 16:01:11 EDT
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.
Comment 5 Stephan Herrmann CLA 2011-04-28 16:35:18 EDT
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.
Comment 6 Stephan Herrmann CLA 2011-04-28 16:36:36 EDT
Additional test & fix committed as r1464
Comment 7 Stephan Herrmann CLA 2011-04-29 15:18:24 EDT
The additional fix has passed all tests.
Comment 8 Stephan Herrmann CLA 2011-04-29 15:19:12 EDT
Verified for 0.8M7 using build 201104281905