Bug 97206

Summary: [refactoring] Infer Generic Type Arguments on primitive type arrays not working
Product: [Eclipse Project] JDT Reporter: Benjamin Pasero <ENJ>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: VERIFIED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: dirk_baeumer
Version: 3.1   
Target Milestone: 3.1 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Benjamin Pasero CLA 2005-05-30 06:00:13 EDT
Version: 3.1.0
Build id: I20050527-1300 (RC1)

Steps to reproduce (example for int[]):
1.) Have a class like that:

public class Main {
  public void loadSashWeights() {
    Hashtable hash = new Hashtable();
    hash.put("Foo", new int[] { 3 });
  }
}

2.) Run Refactor > Infer Generic Type Arguments

Actual Results:
The first line of the Method is changed to
Hashtable<String, I[]> hash = new Hashtable<String, I[]>();

Expected Results:
The first line of the Method is changed to
Hashtable<String, int[]> hash = new Hashtable<String, int[]>();

Regards,
Ben
Comment 1 Dirk Baeumer CLA 2005-06-01 06:20:09 EDT
Markus, can you please comment:

- do you suggest to fix ?
- how risky ?

Comment 2 Markus Keller CLA 2005-06-09 13:28:12 EDT
Works for me in N20050609-0010. In RC1, there was a problem restoring primitive
type bindings from keys, which probably caused this.
Comment 3 Tobias Widmer CLA 2005-06-10 10:13:58 EDT
Verified using I20050610-0010