Bug 191029 - Bad compiler error "The constructor ... is ambiguous"
Summary: Bad compiler error "The constructor ... is ambiguous"
Status: RESOLVED DUPLICATE of bug 189933
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.3 RC4   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-05 09:40 EDT by NoName CLA
Modified: 2007-06-05 09:49 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description NoName CLA 2007-06-05 09:40:13 EDT
Build ID: I20070601-1539

Steps To Reproduce:
1. Try to compile the sample code below with eclipse 3.3RC3
2. An error is reported : The constructor TreeMap(Map) is ambiguous
3. javac (jdk1.5.0_11) doesn't report that error

More information:
import java.util.TreeMap;
=== Sample code ==========================
public class TestAmbiguous {
	public void test(TreeMap<String, Object> tm) {
		TreeMap copy = new TreeMap(tm);
	}
}

=== javac output ===================
> "C:\Program Files\Java\jdk1.5.0_11\bin\javac.exe" -Xlint TestAmbig
uous.java
TestAmbiguous.java:6: warning: [unchecked] unchecked call to TreeMap(java.util.S
ortedMap<K,? extends V>) as a member of the raw type java.util.TreeMap
                TreeMap copy = new TreeMap(tm);
                               ^
1 warning
Comment 1 NoName CLA 2007-06-05 09:45:22 EDT
Same error reported without generics:

	public void test2(TreeMap tm) {
		TreeMap copy = new TreeMap(tm);
	}
Comment 2 Olivier Thomann CLA 2007-06-05 09:46:40 EDT

*** This bug has been marked as a duplicate of bug 189933 ***
Comment 3 Olivier Thomann CLA 2007-06-05 09:47:40 EDT
Fix for bug 189933 fixes this problem as well.
Comment 4 Olivier Thomann CLA 2007-06-05 09:49:29 EDT
Both issues (generic and non generic cases) are fixed with fix for bug 189933.