Skip to content

Commit 4bb4647

Browse files
refactor: Extract documentation examples from tests with stable source order
Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.java.recipes.ExamplesExtractor?organizationId=ODQ2MGExMTUtNDg0My00N2EwLTgzMGMtNGE1NGExMTBmZDkw Co-authored-by: Moderne <[email protected]>
1 parent 33ad4f1 commit 4bb4647

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

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

+30-30
Original file line numberDiff line numberDiff line change
@@ -2770,6 +2770,18 @@ examples:
27702770
type: specs.openrewrite.org/v1beta/example
27712771
recipeName: org.openrewrite.staticanalysis.SimplifyBooleanExpression
27722772
examples:
2773+
- description: ''
2774+
sources:
2775+
- before: |
2776+
fun getSymbol() : String? {
2777+
return null
2778+
}
2779+
language: kotlin
2780+
- before: |
2781+
val isPositive = getSymbol().equals("+") == true
2782+
after: |
2783+
val isPositive = getSymbol().equals("+")
2784+
language: kotlin
27732785
- description: ''
27742786
sources:
27752787
- before: |
@@ -2789,18 +2801,6 @@ examples:
27892801
}
27902802
}
27912803
language: java
2792-
- description: ''
2793-
sources:
2794-
- before: |
2795-
fun getSymbol() : String? {
2796-
return null
2797-
}
2798-
language: kotlin
2799-
- before: |
2800-
val isPositive = getSymbol().equals("+") == true
2801-
after: |
2802-
val isPositive = getSymbol().equals("+")
2803-
language: kotlin
28042804
---
28052805
type: specs.openrewrite.org/v1beta/example
28062806
recipeName: org.openrewrite.staticanalysis.SimplifyBooleanReturn
@@ -3439,43 +3439,43 @@ examples:
34393439
sources:
34403440
- before: |
34413441
import java.util.*;
3442-
class Test {
3442+
3443+
class Test<X, Y> {
34433444
void test() {
3444-
var ls1 = new ArrayList<String>();
3445-
List<String> ls2 = new ArrayList<String>();
3445+
List<String> ls = new ArrayList<String>();
3446+
Map<X,Y> map = new HashMap<X,Y>();
3447+
List<String> ls2 = new ArrayList<String>() {
3448+
};
34463449
}
34473450
}
34483451
after: |
34493452
import java.util.*;
3450-
class Test {
3453+
3454+
class Test<X, Y> {
34513455
void test() {
3452-
var ls1 = new ArrayList<String>();
3453-
List<String> ls2 = new ArrayList<>();
3456+
List<String> ls = new ArrayList<>();
3457+
Map<X,Y> map = new HashMap<>();
3458+
List<String> ls2 = new ArrayList<String>() {
3459+
};
34543460
}
34553461
}
34563462
language: java
34573463
- description: ''
34583464
sources:
34593465
- before: |
34603466
import java.util.*;
3461-
3462-
class Test<X, Y> {
3467+
class Test {
34633468
void test() {
3464-
List<String> ls = new ArrayList<String>();
3465-
Map<X,Y> map = new HashMap<X,Y>();
3466-
List<String> ls2 = new ArrayList<String>() {
3467-
};
3469+
var ls1 = new ArrayList<String>();
3470+
List<String> ls2 = new ArrayList<String>();
34683471
}
34693472
}
34703473
after: |
34713474
import java.util.*;
3472-
3473-
class Test<X, Y> {
3475+
class Test {
34743476
void test() {
3475-
List<String> ls = new ArrayList<>();
3476-
Map<X,Y> map = new HashMap<>();
3477-
List<String> ls2 = new ArrayList<String>() {
3478-
};
3477+
var ls1 = new ArrayList<String>();
3478+
List<String> ls2 = new ArrayList<>();
34793479
}
34803480
}
34813481
language: java

0 commit comments

Comments
 (0)