Skip to content

Conversation

lukaszlenart
Copy link
Member

@lukaszlenart lukaszlenart added this to the 7.1.0 milestone Feb 1, 2025
@lukaszlenart lukaszlenart marked this pull request as ready for review February 17, 2025 06:08
@lukaszlenart lukaszlenart modified the milestones: 7.1.0, 7.0.3 Feb 17, 2025
@lukaszlenart lukaszlenart force-pushed the fix/WW-5525-sma-npe branch 2 times, most recently from ac1fbc1 to 60a9823 Compare February 17, 2025 06:40
Copy link
Member

@kusalk kusalk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I understand the intent behind this PR - to eliminate even the possibility of an NPE - I don't believe we need it anymore

We expect target will be null for static members and constructors. However, the target being null doesn't necessarily mean that check is inapplicable. Making that assumption could lead to bugs (pointed out in the comments). It should be up to the consuming method (e.g. #checkDefaultPackageAccess) to determine how to handle the nullability of target. If we wanted to force the consuming method to handle the nullability (and prevent NPEs) a better solution might be to wrap it in an Optional.

The new unit tests look good though, so perhaps we just keep those?

@lukaszlenart
Copy link
Member Author

Done, just tests left :)

Copy link

@lukaszlenart lukaszlenart requested a review from kusalk February 17, 2025 07:37
@lukaszlenart lukaszlenart merged commit 1db8a72 into main Feb 17, 2025
8 checks passed
@lukaszlenart lukaszlenart deleted the fix/WW-5525-sma-npe branch February 17, 2025 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants