Bug 164792

Summary: CodeAssist should treat #clone() special in 1.5 mode
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.3   
Target Milestone: 3.3 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix none

Description Philipe Mulet CLA 2006-11-16 05:44:48 EST
Build 3.3M3

In following code, when completing on #clone(), the proposal shows "Object clone()", whereas no cast is mandated.
In fact, the compiler treats this as if the message send was return the receiver type; and the binding still shows Object as its return type.

public class X {
    public void setAttributes(String[] attributes) {
    	String[] sortedAttributes = attributes.clone();
    }
}

This special handling in 1.5 mode should be surfaced in codeassist as well.
Comment 1 David Audel CLA 2006-12-06 09:23:52 EST
Created attachment 55129 [details]
Proposed fix
Comment 2 David Audel CLA 2006-12-06 09:33:48 EST
Released for 3.3M4.

Tests added
  CompletionTests_1_5#test0298() -> test0299()
Comment 3 Olivier Thomann CLA 2006-12-11 14:39:28 EST
Verified for 3.3M4 with I20061211-1119