oracle / opengrok

OpenGrok is a fast and usable source code search and cross reference engine, written in Java
http://oracle.github.io/opengrok/
Other
4.29k stars 739 forks source link

Add null guards #4542

Closed pingpingy1 closed 4 months ago

pingpingy1 commented 5 months ago

While the @NotNull decorator informs developers that the correct usage is that the decorated variables should not be null, it does not enforce such in any way. This leads to cases where an incorrectly fed null could propagate far away before being detected (such as via NullPointerExceptions). This commit implements some null guards where needed for a fail-fast treatment of null inputs.

oracle-contributor-agreement[bot] commented 5 months ago

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA). The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

oracle-contributor-agreement[bot] commented 5 months ago

Thank you for signing the OCA.

vladak commented 5 months ago

There are some style issues, you need to fix these.

pingpingy1 commented 4 months ago

Fixed the checkstyle issues, but many untouched tests are failing, indicating coverage loss. I will investigate the cause and perhaps revert some incorrect patches.

pingpingy1 commented 4 months ago

@vladak My apologies; it seems the errors were due to my environment setting. Could you please review my patches after the checkstyle fixes?

vladak commented 4 months ago

Looks good. Thanks !