Summary: | [1.8][quick fix] Convert I.m to a default method | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Dani Megert <daniel_megert> |
Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
Status: | ASSIGNED --- | QA Contact: | |
Severity: | enhancement | ||
Priority: | P3 | CC: | noopur_gupta |
Version: | 4.4 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: |
Description
Dani Megert
2014-05-30 04:45:44 EDT
*** Bug 417821 has been marked as a duplicate of this bug. *** When a class or enum has the compile error IProblem.AbstractMethodMustBeImplemented, there could be one or more abstract methods from the implemented interface(s) and/or the extended abstract class. Should the quick fix offer to convert (all possible) unimplemented methods to default methods (similar to the existing "Add unimplemented methods")? Or, multiple quick fixes should be shown, each offering to convert a single (possible) abstract method to default? From the list of unimplemented methods at a type, it should not convert a method to default if its parent interface is at a level < 1.8, if its parent is an abstract class or if the parent cannot be modified (is binary etc). (In reply to Noopur Gupta from comment #2) The ideal scenario where I would need the quick fix is when I add a new method to an existing interface. Unfortunately, the error is not reported on the interface but on a subclass(es). > Should the quick fix offer to convert (all possible) unimplemented methods > to default methods (similar to the existing "Add unimplemented methods")? I think so. Maybe we don't show the new quick fix if all methods from an interface are missing, e.g. when a class adds another interface to its declaration. I think it would be bad coding habit to use an existing "normal" interface and then later make all methods default. |