Bug 499344 - Error message for not an error on mutual exclusive interfaces (inofficial 3rd party library)
Summary: Error message for not an error on mutual exclusive interfaces (inofficial 3rd...
Status: CLOSED DUPLICATE of bug 496591
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.7   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-08 03:27 EDT by Peter CLA
Modified: 2016-08-22 02:48 EDT (History)
4 users (show)

See Also:


Attachments
Screenshot (166.55 KB, image/png)
2016-08-08 03:27 EDT, Peter CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter CLA 2016-08-08 03:27:26 EDT
Created attachment 263504 [details]
Screenshot

The Problem is hard to understand. Basically I have one final class that implements an interface multiple time, no big deal. Since java 1.5, interfaces can use generics for method params/return values in Methods. If one interface (having generics) is inherited multiple times the compiler gives an error if the generic-types are different (because the signature of methods using generics, may differ)!


Reproduce:


Create simple project (group "a", artifact "a"). Add 

<dependencies>
	<dependency>
		<groupId>net.vectorpublish</groupId>
		<artifactId>API</artifactId>
		<version>0.9.10</version>
	</dependency>
	<dependency>
		<groupId>net.vectorpublish</groupId>
		<artifactId>Start</artifactId>
		<version>0.9.10</version>
		<scope>runtime</scope>
	</dependency>
</dependencies>
<repositories>
	<repository>
		<id>Vectorpublish</id>
		<url>http://www.vectorpublish.net/</url>
	</repository>
</repositories>

to the pom.xml

Create a class like this:

package e;
import java.awt.event.ActionEvent;
import javax.swing.Icon;
import net.vectorpublish.desktop.vp.api.history.BackwardHistoryStepListener;
import net.vectorpublish.desktop.vp.api.ui.VPAbstractAction;
public final class Test extends VPAbstractAction implements BackwardHistoryStepListener {        // <!--- Error here, see below
	public Test(Icon small, Icon large) {super(small, large);}
	public void actionPerformed(ActionEvent e) {}
	public void notifyHSUndone() {}
}

Error: The interface InheritanceExclusion cannot be implemented more than once with different arguments: InheritanceExclusion<InheritanceExclusion.CDIBean> and InheritanceExclusion<InheritanceExclusion.CDIBean>

Expectation: No error.


The problem is now: The interfaces do not differ but a error is displayed in eclipse only!

Yes this works great, even "mvn clean install" works in eclipse and in terminal.
Comment 1 Anton Tanasenko CLA 2016-08-08 06:18:03 EDT
This should go to the JDT compiler
Comment 2 Peter CLA 2016-08-08 07:07:30 EDT
JDT works correctly. I guess it is a m2e problem.
Comment 3 Anton Tanasenko CLA 2016-08-08 07:11:45 EDT
(In reply to Peter from comment #2)
> JDT works correctly. I guess it is a m2e problem.

Then close it. M2e does not perform any compilation, it only sets jdt config.
Comment 4 Till Brychcy CLA 2016-08-08 08:51:16 EDT
sounds like Bug 496591.
can you try with 4.7M1 ?
Comment 5 Jay Arthanareeswaran CLA 2016-08-08 09:19:26 EDT
Peter, which version of Eclipse do you use? I just tried with the latest Oxygen build and can't reproduce.
Comment 6 Peter CLA 2016-08-08 14:52:37 EDT
Using jar-files without m2e works great and the error disappears.

Anton, i am sure tagging as JDT will result in close as not reproducable/worksforme!

Till, because this error only appears using m2e i need a 4.7M1 including m2e what is currently not yet available. I will wait for M1 and report test results.
Comment 7 Stephan Herrmann CLA 2016-08-20 19:17:51 EDT
M1 has been released, but no packages have been built. But that shouldn't stop you from testing, starting from SDK 4.7M1 you should be able to install m2e from the neon repo or such.
Comment 8 Peter CLA 2016-08-21 01:23:31 EDT
Stephan, i tried a installation 2016-08-07 but without success. Before you try it yourself read this message please: http://dev.eclipse.org/mhonarc/lists/cross-project-issues-dev/msg13505.html may gives a hint why there is no installation candidate yet.

Well, i did not found a plug-in's zip to force a partital and basic installation. What i can do is to download the m2e-sources but starting from this point i might be able to find the bug by myself (maybe) and start as an stranger outside of the developmentprocess of m2e.
Comment 9 Stephan Herrmann CLA 2016-08-21 07:58:00 EDT
(In reply to Peter from comment #8)
> Stephan, i tried a installation 2016-08-07 but without success. Before you
> try it yourself read this message please:
> http://dev.eclipse.org/mhonarc/lists/cross-project-issues-dev/msg13505.html
> may gives a hint why there is no installation candidate yet.
> 
> Well, i did not found a plug-in's zip to force a partital and basic
> installation. What i can do is to download the m2e-sources but starting from
> this point i might be able to find the bug by myself (maybe) and start as an
> stranger outside of the developmentprocess of m2e.

What I meant is:
- start with Eclipse SDK from http://download.eclipse.org/eclipse/downloads/
- install m2e from http://download.eclipse.org/releases/neon
  alternatively, if m2e have a more recent build on a specific update site
  that would be fine, too.

HTH

OTOH, if you want to help on the m2e side, you may want to start with a mail to their dev mailing list at https://dev.eclipse.org/mailman/listinfo/m2e-dev hopefully they would provide some guidance there. Alternatively, we could move this bug back to m2e.

If, however, SDK 4.7M1 plus m2e latest is free of this error, than none of this may be necessary.
Comment 10 Anton Tanasenko CLA 2016-08-21 10:17:10 EDT
Ok, just to clear m2e's name in this issue, here are the steps to reproduce in vanilla java project.

Create standalone classes:

public interface IGeneric<C> {
	public interface Foo {
	}
}

public interface IFace extends IGeneric<IGeneric.Foo> {
}

public class Test implements IFace, IGeneric<IGeneric.Foo> {
}

Now, whenever you change something in class Test, it gets that error and when you change something in one of those interfaces (that triggers a compilation, say, add a method to Foo), the error is cleared.

However, if the Foo interface is moved to a separate file, the error does not appear at all.
Comment 11 Peter CLA 2016-08-22 02:48:47 EDT
Stephan, I installed the eclipse 4.7M1 SDK and the m2e plug-in from 4.6(!) successfully. Sorry i did not read your comment carefully.

     After a short Setup i could not reproduce the problem in Oxygen anymore.

I close as possible duplicate of 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=496591 as Till suggested.

Anyway, I am confused. I try to reproduce with 4.6 and it works fine only without m2e. But with m2e the bug disables the compilation. 

Anton, I moved the interfaces around CDIBean to seperate files to have an workaround for users working with 4.6 (... and me, too until oxygen is released). I must say that the bug still disables the compilation, your Foo and my CDIBean are different and the bug maybe more complex than.

Anyway, it works in Oxygen.

*** This bug has been marked as a duplicate of bug 496591 ***