We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using
I am using the Maven plugin, and my project is a single module project.
<plugin> <groupId>org.openrewrite.maven</groupId> <artifactId>rewrite-maven-plugin</artifactId> <version>5.32.1</version> <configuration> <activeRecipes> <recipe>org.openrewrite.java.migrate.UpgradeToJava17</recipe> </activeRecipes> </configuration> <dependencies> <dependency> <groupId>org.openrewrite.recipe</groupId> <artifactId>rewrite-migrate-java</artifactId> <version>2.16.0</version> </dependency> </dependencies> </plugin>
if (obj instanceof Contact) { if (fieldName.equals("FIRST_NAME")) { Contact cont = (Contact) obj; return getContactLink(cont, null, cont.getFirstName()); } else if (fieldName.equals("LAST_NAME")) { Contact cont = (Contact) obj; return getContactLink(cont, null, cont.getLastName()); } else if (fieldName.equals("FULL_NAME")) { Contact cont = (Contact) obj; return getContactLink(cont, null, cont.getDisplayName()); } }
if (obj instanceof Contact cont) { if (fieldName.equals("FIRST_NAME")) { return getContactLink(cont, null, cont.getFirstName()); } else if (fieldName.equals("LAST_NAME")) { return getContactLink(cont, null, cont.getLastName()); } else if (fieldName.equals("FULL_NAME")) { return getContactLink(cont, null, cont.getDisplayName()); } }
if (obj instanceof Contact cont) { if (fieldName.equals("FIRST_NAME")) { return getContactLink(cont, null, cont.getFirstName()); } else if (fieldName.equals("LAST_NAME")) { Contact cont = cont; return getContactLink(cont, null, cont.getLastName()); } else if (fieldName.equals("FULL_NAME")) { Contact cont = cont; return getContactLink(cont, null, cont.getDisplayName()); } }
stacktrace output here
The text was updated successfully, but these errors were encountered:
Thanks for reporting this issue @mathewm3 ; This one's new to me; the very clear examples help!
If you're interested in helping to resolve this issue then a draft pull request with these cases as a unit test would be a great start.
Sorry, something went wrong.
No branches or pull requests
What version of OpenRewrite are you using?
I am using
How are you running OpenRewrite?
I am using the Maven plugin, and my project is a single module project.
What is the smallest, simplest way to reproduce the problem?
What did you expect to see?
What did you see instead?
What is the full stack trace of any errors you encountered?
Are you interested in contributing a fix to OpenRewrite?
The text was updated successfully, but these errors were encountered: