Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChangeType should also change the source path and constructors when modifying the class definition #1904

Closed
tkvangorder opened this issue Jun 8, 2022 · 0 comments · Fixed by #1949 or #1968
Assignees
Labels
bug Something isn't working design-partner-1 D
Milestone

Comments

@tkvangorder
Copy link
Contributor

tkvangorder commented Jun 8, 2022

The ChangeType recipe should also rename the source file and any constructors when it modifies the class definition (the ignoreDefinition is false) and the Class is the first, top-level class of a compilation unit.

As an example:

Given the recipe:

type: specs.openrewrite.org/v1beta/recipe
name: com.example.RenameSomething:
  - org.openrewrite.java.ChangeType
      oldFullyQualifiedTypeName: com.example.OldClass
      newFullQualfiedTypeName: org.example.NewClass

The expectation would be for the SourceFile to have a modified path of org.exampl.NewClass.java

@tkvangorder tkvangorder added bug Something isn't working design-partner-1 D labels Jun 8, 2022
@tkvangorder tkvangorder changed the title ChangeType should also change the source path when modifying the class definition ChangeType should also change the source path and constructors when modifying the class definition Jun 17, 2022
@traceyyoshima traceyyoshima self-assigned this Jun 22, 2022
@traceyyoshima traceyyoshima added this to the 7.25.0 milestone Jun 22, 2022
traceyyoshima added a commit that referenced this issue Jun 23, 2022
traceyyoshima added a commit that referenced this issue Jun 23, 2022
traceyyoshima added a commit that referenced this issue Jun 23, 2022
@traceyyoshima traceyyoshima reopened this Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working design-partner-1 D
Projects
Archived in project
2 participants