Closed kunli2 closed 1 year ago
Update examples extractor to support
Here is an example of an extracted example :
type: specs.openrewrite.org/v1beta/example recipeName: org.openrewrite.java.migrate.UpgradeToJava17 examples: - description: "" sources: - before: | <project> <modelVersion>4.0.0</modelVersion> <properties> <java.version>1.8</java.version> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties> <groupId>com.mycompany.app</groupId> <artifactId>my-app</artifactId> <version>1</version> </project> after: | <project> <modelVersion>4.0.0</modelVersion> <properties> <java.version>17</java.version> <maven.compiler.source>17</maven.compiler.source> <maven.compiler.target>17</maven.compiler.target> </properties> <groupId>com.mycompany.app</groupId> <artifactId>my-app</artifactId> <version>1</version> </project> path: pom.xml language: xml - before: | package com.abc; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Set; class A { private static final List<String> staticList = Collections.singletonList("0"); /* This is a comment */ public void test() { // This is a comment Set<String> stringSet = Collections.singleton("aaa"); List<String> stringList = Collections.singletonList("bbb"); Map<String, Object> stringMap = Collections.singletonMap("a-key", "a-value"); } } after: | package com.abc; import java.util.List; import java.util.Map; import java.util.Set; class A { private static final List<String> staticList = List.of("0"); /* This is a comment */ public void test() { // This is a comment Set<String> stringSet = Set.of("aaa"); List<String> stringList = List.of("bbb"); Map<String, Object> stringMap = Map.of("a-key", "a-value"); } } language: java
Update examples extractor to support
Here is an example of an extracted example :