Bug 322587 - [quick fix] to add explicit type arguments to method invocation
Summary: [quick fix] to add explicit type arguments to method invocation
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-12 17:21 EDT by Markus Keller CLA
Modified: 2010-08-12 21:53 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 2010-08-12 17:21:11 EDT
I20100810-0800

In situations like the one below, we should have a quick fix that adds the required explicit type arguments to an invocation of a generic method.


import java.io.IOException;
import java.util.*;

public class Try {
    void foo(IOException e) {
        handle(Collections.singletonList(e)); //error
        handle(Collections.<Exception>singletonList(e));
        
        List<? super Exception> l1= Collections.nCopies(5, e); //error
        List<? super Exception> l2= Collections.<Exception>nCopies(5, e);
    }

    void handle(List<Exception> list) { }
}