Bug 244818 - [content assist] wrong completion for common prefix after 'instanceof'
Summary: [content assist] wrong completion for common prefix after 'instanceof'
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-21 10:26 EDT by Markus Keller CLA
Modified: 2010-09-15 06:43 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-08-21 10:26:55 EDT
I20080812-0800

- enable Content Assist pref 'Insert common prefixes automatically'

public class Snippet {
    void m(CharSequence cs) {
        String lower= null;
        if (cs instanceof String) {
            cs.tol // content assist
        }
    }
}

Content Assist where indicated changes 'cs.tol' to 'toLowerCase'. Should complete to '((String) cs).toLowerCase' (and then show proposals list like when invoked after 'cs.to').

In the general case where the same method prefix can be completed from multiple supertypes, no cast should be inserted while the prefix is completed, e.g. ...

        Object al= null;
        if (al instanceof ArrayList)
            al.rem // content assist

... should be completed to 'al.remove' (and then offer proposals list).
Comment 1 Markus Keller CLA 2010-09-15 06:43:33 EDT
Not sure any more what I wanted here. Current behavior looks fine.