Bug 330537 - [1.4/1.5][Reconciler] Incorrect error in reconciler.
Summary: [1.4/1.5][Reconciler] Incorrect error in reconciler.
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-18 01:29 EST by Srikanth Sankaran CLA
Modified: 2019-01-27 10:26 EST (History)
4 users (show)

See Also:


Attachments
Another test case (3.17 KB, application/oct-stream)
2013-03-20 05:41 EDT, Dani Megert CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Srikanth Sankaran CLA 2010-11-18 01:29:08 EST
HEAD.

Create a 1.5 project with the following classes:

public class Character implements Comparable<Character> {
	public int compareTo(Character obj) {
		return 0;
	}
}

public interface Comparable<T> {
	public int compareTo(T obj);
}


Create a 1.4 project that depends on the 1.5 project with the
following:

public class X {
    Object fValue;
    public int compareTo(Object obj) {
            return ((Character)fValue).compareTo(obj);
    }
}


See that during reconcile we report an error:

The method compareTo(Character) in the type Character is not applicable for the arguments (Object)

while the code compiles OK. (as it should).

Basically the call gets bound to the bridge method if Character & Comparable
were to be binary types, but we don't seem to handle this case where we materialize the source type from the model.
Comment 1 Srikanth Sankaran CLA 2010-11-18 01:50:11 EST
See also bug 330347
Comment 2 Srikanth Sankaran CLA 2010-11-18 04:10:44 EST
The model gets populated just after parse and is unaware of
synthetics.
Comment 3 Srikanth Sankaran CLA 2010-11-18 06:49:44 EST
(In reply to comment #2)
> The model gets populated just after parse and is unaware of
> synthetics.

So looks like we need to arrange to have method verification
done on the Source Type materialized from the model.
Comment 4 Srikanth Sankaran CLA 2010-11-29 00:29:06 EST
Don't expect to get to it in time for M4. Will revisit
later.
Comment 5 Dani Megert CLA 2013-03-20 05:41:45 EDT
Created attachment 228698 [details]
Another test case

Here's even a more tricky case: the compliance of the affected project is 1.6 but the JRE is 1.4 on it.

Test Case:
1. import the two projects
2. open 'A'
==> reconciler reports error

Using a 1.6 EE fixes the problem.
Comment 6 Szymon Ptaszkiewicz CLA 2013-06-24 09:16:46 EDT
(In reply to comment #5)
> Created attachment 228698 [details]
> Another test case
> 
> Here's even a more tricky case: the compliance of the affected project is
> 1.6 but the JRE is 1.4 on it.
> 
> Test Case:
> 1. import the two projects
> 2. open 'A'
> ==> reconciler reports error
> 
> Using a 1.6 EE fixes the problem.

I can't reproduce the error with these steps. Is it still reproducible for you on 4.3 RC4?
Comment 7 Eclipse Genie CLA 2019-01-26 16:14:35 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.