Bug 161742 - [1.5] [compiler] Generics compiler discrepancy against JDK 1.5.0_08
Summary: [1.5] [compiler] Generics compiler discrepancy against JDK 1.5.0_08
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2006-10-20 12:15 EDT by Christopher G. Stach II CLA
Modified: 2009-08-30 02:07 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 Christopher G. Stach II CLA 2006-10-20 12:15:22 EDT
The original code in the diff builds and runs fine, but Sun's javac doesn't like it:

-	@SuppressWarnings("unchecked")
-	private static <T> T getItem()
-	{
-		return (T) ITEM.get();

+	private static <T> T getItem(Class<T> klass) {
+		return klass.cast(ITEM.get());

 	}


Sun's compiler error produced occurs where the method is called:

type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds T,java.lang.Object
Comment 1 Philipe Mulet CLA 2006-10-24 05:11:18 EDT
Please provide more context. What is the Eclipse build ID ?
What are is the complete testcase ? What diff builds are you talking about ?

Please reopen once all these questions are answered.
Comment 2 Denis Roy CLA 2009-08-30 02:07:43 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.