Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 519245

Summary: Eclipse shows error for generic type extending abstract class and interface
Product: [Eclipse Project] JDT Reporter: Manuel Feichter <manuel.feichter>
Component: CoreAssignee: Srikanth Sankaran <srikanth.sankaran>
Status: CLOSED MOVED QA Contact:
Severity: normal    
Priority: P3 CC: manuel.feichter, srikanth.sankaran, stephan.herrmann
Version: 4.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:
Attachments:
Description Flags
Project demonstrating the problem
none
Screenshot of error in eclipse none

Description Manuel Feichter CLA 2017-07-05 11:08:44 EDT
Created attachment 269222 [details]
Project demonstrating the problem

When you declare a generic type parameter at the class level and you require the type to extend a class and an interface then eclipse will show an error if the class the type parameter has to extend, contains a package protected abstract method and that class is not in the same package.

The error you get is something like:
This class must implement the inherited abstract method MyOtherAbstractClass.myAbstractMethod(), but cannot override it since it is not visible from GenericTypeWithClassAndInterface. Either make the type abstract or make the inherited method visible

So the eclipse compiler somehow seems to think that the class is actually extending the abstract class used in the type parameter in this case.

See attached project for an example.
Comment 1 Manuel Feichter CLA 2017-07-05 11:09:37 EDT
Created attachment 269223 [details]
Screenshot of error in eclipse
Comment 2 Manoj N Palat CLA 2018-05-17 03:23:36 EDT
bulk move out of 4.8
Comment 3 Manoj N Palat CLA 2018-08-16 00:07:21 EDT
Bulk move out of 4.9
Comment 4 Eclipse Genie CLA 2022-10-17 05:25:50 EDT
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.
Comment 5 Srikanth Sankaran CLA 2023-05-30 07:38:20 EDT
See https://github.com/eclipse-jdt/eclipse.jdt.core/issues/656 - this issue will be tracked there as it is essentially the same problem