Bug 93082 - [1.5][compiler] Eclipse accepts assignment between captures with array-type bounds
Summary: [1.5][compiler] Eclipse accepts assignment between captures with array-type b...
Status: VERIFIED FIXED
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 M7   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-28 05:08 EDT by Markus Keller CLA
Modified: 2006-02-11 14:20 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 Markus Keller CLA 2005-04-28 05:08:51 EDT
I20050426-1700

Eclipse accepts this:
	{
		Vector< ? super java.lang.Object[] > lhs= null;
		Vector< ? extends java.lang.Object[] > rhs= null;
		lhs.add(rhs.get(0));
	}

javac says:
C:\e\workspace\zz1.5\src\xy\Try.java:30: cannot find symbol
symbol  : method add(java.lang.Object[])
location: class java.util.Vector<capture of ? super java.lang.Object[]>
		lhs.add(rhs.get(0));
                   ^
Comment 1 Philipe Mulet CLA 2005-04-29 07:06:47 EDT
Added GenericTypeTest#test632-633.
Tuned compatibility check against array bounded captures.
Fixed
Comment 2 Philipe Mulet CLA 2005-04-29 07:13:49 EDT
Fixed
Comment 3 Markus Keller CLA 2005-04-29 13:16:25 EDT
Philippe, are you sure this is not a javac bug?

lhs must be one of:
   Vector<Object[]> | Vector<Object> | Vector<Serializable> | Vector<Cloneable>.

rhs can be:
   Vector<Object[]> | Vector<Number[]> | Vector<String[]> | etc. ...

Can't I take any object that I can get from a rhs Vector and put it into any one
of the lhs Vectors? I can't find a relevant difference to the following snippet,
which both compilers accept:

        Vector< ? super Number> lhsNum= null;
        Vector< ? extends Number > rhsNum= null;
        lhsNum.add(rhsNum.get(0));
Comment 4 Olivier Thomann CLA 2005-05-11 13:29:14 EDT
Verified in I20050510-0010
Comment 5 Markus Keller CLA 2005-05-16 20:40:54 EDT
Actually, I20050426-1700 was correct and this is a bug in javac:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6268476
Comment 6 Philipe Mulet CLA 2005-05-17 04:53:36 EDT
I saw it, and there are other situations which are unclear. Waiting on spec
clarification.
Comment 7 Markus Keller CLA 2006-02-11 14:20:53 EST
Eclipse accepts the example from comment 0 again (fixed in bug 106865).