-
Notifications
You must be signed in to change notification settings - Fork 90
3.0.0-M3 Support for Apache Solr Removed #371
New issue
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR @ravig-kant ! 🚀
I had one comment.
...n/java/org/springframework/sbm/boot/upgrade_27_30/checks/ApacheSolrRepositoryBeanFinder.java
Outdated
Show resolved
Hide resolved
…code of parent class is not present
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ravig-kant 🚀
Hi @fabapp2 Can you help me with the Test failure? I cannot find the correct API to get the super class in AST. OpenRewriteType.getExtends() does not return a value unless the superclass is in the same project. |
Hi @ravig-kant Sorry for my late reply, I am on parental leave.
Thoughts? |
Hi @fabapp2 I prefer option 2 as the new API can benefit other use cases. I can implement it but need around two weeks as I am travelling. Thanks |
Great @ravig-kant ! Thanks for keeping up the great work and contributing to Spring Boot Migrator. 🚀 |
Hi @fabapp2 I attempted to change the code as per approach 2. However, I couldn't find the required support in OpenRewrite to complete the implementation. ClassDeclration holds JavaType as JavaType.Unknown if the interface does not exist in the same project. The object graph I used to get the JavaType from ClassDeclaration is below. classDeclaration.getImplements().stream().findFirst().get()).getClazz() The object returned by the above expression is of type J.Identifier. J.Identifier has an instance variable called simpleName, which holds the correct value. I thought of combining it with the CompilationUnit.getImports(). I couldn't complete it this way because J.Identifier.simpleName is protected without any getters. So OpenRewrite needs to provide a getter for simpleName to complete this task. |
Hi @ravig-kant Thanks for looking into this again! I'm guessing, but the reason for
Sandeep and Andrei had to solve something similar, here's what they did in Lines 64 to 70 in b501d07
Maybe something like could do the trick for us in public boolean isExtending(String fullyQualifiedName) {
// and the if when anything in getClassDeclaration().getType().getInterfaces() might return null
return getClassDeclaration().getType().getInterfaces().stream()
.anyMatch(impl -> impl.getFullyQualifiedName().equals(fullyQualifiedName));
} Could try if this would solve our problem? |
Hi @fabapp2 Thanks for pointing out the correct API to build the TestProjectContext. I have updated the PR. The test is fixed. So it's ready to merge. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution @ravig-kant 🚀
No description provided.