Clarify JavaParserUtil.resolveTypeName comments - #8173
Conversation
Document why a type parameter, a type in the same package, and a fully-qualified name are looked up in the order they are. Replace the `importedName.length() > firstComponent.length()` test by the equivalent but clearer `!importedName.equals(firstComponent)`. No behavior change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughUpdated Priority: ⬇️ Low Change: Other Merge Risk: ⚪ Minimal · up to This change only clarifies documentation, renames a local variable, and preserves the existing predicate behavior. 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
JavaParserUtil.resolveTypeNamelooks names up in a particular order, because a name in scope shadows one that is not. Document why each lookup is where it is: a type parameter takes precedence over everything, a type in the same package over one injava.lang, and any type in scope over the interpretation of the name as fully-qualified.Also replace
importedName.length() > firstComponent.length()by the equivalent but clearer!importedName.equals(firstComponent): the test is asking whether the import has a qualifier, not comparing lengths.No behavior change.
🤖 Generated with Claude Code