Skip to content

Conversation

@NathanQingyangXu
Copy link
Contributor

This PR aims to eliminate the following two annoying inspection warnings in IDEA:

  1. @NullMarked fieldfs must be initialized (nullness warnings are only useful for production code; if NPE happens in test code, testing has failed and we should have fixedf it already)
Screenshot 2025-03-21 at 4 32 56 PM
  1. Value of ??? is always ??? (so common in testing code due to insufficient testing coverage; currently the issue only manifests itself in com.mongodb.hibernate.internal.cfg.MongoConfigurationBuilderTests)
Screenshot 2025-03-21 at 4 34 19 PM

The .idea/inspectionProfiles/Project_Default.xml was committed, which contains two inspection rules to only enable the above two inspections for Production code.

Screenshot 2025-03-21 at 4 36 19 PM

Note that to test it, you need to restart the IDE when you have switched to the feature branch from main branch. But once restarted, the annoying two warnings for test code would disappear.

Copy link
Member

@stIncMale stIncMale left a comment

Choose a reason for hiding this comment

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

I did not re-verified the last commit. Approving with the assumption that you did.

The last reviewed commit is 7811f14.

@NathanQingyangXu NathanQingyangXu merged commit 33ce307 into mongodb:main Mar 24, 2025
6 checks passed
@NathanQingyangXu NathanQingyangXu deleted the tweak-idea-setting-for-test branch March 24, 2025 17:00
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