push_down
Moves a method or field from a superclass into its direct subclasses and removes it from the superclass. Position on the member name to generate per-file edits.
Instructions
Push a method or field down into the declaring class's subclasses and remove it from the declaring class.
USAGE: Position on the member name in the superclass. OUTPUT: editsByFile covering the superclass (member removed) and each subclass (member added); warnings from JDT's condition checking, by the place each names (file, then position; those naming one place in JDT's order, those naming none last). Edits are returned as text - apply them yourself.
The direct subclasses are those of the Java model, local and anonymous classes in and after lambda bodies included. A member whose class has an anonymous direct subclass is refused, naming each anonymous subclass: push down cannot add a member to an anonymous class. A member whose class has a direct subclass that JDT's own type hierarchy leaves out (a class declared in a lambda body, a local class read by the handle of another of the same name) is refused, naming each such subclass: JDT's push down would not write the member into it.
IMPORTANT: Uses ZERO-BASED coordinates.
Requires load_project to be called first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Zero-based line number of the member declaration | |
| column | Yes | Zero-based column number (on the member name) | |
| filePath | Yes | Path to source file containing the member |