Skip to content
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

use jspecify annotations #13822

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

use jspecify annotations #13822

wants to merge 1 commit into from

Conversation

@codecov-commenter
Copy link

codecov-commenter commented Aug 15, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.

Project coverage is 61.93%. Comparing base (59551e4) to head (9f29e87).
Report is 1176 commits behind head on master.

Files with missing lines Patch % Lines
...ain/java/org/apache/pinot/common/data/Segment.java 0.00% 1 Missing ⚠️
...ta/segment/SegmentZKMetadataCustomMapModifier.java 0.00% 1 Missing ⚠️
...pinot/controller/util/TableRetentionValidator.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #13822      +/-   ##
============================================
+ Coverage     61.75%   61.93%   +0.18%     
+ Complexity      207      198       -9     
============================================
  Files          2436     2558     +122     
  Lines        133233   141224    +7991     
  Branches      20636    21977    +1341     
============================================
+ Hits          82274    87471    +5197     
- Misses        44911    47089    +2178     
- Partials       6048     6664     +616     
Flag Coverage Δ
custom-integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration <0.01% <0.00%> (-0.01%) ⬇️
integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration2 0.00% <0.00%> (ø)
java-11 61.90% <57.14%> (+0.19%) ⬆️
java-21 61.80% <57.14%> (+0.18%) ⬆️
skip-bytebuffers-false 61.92% <57.14%> (+0.18%) ⬆️
skip-bytebuffers-true 61.78% <57.14%> (+34.05%) ⬆️
temurin 61.93% <57.14%> (+0.18%) ⬆️
unittests 61.93% <57.14%> (+0.18%) ⬆️
unittests1 46.37% <66.66%> (-0.52%) ⬇️
unittests2 27.80% <0.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@Jackie-Jiang Jackie-Jiang left a comment

Choose a reason for hiding this comment

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

Thanks for leading this effort! I see there is a @NullMarked annotation that can be applied to module/package level to declare that not annotated fields are non-null. It would be great if we can apply this to all modules

@@ -213,6 +213,7 @@
<javax.servlet-api.version>4.0.1</javax.servlet-api.version>
<jakarta.annotation-api.version>1.3.5</jakarta.annotation-api.version>
<javax.annotation-api.version>1.3.2</javax.annotation-api.version>
<jspecify.version>1.0.0</jspecify.version>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a Java EE libarary? If not, let's keep it separately for easier management

Comment on lines +278 to +281
<dependency>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
</dependency>
Copy link
Contributor

Choose a reason for hiding this comment

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

(minor) We shouldn't need it as it is already included in pinot-spi

@@ -18,14 +18,14 @@
*/
package org.apache.pinot.common.data;

import javax.annotation.Nonnull;
import org.jspecify.annotations.NonNull;
Copy link
Contributor

Choose a reason for hiding this comment

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

We are trying to follow the convention of only annotating the nullable fields, and treat the fields not annotated as non-null. Since you are fixing all annotations, let's remove the Nonnull ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants