Skip to content

Commit 112296e

Browse files
committed
Update OpenRewrite BOM, update the status of the nested class bug
1 parent a4cb724 commit 112296e

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ dependencies {
169169

170170
// OpenRewrite
171171
// Import Rewrite's bill of materials.
172-
testImplementation(platform("org.openrewrite.recipe:rewrite-recipe-bom:3.3.0"))
172+
testImplementation(platform("org.openrewrite.recipe:rewrite-recipe-bom:3.6.1"))
173173

174174
// rewrite-java dependencies only necessary for Java Recipe development
175175
testImplementation("org.openrewrite:rewrite-java")

src/main/resources/META-INF/rewrite/rewrite.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,9 @@ recipeList:
8989
- org.openrewrite.java.ChangeMethodName:
9090
methodPattern: net.dv8tion.jda.api.interactions.modals.ModalMapping getId()
9191
newMethodName: getCustomId
92-
# Bugged due to inner classes
93-
# - org.openrewrite.java.ChangeMethodName:
94-
# methodPattern: net.dv8tion.jda.api.components.selects.SelectMenu.Builder getId()
95-
# newMethodName: getCustomId
96-
# - org.openrewrite.java.ChangeMethodName:
97-
# methodPattern: net.dv8tion.jda.api.components.textinput.TextInput.Builder getId()
98-
# newMethodName: getCustomId
92+
- org.openrewrite.java.ChangeMethodName:
93+
methodPattern: net.dv8tion.jda.api.components.selects.SelectMenu.Builder getId()
94+
newMethodName: getCustomId
95+
- org.openrewrite.java.ChangeMethodName:
96+
methodPattern: net.dv8tion.jda.api.components.textinput.TextInput.Builder getId()
97+
newMethodName: getCustomId

src/test/java/net/dv8tion/jda/test/rewrite/MigrateComponentsV2Test.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,14 @@ void replacesGetId()
225225
)
226226
);
227227

228-
// This is bugged, most likely due to inner classes,
229-
// i've tried to switch the inner class separator from . to $, same result.
228+
// Nested classes are bugged.
229+
//
230+
// Upgrading versions (3.3.0 -> 3.6.1) had *some* improvement,
231+
// but it will still *add* an import for the nested class,
232+
// even though it is already qualified starting from the already-imported top-level class.
233+
//
234+
// Though this will happen only if the import wasn't already present,
235+
// it will still produce valid code and the user can mass optimize imports when it's finished.
230236
// rewriteRun(
231237
// spec -> spec.recipeFromResources("net.dv8tion.MigrateComponentsV2"),
232238
// //language=java

0 commit comments

Comments
 (0)