I have about 100 classses that look like this.
public class MyClass extends MyBaseClass {
public MyClass(OldType variable, int var2, OldType v3) {
//stuff
Now i want to replace all constructor variables of type OldType in classes that extend MyBaseClass with the same variable name, but of type NewType. So it will look like this:
public class MyClass extends MyBaseClass {
public MyClass(NewType variable, int var2, NewType v3) {
//stuff
The amount and names of the variables will vary.
I have already gotten IDEA to find all classes that extend MyBaseClass
using Structural replace, but were do i go from there?
One way to do this is using two search steps. Step one: find the parameters of the constructors of classes extending
MyBaseClass
.Variables
B - Text/regexp:
MyBaseClass
, enable Apply constraint within type hierarchyp - Enable This variable is the target of the search, Occurrences count:
1, unlimited
Step two: Replace variables of the right type in scope
Previous Search Results
.Replacement template: