Bug 75639 - [1.5] Unexpected error inside java editor
Summary: [1.5] Unexpected error inside java editor
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-05 09:59 EDT by David Audel CLA
Modified: 2005-02-16 09:40 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 David Audel CLA 2004-10-05 09:59:58 EDT
build I20040930

1) create the following classes
public class Z {
}

public class Y {
  public <T extends Z> void add(Class<T> t, T l) {}
  public void add(String s, String s2) {}
}

public class X {
  Y var2 = null;
  void bar(Z l)	{
    var2.add(l.getClass(), l);
  }
}

2) compile

There is only one error inside the problem view but there is two error markers
at the same line inside the editor.
Comment 1 Frederic Fusier CLA 2004-10-27 11:59:34 EDT
Using build I200410260800...
now editor and problems view behave identically.
Both reports one error:
----------
1. ERROR in D:\usr\OTI\workspaces\dvpt\v31\HEAD\_Bug\X.java (at line 4)
	var2.add(l.getClass(), l);
	^^^^^^^^^^^^^^^^^^^^^^^^^
Bound mismatch: The method add(Class<? extends Z>, ? extends Z) of type Y is not
applicable for the arguments (Class<? extends Z>, Z). The wildcard parameter ?
extends Z has no lower bound, and may actually be more restrictive than argument Z
----------
1 problem (1 error)
Comment 2 Frederic Fusier CLA 2004-10-27 12:28:31 EDT
Leave opened as this error does not seem really accurate...
Comment 3 Frederic Fusier CLA 2004-10-27 12:41:54 EDT
javac reports following error:
X.java:4: cannot find symbol
symbol  : method add(java.lang.Class<capture of ? extends Z>,Z)
location: class Y
    var2.add(l.getClass(), l);
        ^
1 error
Comment 4 Philipe Mulet CLA 2004-11-10 11:27:39 EST
Closing, this error is expected. Cannot invoke a method with wildcard parameters
with no lower bound. Inference is computing such a substitute for T, but this is
irrelevant.

Unless the spec allows this, will not change current behavior to remain compliant.