You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @blipper ; Could it be that you flipped the before and after examples here? Since we go from replaceAll to replace when we can safely do so. Here's the test I think you meant that indeed replicates nothing is done currently.
@Test@Issue("https://github.com/openrewrite/rewrite-static-analysis/issues/330")
voidoverlyCautious() {
//language=javarewriteRun(
java(
""" class A { String foo(String bar) { return bar.replaceAll("=","|"); } } """,
""" class A { String foo(String bar) { return bar.replace("=","|"); } } """
)
);
}
timtebeek
changed the title
org.openrewrite.staticanalysis.UseStringReplace is overly cautiousUseStringReplace is overly cautious around the use of =Aug 17, 2024
What is the smallest, simplest way to reproduce the problem?
What did you see instead?
https://github.com/openrewrite/rewrite-static-analysis/blob/main/src/main/java/org/openrewrite/staticanalysis/UseStringReplace.java#L77 seems to just scan?
Are you interested in contributing a fix to OpenRewrite?
The text was updated successfully, but these errors were encountered: