| Summary: | Eclipse shows error for generic type extending abstract class and interface | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Manuel Feichter <manuel.feichter> | ||||||
| Component: | Core | Assignee: | 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: |
|
||||||||
Created attachment 269223 [details]
Screenshot of error in eclipse
bulk move out of 4.8 Bulk move out of 4.9 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. See https://github.com/eclipse-jdt/eclipse.jdt.core/issues/656 - this issue will be tracked there as it is essentially the same problem |
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.