Skip to content

Commit 521a2f3

Browse files
timtebeekTeamModerne
authored andcommitted
OpenRewrite recipe best practices
Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.recipes.rewrite.OpenRewriteRecipeBestPractices?organizationId=QUxML09wZW4gU291cmNlL09wZW5SZXdyaXRl Co-authored-by: Moderne <team@moderne.io>
1 parent 341b4c0 commit 521a2f3

File tree

1 file changed

+123
-0
lines changed

1 file changed

+123
-0
lines changed

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

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,26 @@
1313
# limitations under the License.
1414
---
1515
type: specs.openrewrite.org/v1beta/example
16+
recipeName: com.google.guava.InlineGuavaMethods
17+
examples:
18+
- description: '`InlineGuavaMethodsTest#stringsRegular`'
19+
sources:
20+
- before: |
21+
import com.google.common.base.Strings;
22+
class Regular {
23+
String repeatString(String s, int n) {
24+
return Strings.repeat(s, n);
25+
}
26+
}
27+
after: |
28+
class Regular {
29+
String repeatString(String s, int n) {
30+
return s.repeat(n);
31+
}
32+
}
33+
language: java
34+
---
35+
type: specs.openrewrite.org/v1beta/example
1636
recipeName: org.openrewrite.java.jspecify.JSpecifyBestPractices
1737
examples:
1838
- description: '`JSpecifyBestPracticesTest#migrateFromJavaxAnnotationApiToJspecify`'
@@ -6235,6 +6255,109 @@ examples:
62356255
language: java
62366256
---
62376257
type: specs.openrewrite.org/v1beta/example
6258+
recipeName: org.openrewrite.java.migrate.javax.MigrateJaxBWSPlugin
6259+
examples:
6260+
- description: '`MigrateJaxwsMavenPluginTest#migrateJaxwsPluginFromJvnetToSunXmlWs`'
6261+
sources:
6262+
- before: |
6263+
<project>
6264+
<modelVersion>4.0.0</modelVersion>
6265+
<groupId>com.example</groupId>
6266+
<artifactId>jaxws-service</artifactId>
6267+
<version>1.0.0</version>
6268+
<build>
6269+
<plugins>
6270+
<plugin>
6271+
<groupId>org.jvnet.jax-ws-commons</groupId>
6272+
<artifactId>jaxws-maven-plugin</artifactId>
6273+
<version>2.1</version>
6274+
<executions>
6275+
<execution>
6276+
<id>wsimport-from-jdk</id>
6277+
<goals>
6278+
<goal>wsimport</goal>
6279+
</goals>
6280+
<configuration>
6281+
<sourceDestDir>${project.build.directory}/generated-sources/wsimport</sourceDestDir>
6282+
<wsdlDirectory>${project.basedir}/src/main/resources/wsdl</wsdlDirectory>
6283+
<wsdlFiles>
6284+
<wsdlFile>STSSAPPrimingService.wsdl</wsdlFile>
6285+
</wsdlFiles>
6286+
<packageName>org.example.generated</packageName>
6287+
<keep>true</keep>
6288+
<nocompile>true</nocompile>
6289+
<verbose>true</verbose>
6290+
</configuration>
6291+
</execution>
6292+
</executions>
6293+
</plugin>
6294+
<plugin>
6295+
<groupId>org.apache.maven.plugins</groupId>
6296+
<artifactId>maven-compiler-plugin</artifactId>
6297+
<version>3.14.1</version>
6298+
<executions>
6299+
<execution>
6300+
<configuration>
6301+
<nocompile>true</nocompile>
6302+
</configuration>
6303+
</execution>
6304+
</executions>
6305+
</plugin>
6306+
</plugins>
6307+
</build>
6308+
</project>
6309+
after: |
6310+
<project>
6311+
<modelVersion>4.0.0</modelVersion>
6312+
<groupId>com.example</groupId>
6313+
<artifactId>jaxws-service</artifactId>
6314+
<version>1.0.0</version>
6315+
<build>
6316+
<plugins>
6317+
<plugin>
6318+
<groupId>com.sun.xml.ws</groupId>
6319+
<artifactId>jaxws-maven-plugin</artifactId>
6320+
<version>2.3.7</version>
6321+
<executions>
6322+
<execution>
6323+
<id>wsimport-from-jdk</id>
6324+
<goals>
6325+
<goal>wsimport</goal>
6326+
</goals>
6327+
<configuration>
6328+
<sourceDestDir>${project.build.directory}/generated-sources/wsimport</sourceDestDir>
6329+
<wsdlDirectory>${project.basedir}/src/main/resources/wsdl</wsdlDirectory>
6330+
<wsdlFiles>
6331+
<wsdlFile>STSSAPPrimingService.wsdl</wsdlFile>
6332+
</wsdlFiles>
6333+
<packageName>org.example.generated</packageName>
6334+
<keep>true</keep>
6335+
<xnocompile>true</xnocompile>
6336+
<verbose>true</verbose>
6337+
</configuration>
6338+
<phase>generate-sources</phase>
6339+
</execution>
6340+
</executions>
6341+
</plugin>
6342+
<plugin>
6343+
<groupId>org.apache.maven.plugins</groupId>
6344+
<artifactId>maven-compiler-plugin</artifactId>
6345+
<version>3.14.1</version>
6346+
<executions>
6347+
<execution>
6348+
<configuration>
6349+
<nocompile>true</nocompile>
6350+
</configuration>
6351+
</execution>
6352+
</executions>
6353+
</plugin>
6354+
</plugins>
6355+
</build>
6356+
</project>
6357+
path: pom.xml
6358+
language: xml
6359+
---
6360+
type: specs.openrewrite.org/v1beta/example
62386361
recipeName: org.openrewrite.java.migrate.javax.RemoveEmbeddableId
62396362
examples:
62406363
- description: '`RemoveEmbeddableIdTest#removeIdFromEmbeddableObject`'

0 commit comments

Comments
 (0)