Bug 354841 - complex generic inheritance cannot be compiled with indigo but javac and helios can
Summary: complex generic inheritance cannot be compiled with indigo but javac and heli...
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.8 M4   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-16 10:47 EDT by Michael Dänzer CLA
Modified: 2011-12-06 06:44 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Dänzer CLA 2011-08-16 10:47:06 EDT
Build Identifier: 20110615-0604

The following inheritance cannot be compiled by Indigo: The type ElementCollectorOp must implement the inherited abstract method IOperation2<List<A>,IProcess,List<A>>.execute(List<A>, IProcess). The classes look like this (simplified to the basic problem):

public interface IOperation2 <A,B,R> 
{
  public R execute(A arg1, B arg2);
}

public interface IListTransformation2 <A,B,R> extends IOperation2<List<A>,B,List<R>> 
{ }

public abstract class ProcessObjectCollectorOp <A> implements IListTransformation2<A, IProcess, A>
{  
  @Override
  public final List<A> execute(List<A> list, IProcess process)
  {
    return null;
  }

  protected abstract void collect(List<A> list, ZObject zObj, IProcess sub);
}

public class ElementCollectorOp extends ProcessObjectCollectorOp<Pair<IProcess, ZObject>>
{
  public ElementCollectorOp()
  {  }
  
  @Override
  protected void collect(List<Pair<IProcess, ZObject>> list, ZObject zObj, IProcess sub)
  {
	// do something
  }
}

Reproducible: Always
Comment 1 Michael Dänzer CLA 2011-08-16 11:23:03 EDT
code compiles with Helios and javac from java 1.5. compliance level in indigo (and helios) set to 1.6 and used jdk is oracle/sun 1.6.24
Comment 2 Srikanth Sankaran CLA 2011-08-16 11:40:48 EDT
I'll follow up.
Comment 3 Srikanth Sankaran CLA 2011-08-17 06:38:58 EDT
(In reply to comment #0)
> Build Identifier: 20110615-0604
> 
> The following inheritance cannot be compiled by Indigo: The type
> ElementCollectorOp must implement the inherited abstract method
> IOperation2<List<A>,IProcess,List<A>>.execute(List<A>, IProcess). The classes
> look like this (simplified to the basic problem):
> 

Can you please provide a full example that I can feed to JDK 1.5 ?
The snippet as it is provided does not compile with JDK 1.5.
Comment 4 Srikanth Sankaran CLA 2011-10-12 06:23:04 EDT
(In reply to comment #3)

> Can you please provide a full example that I can feed to JDK 1.5 ?
> The snippet as it is provided does not compile with JDK 1.5.

Hello, Have you had a chance to look into this request ? Thanks.
Comment 5 Srikanth Sankaran CLA 2011-11-21 03:22:51 EST
Resolved as WORKSFORME. If this is a real issue, please reopen with a full
test case.
Comment 6 Ayushman Jain CLA 2011-12-06 06:30:50 EST
Verified for 3.8M4 using build I20111202-0800.
Comment 7 Michael Dänzer CLA 2011-12-06 06:44:07 EST
Sorry, I was stuck with other things.

I made some tests with the code I sent and tested as well using a helios workspace (which always compiled the sample successful) with the code sample with Indigo. Sometimes after several refresh and cleans, it compiled. The after one change in the file, it compiled not. But I was not able to find a pattern or reproducible procedure to trigger the problem.

So I changed back to Helios and tried again Indigo SR1. And now everything is fine and works. So, resolved for me too