Bug 97206 - [refactoring] Infer Generic Type Arguments on primitive type arrays not working
Summary: [refactoring] Infer Generic Type Arguments on primitive type arrays not working
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC2   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-30 06:00 EDT by Benjamin Pasero CLA
Modified: 2005-06-10 10:13 EDT (History)
1 user (show)

See Also:


Attachments

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