Bug 164792 - CodeAssist should treat #clone() special in 1.5 mode
Summary: CodeAssist should treat #clone() special in 1.5 mode
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M4   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-16 05:44 EST by Philipe Mulet CLA
Modified: 2006-12-11 14:39 EST (History)
0 users

See Also:


Attachments
Proposed fix (6.01 KB, patch)
2006-12-06 09:23 EST, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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