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

Bug 128440

Summary: [infer type arguments] introduces error with multiply-nested collections
Product: [Eclipse Project] JDT Reporter: Grant Gayed <grant_gayed>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard: stalebug

Description Grant Gayed CLA 2006-02-17 12:31:15 EST
3.2M5 Feb. 16th 20:00 build

- retrieve the org.eclipse.swt project into your workspace from dev.eclipse.org
- rename its .classpath_motif file to .classpath (this compiles swt, and it is fine to not be running on motif to do this)
- select the FontDialog class, right-click -> Refactor -> Infer Generic Type Arguments...
- keep both checkboxes in the resulting dialog checked, and press OK to apply the refactoring
- errors are introduced in the getExtStyles(...) and getFaces(String) methods
Comment 1 Markus Keller CLA 2006-02-22 13:10:03 EST
Here's a shrunken version of the problem:

import java.util.ArrayList;
import java.util.List;


public class Try {
    List table= new ArrayList();
    
    void a() {
        List inner= new ArrayList();
        inner.add("bla");
        table.add(inner);
    }
    
    void b() {
        List inner= getInner();
        String s= (String) inner.get(0);
    }
    
    List getInner() {
        List inner= (List) table.get(0);
        return null;
    }
}

Another issue is that setItemsSorted (List list, Hashtable items) is called with different Hashtable<String, ?>. The algorithm currently cannot infer such wildcard signatures. It should leave 'items' raw in this case, but currently just chooses one of the parameterizations.
Comment 2 Eclipse Genie CLA 2019-09-19 06:03:31 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.