Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338018 - [quick fix] "Replace with Collections.emptyMap()" et al. can need explicit type arguments
Summary: [quick fix] "Replace with Collections.emptyMap()" et al. can need explicit ty...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.7 M6   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-23 15:43 EST by Markus Keller CLA
Modified: 2011-02-23 15:43 EST (History)
0 users

See Also:


Attachments
Fix & test (16.78 KB, patch)
2011-02-23 15:43 EST, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.