Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311339

Summary: [dom] Quickfix "Add Return Statement" inserts invalid code
Product: [Tools] Objectteams Reporter: Jan Marc Hoffmann <exelnet>
Component: OTDTAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: trivial    
Priority: P3    
Version: 1.4   
Target Milestone: 0.7 M2   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
test & fix none

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