Skip to content

Commit

Permalink
Add test case for issue #384
Browse files Browse the repository at this point in the history
  • Loading branch information
adambir committed Oct 30, 2024
1 parent 286d4ee commit fdf345b
Showing 1 changed file with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;

import static org.openrewrite.java.Assertions.java;
import static org.openrewrite.java.Assertions.srcTestJava;
import static org.openrewrite.java.Assertions.*;

class ReplaceDuplicateStringLiteralsTest implements RewriteTest {

Expand Down Expand Up @@ -727,4 +726,32 @@ interface A {
)
);
}

@Issue("https://github.com/openrewrite/rewrite-static-analysis/issues/384")
@Test
void staticWithObjectArray() {
rewriteRun(
//language=java
java(
"""
class A {
public void method() {
Object[] args = null;
args = new Object[] {"value"};
}
}
""",
"""
class A {
public void method() {
Object[] args = null;
args = new Object[] {"value"};
}
}
"""
)
);
}


}

0 comments on commit fdf345b

Please sign in to comment.