Bug 93536

Summary: [1.5] Internal compiler generating error on code that javac accepts
Product: [Eclipse Project] JDT Reporter: Antonio M. D'souza <eclipse_hacker>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 RC2   
Hardware: All   
OS: All   
Whiteboard:

Description Antonio M. D'souza CLA 2005-05-03 10:40:52 EDT
/* 
The following code does not build inside Eclipse even when tools.jar is added to the project's libraries 
and the new JDK 1.5 is used to build it, yet it builds and executes cleanly using javac.
*/

import com.sun.tools.javac.util.List;

public class ListMaker {
	public static void main(String[] args) {
		String[] hairball={"one","two","three"};
		List<String> filenames = List.make(hairball);
	}
}
Comment 1 Philipe Mulet CLA 2005-05-03 12:09:16 EDT
What error do you get ? 
Don't you mean to use java.util.List ?
Did you toggle compiler compliance to 1.5 ?
Comment 2 Philipe Mulet CLA 2005-05-04 15:58:33 EDT
Pls reopen once questions are answered
Comment 3 Antonio M. D'souza CLA 2005-05-12 09:55:43 EDT
Error msg: the method make(String[]) is ambiguous for the type List.
No, I do mean to use com.sun.tools.javac.util.List (and this code builds under javac).
Yes, I have set compiler compliance to 1.5 and all my other generic code compiles with no problems.
Comment 4 Philipe Mulet CLA 2005-05-17 06:20:56 EDT
How did you setup your classpath exactly ?
Comment 5 Antonio M. D'souza CLA 2005-05-17 06:32:11 EDT
I went to the Java Build Path section of the project's properties and added $JAVA_HOME/lib/tools.jar to the 
list of libraries (as an external jar).
Comment 6 Philipe Mulet CLA 2005-05-19 18:32:55 EDT
Reproduced
Comment 7 Kent Johnson CLA 2005-06-03 12:08:31 EDT
Verified its fixed with latest.

Could not reproduce with a testcase that did not need tools.jar
Comment 8 Olivier Thomann CLA 2005-06-06 16:52:57 EDT
Verified using N20050606-0010 + JDT/Core HEAD
Comment 9 Maxime Daniel CLA 2005-06-10 07:15:52 EDT
Verified for 3.1 RC2 using build I20050610-0010

Caveat: tools.jar changed between versions 1.5.0_03 and 1.5.0_04. Use the former
to test.
Comment 10 Frederic Fusier CLA 2005-06-10 10:24:10 EDT
close