eclipse-jdt / eclipse-jdt/eclipse.jdt.ui

[Feature Request] Refactoring for record constructor: change signature

Open
#862 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
59
Forks
127
Avg merge
22h 47m
Merged PRs (30d)
28

Description

It would be nice to have a refactoring for changing the signature of a record constructor: this should change all the occurrences of the "new" instructions instantiating the record.

For example

```java
record MyRecord(String name, int age) { ... }
...
new MyRecord("name", 30);
```

refactored to

```java
record MyRecord(int age, String name) { ... }
...
new MyRecord(30, "name");
```

Of course, as with the standard "Change method signature", this should allow for new parameters (with the default value in new statements) or the removal of parameters (with the corresponding removal of the argument in new statements).

Do you think it would make sense?
For sure, it would be useful to me right now ;)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.