Bug 77325 - [1.5] No warning for not-typesafe Cast
Summary: [1.5] No warning for not-typesafe Cast
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M3   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-29 14:51 EDT by Karsten Becker CLA
Modified: 2004-11-04 11:27 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karsten Becker CLA 2004-10-29 14:51:40 EDT
Here are some warnings expected:
class TriGClass <R,U,V> {
		private U u;
		private V v;
		public TriGClass(U u,V v) { this.u= u; this.v= v; }
		public R getU() { return (R)u; } // Warning
		public R getV() { return (R)v; } // Warning
	}
Comment 1 Karsten Becker CLA 2004-10-29 15:07:15 EDT
Cloesly related example:
class GCT<T> {
	 Object o;
	 public T getT() { return (T)o; } // Warning
	 }
Comment 2 Philipe Mulet CLA 2004-11-02 12:38:37 EST
I am getting warnings for the 3 of them:
----------
1. WARNING in d:\X.java (at line 5)
	public R getU() { return (R)u; } // Warning
	                         ^^^^
Unnecessary cast from U to R
----------
----------
2. WARNING in d:\src\X.java (at line 6)
	public R getV() { return (R)v; } // Warning
	                         ^^^^
Unnecessary cast from V to R
----------
----------
3. WARNING in d:\src\X.java (at line 11)
	public T getT() { return (T)o; } // Warning
	                         ^^^^
Unnecessary cast from Object to T
----------
Comment 3 Frederic Fusier CLA 2004-11-04 05:31:27 EST
Fixed.

Test case added: GenericTypeTest#test381()
Comment 4 Frederic Fusier CLA 2004-11-04 05:32:23 EST
Ooops, test case is #test386()
Comment 5 Frederic Fusier CLA 2004-11-04 11:26:40 EST
These warnings were already raised with 3.1 M2.
So, it's sound more like a WORKSFORME than a FIXED bug...
Reopen to change status.
Comment 6 Frederic Fusier CLA 2004-11-04 11:27:39 EST
Open date is post 3.1 M2, so bug status must be WORKSFORME and should not appear
in JDT/Core buildnotes...