Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311339 - [dom] Quickfix "Add Return Statement" inserts invalid code
Summary: [dom] Quickfix "Add Return Statement" inserts invalid code
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTDT (show other bugs)
Version: 1.4   Edit
Hardware: PC Linux
: P3 trivial (vote)
Target Milestone: 0.7 M2   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-03 04:08 EDT by Jan Marc Hoffmann CLA
Modified: 2010-05-06 10:21 EDT (History)
0 users

See Also:


Attachments
test & fix (4.69 KB, patch)
2010-05-04 06:29 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 Jan Marc Hoffmann CLA 2010-05-03 04:08:16 EDT
Upon this situation a quickfix will fill in wrong code:

Reproduce:

Quickfix on this:

public team class SomeTeam {
	
	protected class Role playedBy SomeBase {
		callin boolean m(){
			
		}
	}

}

Results in:

public team class SomeTeam {
	
	protected class Role playedBy SomeBase {
		callin boolean m(){
			return _OT$cacheInitTrigger;			
		}
	}

}
Comment 1 Stephan Herrmann CLA 2010-05-04 06:29:04 EDT
Created attachment 166931 [details]
test & fix

This patch contains a test and the fix.

TypeBinding.getDeclaredFields() needs to filter generated fields
starting with "_OT$" (as getDeclaredMethods() already does).
Comment 2 Stephan Herrmann CLA 2010-05-04 06:31:23 EDT
Patch has been committed as r291.
Comment 3 Stephan Herrmann CLA 2010-05-06 10:21:09 EDT
Verified for M2 using I201005052210