gortiz commented on code in PR #17327:
URL: https://github.com/apache/pinot/pull/17327#discussion_r2618443803


##########
pom.xml:
##########
@@ -2944,6 +2944,29 @@
           </properties>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>de.shadowhunt.maven.plugins</groupId>
+        <artifactId>package-info-maven-plugin</artifactId>
+        <version>2.0.0</version>
+        <executions>
+          <execution>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>package-info</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <packages>
+            <package regex="org.apache.pinot.**">
+              <annotations>
+                
<annotation>@javax.annotation.ParametersAreNonnullByDefault</annotation>
+                <annotation>@org.jspecify.annotations.NullMarked</annotation>

Review Comment:
   We use `javax.annotation` due to historical reasons, but it has several 
flaws. One of them is that it is in `javax` package but not officially 
maintained by Java (IIRC it was included in JEE, which caused issues when 
everything was migrated to jakarta).
   
   There are several nullability annotations created by third parties (ie 
intellij, google, etc). To fix the issues once and for all, several years ago, 
a multi-organization initiative called JSpecify attempted to introduce 
annotations to make Java code safer. They started working on nullability and 
they were so conscientious that the work took a long time. For example, 
contrary to most other annotations (including `javax`), jspecify can 
differentiate between a nullable list of not nullable objects and a not 
nullable list of nullable objects (same with arrays).
   
   Ideally, we should move to JSpecify (for example, Spring did that some years 
ago). But meanwhile, we can use both, especially given our current usage is 
more informal because it is just documentation (we don't use tools to enforce 
the constraints, although we should, but that is a different topic)
   
   See https://jspecify.dev/docs/start-here/ for more info



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to