Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 338018

Summary: [quick fix] "Replace with Collections.emptyMap()" et al. can need explicit type arguments
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.7   
Target Milestone: 3.7 M6   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Fix & test none

Description Markus Keller CLA 2011-02-23 15:43:00 EST
Created attachment 189638 [details]
Fix & test

HEAD

The "Replace with Collections.empty*()" quick fix can need explicit type arguments in some cases:

package p;

import java.util.*;

public class C {
    public C(List<String> list) { }
    public void bar(Map<String, Integer> map) { }
    
    void foo() {
        new C(Collections.EMPTY_LIST);
        bar(Collections.EMPTY_MAP);
        Set<String> var= Collections.EMPTY_SET;
    }
}
Comment 1 Markus Keller CLA 2011-02-23 15:43:30 EST
Fixed in HEAD.