mbien commented on code in PR #7655:
URL: https://github.com/apache/netbeans/pull/7655#discussion_r1718939977


##########
java/maven/src/org/netbeans/modules/maven/modelcache/MavenProjectCache.java:
##########
@@ -171,6 +176,35 @@ public static boolean 
unknownBuildParticipantObserved(MavenProject project) {
         return project.getContextValue(CONTEXT_PARTICIPANTS) != null;
     }
     
+    /**
+     * Extracts a timestamp from the MavenProject. Timestamps are placed
+     * as context values in {@link #loadOriginalMavenProjectInternal}.
+     * @param p project
+     * @return timestamp, -1 if p is null, -2 if unknown
+     */
+    public static long getLoadTimestamp(MavenProject p) {
+        if (p == null) {
+            return -1;
+        }
+        Object o = p.getContextValue(CONTEXT_LOAD_TIMESTAMP);
+        if (o instanceof Long) {
+            return (long)o;
+        } else {
+            return -2;
+        }

Review Comment:
   nitpick. one of my most favorite java 17 features is:
   ```java
       Object val = p.getContextValue(CONTEXT_LOAD_TIMESTAMP);
       return val instanceof Long l ? l : -2;
   ```



-- 
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]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to