How to Refactor a Method Signature in the DVT Eclipse IDE
Description
This video shows how you can easily add, remove and reorder the arguments of a function or task in the DVT Eclipse IDE.
This video was show using DVT 24.1.1
Transcript
Introduction
In the DVT IDE, you can easily add, remove, and reorder the arguments of a function or task.
Changing the Method Signature
- Place the editor cursor on a method name, either on its declaration or on a method call.
- Then
right-click
and go toRefactor
,Change Method Signature
, or simply press theShift-Alt-C
shortcut. - In the dialog that pops up, click Add and specify the new argument's type, name, and the value to be used in existing calls.
- Use the
up
anddown
buttons to move the arguments.
Previewing the Changes
You can choose to preview the changes about to be performed orclick OK
to apply them.
Let's take a look at the preview.
Note that the changes will be performed both in the extern declaration and in the out-of-body implementation of the function, and all existing function calls will be updated as well.
Handling Overrides in Subclasses
Now let's take another example.
Note that this task has two overrides in UART monitor subclasses
.
Let's remove one of its arguments.
Note that the signature change is reflected in all declarations across the whole object-oriented inheritance tree and in all the task calls as well.