|
13 | 13 | # limitations under the License. |
14 | 14 | --- |
15 | 15 | 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 |
16 | 36 | recipeName: org.openrewrite.java.jspecify.JSpecifyBestPractices |
17 | 37 | examples: |
18 | 38 | - description: '`JSpecifyBestPracticesTest#migrateFromJavaxAnnotationApiToJspecify`' |
@@ -3422,6 +3442,50 @@ examples: |
3422 | 3442 | } |
3423 | 3443 | } |
3424 | 3444 | language: java |
| 3445 | +- description: '`NoGuavaPredicatesEqualToTest#predicatesEqualToToPredicateIsEqual`' |
| 3446 | + sources: |
| 3447 | + - before: | |
| 3448 | + import com.google.common.base.Predicate; |
| 3449 | + import com.google.common.base.Predicates; |
| 3450 | +
|
| 3451 | + class A { |
| 3452 | + public static Predicate<String> isHelloPredicate() { |
| 3453 | + return Predicates.equalTo("hello"); |
| 3454 | + } |
| 3455 | + } |
| 3456 | + after: | |
| 3457 | + import java.util.function.Predicate; |
| 3458 | +
|
| 3459 | + class A { |
| 3460 | + public static Predicate<String> isHelloPredicate() { |
| 3461 | + return Predicate.isEqual("hello"); |
| 3462 | + } |
| 3463 | + } |
| 3464 | + language: java |
| 3465 | +- description: '`NoGuavaSetsFilterTest#replaceSetsFilter`' |
| 3466 | + sources: |
| 3467 | + - before: | |
| 3468 | + import java.util.Set; |
| 3469 | +
|
| 3470 | + import com.google.common.base.Predicate; |
| 3471 | + import com.google.common.collect.Sets; |
| 3472 | +
|
| 3473 | + class Test { |
| 3474 | + public static Set<Object> test(Set<Object> set, Predicate<Object> isNotNull) { |
| 3475 | + return Sets.filter(set, isNotNull); |
| 3476 | + } |
| 3477 | + } |
| 3478 | + after: | |
| 3479 | + import java.util.Set; |
| 3480 | + import java.util.function.Predicate; |
| 3481 | + import java.util.stream.Collectors; |
| 3482 | +
|
| 3483 | + class Test { |
| 3484 | + public static Set<Object> test(Set<Object> set, Predicate<Object> isNotNull) { |
| 3485 | + return set.stream().filter(isNotNull).collect(Collectors.toSet()); |
| 3486 | + } |
| 3487 | + } |
| 3488 | + language: java |
3425 | 3489 | - description: '`NoGuavaTest#moreObjectsFirstNonNullToObjectsRequireNonNullElse`' |
3426 | 3490 | sources: |
3427 | 3491 | - before: | |
@@ -3510,6 +3574,35 @@ examples: |
3510 | 3574 | language: java |
3511 | 3575 | --- |
3512 | 3576 | type: specs.openrewrite.org/v1beta/example |
| 3577 | +recipeName: org.openrewrite.java.migrate.guava.NoGuavaCollections2Transform |
| 3578 | +examples: |
| 3579 | +- description: '`NoGuavaCollections2TransformTest#replaceCollections2Transform`' |
| 3580 | + sources: |
| 3581 | + - before: | |
| 3582 | + import java.util.Collection; |
| 3583 | +
|
| 3584 | + import com.google.common.base.Function; |
| 3585 | + import com.google.common.collect.Collections2; |
| 3586 | +
|
| 3587 | + class Test { |
| 3588 | + Iterable<Integer> test(Collection<String> collection, Function<String, Integer> toSize) { |
| 3589 | + return Collections2.transform(collection, toSize); |
| 3590 | + } |
| 3591 | + } |
| 3592 | + after: | |
| 3593 | + import java.util.Collection; |
| 3594 | + import java.util.stream.Collectors; |
| 3595 | +
|
| 3596 | + import com.google.common.base.Function; |
| 3597 | +
|
| 3598 | + class Test { |
| 3599 | + Iterable<Integer> test(Collection<String> collection, Function<String, Integer> toSize) { |
| 3600 | + return collection.stream().map(toSize).collect(Collectors.toList()); |
| 3601 | + } |
| 3602 | + } |
| 3603 | + language: java |
| 3604 | +--- |
| 3605 | +type: specs.openrewrite.org/v1beta/example |
3513 | 3606 | recipeName: org.openrewrite.java.migrate.guava.NoGuavaCreateTempDir |
3514 | 3607 | examples: |
3515 | 3608 | - description: '`NoGuavaCreateTempDirTest#inMethodThrowingException`' |
@@ -3671,26 +3764,6 @@ examples: |
3671 | 3764 | language: java |
3672 | 3765 | --- |
3673 | 3766 | type: specs.openrewrite.org/v1beta/example |
3674 | | -recipeName: org.openrewrite.java.migrate.guava.NoGuavaInlineMeMethods |
3675 | | -examples: |
3676 | | -- description: '`NoGuavaInlineMeMethodsTest#stringsRegular`' |
3677 | | - sources: |
3678 | | - - before: | |
3679 | | - import com.google.common.base.Strings; |
3680 | | - class Regular { |
3681 | | - String repeatString(String s, int n) { |
3682 | | - return Strings.repeat(s, n); |
3683 | | - } |
3684 | | - } |
3685 | | - after: | |
3686 | | - class Regular { |
3687 | | - String repeatString(String s, int n) { |
3688 | | - return s.repeat(n); |
3689 | | - } |
3690 | | - } |
3691 | | - language: java |
3692 | | ---- |
3693 | | -type: specs.openrewrite.org/v1beta/example |
3694 | 3767 | recipeName: org.openrewrite.java.migrate.guava.NoGuavaIterablesAnyFilter |
3695 | 3768 | examples: |
3696 | 3769 | - description: '`NoGuavaIterablesAnyFilterTest#replaceIterablesAny`' |
@@ -3723,6 +3796,35 @@ examples: |
3723 | 3796 | language: java |
3724 | 3797 | --- |
3725 | 3798 | type: specs.openrewrite.org/v1beta/example |
| 3799 | +recipeName: org.openrewrite.java.migrate.guava.NoGuavaIterablesTransform |
| 3800 | +examples: |
| 3801 | +- description: '`NoGuavaIterablesTransformTest#replaceIterablesTransform`' |
| 3802 | + sources: |
| 3803 | + - before: | |
| 3804 | + import java.util.Collection; |
| 3805 | +
|
| 3806 | + import com.google.common.base.Function; |
| 3807 | + import com.google.common.collect.Iterables; |
| 3808 | +
|
| 3809 | + class Test { |
| 3810 | + Iterable<Integer> test(Collection<String> collection, Function<String, Integer> toSize) { |
| 3811 | + return Iterables.transform(collection, toSize); |
| 3812 | + } |
| 3813 | + } |
| 3814 | + after: | |
| 3815 | + import java.util.Collection; |
| 3816 | + import java.util.stream.Collectors; |
| 3817 | +
|
| 3818 | + import com.google.common.base.Function; |
| 3819 | +
|
| 3820 | + class Test { |
| 3821 | + Iterable<Integer> test(Collection<String> collection, Function<String, Integer> toSize) { |
| 3822 | + return collection.stream().map(toSize).collect(Collectors.toList()); |
| 3823 | + } |
| 3824 | + } |
| 3825 | + language: java |
| 3826 | +--- |
| 3827 | +type: specs.openrewrite.org/v1beta/example |
3726 | 3828 | recipeName: org.openrewrite.java.migrate.guava.NoGuavaListsNewArrayList |
3727 | 3829 | examples: |
3728 | 3830 | - description: '`NoGuavaListsNewArrayListTest#replaceWithNewArrayList`' |
@@ -3940,35 +4042,6 @@ examples: |
3940 | 4042 | language: java |
3941 | 4043 | --- |
3942 | 4044 | type: specs.openrewrite.org/v1beta/example |
3943 | | -recipeName: org.openrewrite.java.migrate.guava.NoGuavaSetsFilter |
3944 | | -examples: |
3945 | | -- description: '`NoGuavaSetsFilterTest#replaceSetsFilter`' |
3946 | | - sources: |
3947 | | - - before: | |
3948 | | - import java.util.Set; |
3949 | | -
|
3950 | | - import com.google.common.base.Predicate; |
3951 | | - import com.google.common.collect.Sets; |
3952 | | -
|
3953 | | - class Test { |
3954 | | - public static Set<Object> test(Set<Object> set, Predicate<Object> isNotNull) { |
3955 | | - return Sets.filter(set, isNotNull); |
3956 | | - } |
3957 | | - } |
3958 | | - after: | |
3959 | | - import java.util.Set; |
3960 | | - import java.util.stream.Collectors; |
3961 | | -
|
3962 | | - import com.google.common.base.Predicate; |
3963 | | -
|
3964 | | - class Test { |
3965 | | - public static Set<Object> test(Set<Object> set, Predicate<Object> isNotNull) { |
3966 | | - return set.stream().filter(isNotNull).collect(Collectors.toSet()); |
3967 | | - } |
3968 | | - } |
3969 | | - language: java |
3970 | | ---- |
3971 | | -type: specs.openrewrite.org/v1beta/example |
3972 | 4045 | recipeName: org.openrewrite.java.migrate.guava.NoGuavaSetsNewConcurrentHashSet |
3973 | 4046 | examples: |
3974 | 4047 | - description: '`NoGuavaSetsNewConcurrentHashSetTest#replaceWithNewConcurrentHashSet`' |
@@ -4420,6 +4493,24 @@ examples: |
4420 | 4493 | type: specs.openrewrite.org/v1beta/example |
4421 | 4494 | recipeName: org.openrewrite.java.migrate.jakarta.JakartaEE10 |
4422 | 4495 | examples: |
| 4496 | +- description: '`JakartaEE10Test#chainedJettyUpgradeEE10`' |
| 4497 | + sources: |
| 4498 | + - before: | |
| 4499 | + <project> |
| 4500 | + <modelVersion>4.0.0</modelVersion> |
| 4501 | + <groupId>com.example</groupId> |
| 4502 | + <artifactId>demo</artifactId> |
| 4503 | + <version>0.0.1-SNAPSHOT</version> |
| 4504 | + <dependencies> |
| 4505 | + <dependency> |
| 4506 | + <groupId>org.eclipse.jetty.websocket</groupId> |
| 4507 | + <artifactId>websocket-server</artifactId> |
| 4508 | + <version>9.4.58.v20250814</version> |
| 4509 | + </dependency> |
| 4510 | + </dependencies> |
| 4511 | + </project> |
| 4512 | + path: pom.xml |
| 4513 | + language: xml |
4423 | 4514 | - description: '`UpdateAnnotationAttributeJavaxToJakartaTest#replaceInterfaceName`' |
4424 | 4515 | sources: |
4425 | 4516 | - before: | |
@@ -6164,6 +6255,109 @@ examples: |
6164 | 6255 | language: java |
6165 | 6256 | --- |
6166 | 6257 | 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 |
6167 | 6361 | recipeName: org.openrewrite.java.migrate.javax.RemoveEmbeddableId |
6168 | 6362 | examples: |
6169 | 6363 | - description: '`RemoveEmbeddableIdTest#removeIdFromEmbeddableObject`' |
|
0 commit comments