jerryshao commented on code in PR #14817:
URL: https://github.com/apache/gravitino/pull/14817#discussion_r4547408627


##########
core/src/main/java/org/apache/gravitino/job/JobRuntimeTemplateMaskUtils.java:
##########
@@ -81,12 +81,11 @@ private JobRuntimeTemplateMaskUtils() {}
    * callers must pass the original map to job execution.
    *
    * @param jobConf runtime configuration from the runJob caller; may be null
-   * @return a masked copy, or null when {@code jobConf} is null
+   * @return a masked copy, or an empty map when {@code jobConf} is null
    */
-  @Nullable
   public static Map<String, String> maskSensitiveJobConf(@Nullable Map<String, 
String> jobConf) {
     if (jobConf == null) {
-      return null;
+      return new LinkedHashMap<>();

Review Comment:
   TestJobRuntimeTemplateMaskUtils (line 252) still does assertNull on 
maskSensitiveJobConf(null), which now fails. Update it to assert an empty map.



##########
core/src/main/java/org/apache/gravitino/job/JobRuntimeTemplateMaskUtils.java:
##########
@@ -81,12 +81,11 @@ private JobRuntimeTemplateMaskUtils() {}
    * callers must pass the original map to job execution.
    *
    * @param jobConf runtime configuration from the runJob caller; may be null
-   * @return a masked copy, or null when {@code jobConf} is null
+   * @return a masked copy, or an empty map when {@code jobConf} is null
    */
-  @Nullable
   public static Map<String, String> maskSensitiveJobConf(@Nullable Map<String, 
String> jobConf) {
     if (jobConf == null) {
-      return null;
+      return new LinkedHashMap<>();

Review Comment:
   JobEventDispatcher.runJob passes this result into RunJobPreEvent and 
RunJobEvent, so listeners now see an empty map instead of null for a null 
jobConf. Is that intended, and could a test cover the dispatcher path?



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

Reply via email to