From f97e456901e191c62597ca4a5c394e8b0c4f5e35 Mon Sep 17 00:00:00 2001 From: sboardwell Date: Mon, 15 Jul 2024 09:34:05 +0200 Subject: [PATCH 1/2] Use correct getters for note fields --- src/main/java/hudson/plugins/git/GitPublisher.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/hudson/plugins/git/GitPublisher.java b/src/main/java/hudson/plugins/git/GitPublisher.java index bbb8332dff..f9f9364ee7 100644 --- a/src/main/java/hudson/plugins/git/GitPublisher.java +++ b/src/main/java/hudson/plugins/git/GitPublisher.java @@ -332,15 +332,15 @@ else if (!tagExists) { if (isPushNotes()) { for (final NoteToPush b : notesToPush) { - if (b.getnoteMsg() == null) + if (b.getNoteMsg() == null) throw new AbortException("No note to push defined"); b.setEmptyTargetRepoToOrigin(); - String noteMsgTmp = environment.expand(b.getnoteMsg()); + String noteMsgTmp = environment.expand(b.getNoteMsg()); final String noteMsg = replaceAdditionalEnvironmentalVariables(noteMsgTmp, build); - final String noteNamespace = environment.expand(b.getnoteNamespace()); + final String noteNamespace = environment.expand(b.getNoteNamespace()); final String targetRepo = environment.expand(b.getTargetRepoName()); - final boolean noteReplace = b.getnoteReplace(); + final boolean noteReplace = b.getNoteReplace(); try { // Lookup repository with unexpanded name as GitSCM stores them unexpanded @@ -579,15 +579,15 @@ public static final class NoteToPush extends PushConfig { private String noteNamespace; private boolean noteReplace; - public String getnoteMsg() { + public String getNoteMsg() { return noteMsg; } - public String getnoteNamespace() { + public String getNoteNamespace() { return noteNamespace; } - public boolean getnoteReplace() { + public boolean getNoteReplace() { return noteReplace; } From 30bc15250cb73a130852614a5e5cb2e883870e5a Mon Sep 17 00:00:00 2001 From: sboardwell Date: Mon, 15 Jul 2024 11:33:12 +0200 Subject: [PATCH 2/2] Reinstate old methods as deprecated. --- .../java/hudson/plugins/git/GitPublisher.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/main/java/hudson/plugins/git/GitPublisher.java b/src/main/java/hudson/plugins/git/GitPublisher.java index f9f9364ee7..c0d3f6ea9b 100644 --- a/src/main/java/hudson/plugins/git/GitPublisher.java +++ b/src/main/java/hudson/plugins/git/GitPublisher.java @@ -579,18 +579,33 @@ public static final class NoteToPush extends PushConfig { private String noteNamespace; private boolean noteReplace; - public String getNoteMsg() { + @Deprecated + public String getnoteMsg() { return noteMsg; } - public String getNoteNamespace() { + @Deprecated + public String getnoteNamespace() { return noteNamespace; } - public boolean getNoteReplace() { + @Deprecated + public boolean getnoteReplace() { return noteReplace; } + public String getNoteMsg() { + return noteMsg; + } + + public String getNoteNamespace() { + return noteNamespace; + } + + public boolean getNoteReplace() { + return noteReplace; + } + @DataBoundConstructor public NoteToPush( String targetRepoName, String noteMsg, String noteNamespace, boolean noteReplace ) { super(targetRepoName);