Bug 322587

Summary: [quick fix] to add explicit type arguments to method invocation
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: deepakazad
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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) { }
}