Bug 254756 - [content assist] for method invocation in variable initializer should not guess variable
Summary: [content assist] for method invocation in variable initializer should not gue...
Status: RESOLVED DUPLICATE of bug 236306
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-10 11:26 EST by Markus Keller CLA
Modified: 2009-06-29 11:22 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2008-11-10 11:26:33 EST
I20081104-0916, same in 3.4

Enable content assist preference to insert best guessed arguments. Have:

import java.text.MessageFormat;
public class Try {
	public static void main(String[] args) {
		String fooBar= "Hi";
		String furchtbar= MessageFormat.format|
	}
}

At location of |, invoke content assist. Result:
		String furchtbar= MessageFormat.format(furchtbar, args)

The variable 'furchtbar' should not be guessed, since it is out of scope. Same problem inside field initializers.
Comment 1 Dani Megert CLA 2008-11-11 05:36:58 EST
org.eclipse.jdt.core.CompletionContext.getVisibleElements(String) should not return them.
Comment 2 David Audel CLA 2009-06-29 11:22:35 EDT

*** This bug has been marked as a duplicate of bug 236306 ***