Closed mricken closed 2 years ago
Hi @mricken. We should make this more clear in the docs, so sorry for the trouble. This is a recipe that has a required input (unlike some which are able to simply run).
I suggest you define a YAML that contains a specification for the recipe with the options for what you are looking for. For example:
type: specs.openrewrite.org/v1beta/recipe
name: io.moderne.FindDeprecated
displayName: Find some deprecated use
description: Fix all the things.
recipeList:
- org.openrewrite.java.search.FindDeprecatedMethods:
methodPattern: org.springframework..* *(..)
Point configLocation
at the place where you put this YAML file as indicated in https://docs.openrewrite.org/reference/rewrite-maven-plugin.
Hope this helps!
You can play with the values here: https://public.moderne.io/recipes/org.openrewrite.java.search.FindDeprecatedMethods?defaults=W3sibmFtZSI6Im1ldGhvZFBhdHRlcm4iLCJ2YWx1ZSI6Im9yZy5zcHJpbmdmcmFtZXdvcmsuLiogKiguLikifSx7Im5hbWUiOiJpZ25vcmVEZXByZWNhdGVkU2NvcGVzIiwidmFsdWUiOiIifV0=
Now it passes, but it's not complaining about any deprecated uses. Am I wrong that it should detect both of the method invocations here?
com.oracle.bmc.ServiceDetails.setServiceDetails(null, null, null, null);
foo();
I'm trying to use the
FindDeprecatedUses
recipe, but on my very simple example, I get aNullPointerException
.I have the following in my
pom.xml
file:and this is my test file:
When I run
mvn rewrite:dryRun -X
, I get:Full zip file with small Maven project:
deprecateduses.zip