-
Notifications
You must be signed in to change notification settings - Fork 431
Fix NPE in AtmLubVisitor for captured types in switch expressions #7435
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
base: master
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThis change addresses a null pointer exception that occurred during least upper bound computation when processing switch expressions containing method references. A regression test file was added to verify the fix, and defensive null checks were implemented in the Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-11-02T02:18:00.536ZApplied to files:
🔇 Additional comments (4)
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 |
|
Thanks for your pull request. We appreciate it. Although you describe this as a fix, the pull request does not correct the underlying problem, which is that an I agree that users should not see the crash -- and in that sense this pull request has value -- but I would prefer to correct the underlying defect rather than masking it. By the way, your commit has a human name of "Suvrat1629" rather than "Suvrat Acharya". To prevent this in the future, please do one or both of the following:
|
Fixed a Checker Framework crash (NPE in
AnnotationUtils.annotationName) when computing LUB for captured type variables from wildcard capture.The bug occurred because primary annotations were lost on bounds during special-case handling for captured types/wildcards in
lubWildcard.Fix: After merging bounds in
lubWildcard, explicitly calllubPrimaryAnnotationson the upper bound to propagate qualifiers correctly when one side lacks primaries.This prevents null annotations in hierarchies, eliminating the crash.
Added test
checker/tests/nullness/Test6872.javathat previously crashed and now passes cleanly.Fixes #6872