Skip to content

Commit e5ca752

Browse files
timtebeekTeamModerne
authored andcommitted
1 parent 976d366 commit e5ca752

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2242,6 +2242,29 @@ examples:
22422242
language: java
22432243
---
22442244
type: specs.openrewrite.org/v1beta/example
2245+
recipeName: org.openrewrite.staticanalysis.RemoveRedundantNullCheckBeforeLiteralEquals
2246+
examples:
2247+
- description: ''
2248+
sources:
2249+
- before: |
2250+
class A {
2251+
void foo(String s) {
2252+
if (s != null && "test".equals(s)) {
2253+
System.out.println("String matches");
2254+
}
2255+
}
2256+
}
2257+
after: |
2258+
class A {
2259+
void foo(String s) {
2260+
if ("test".equals(s)) {
2261+
System.out.println("String matches");
2262+
}
2263+
}
2264+
}
2265+
language: java
2266+
---
2267+
type: specs.openrewrite.org/v1beta/example
22452268
recipeName: org.openrewrite.staticanalysis.RemoveRedundantTypeCast
22462269
examples:
22472270
- description: ''

0 commit comments

Comments
 (0)