From 8655ada23862d47b969269e8838a3ab8322e23bc Mon Sep 17 00:00:00 2001 From: Zhao Xiaojie Date: Thu, 9 Jul 2020 23:08:28 +0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Jesse Glick --- .../workflow/support/steps/input/InputStepExecution.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepExecution.java b/src/main/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepExecution.java index 78a046a8..7c75378d 100644 --- a/src/main/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepExecution.java +++ b/src/main/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepExecution.java @@ -251,20 +251,18 @@ public HttpResponse doAbort() { private void notifyInput(InputExtension.InputEvent inputEvent) { InputStep inputStep = this.getInput(); Jenkins.get().getExtensionList(InputExtension.class).forEach(input -> { - final String extensionName = input.getClass().getSimpleName(); - User currentUser = User.current(); final String userID; if(currentUser != null) { userID = currentUser.getId(); } else { - userID = "anonymous"; + userID = null; } try { input.notifyInput(inputStep, run, userID, listener, inputEvent); } catch (Exception e) { - LOGGER.log(Level.WARNING, String.format("Notification for %s occurred error.", extensionName), e); + LOGGER.log(Level.WARNING, null, e); } }); }