Skip to content
Permalink
Browse files

[JENKINS-20791] ReleaseCause should extend UserIdCause

Signed-off-by: Anders Hammar <anders@hammar.net>
  • Loading branch information...
andham committed Nov 28, 2013
1 parent 531f00d commit b1998ac16fc334d3ac8553c4630f722def49e333
Showing with 20 additions and 21 deletions.
  1. +20 −21 src/main/java/org/jvnet/hudson/plugins/m2release/ReleaseCause.java
@@ -23,27 +23,26 @@
*/
package org.jvnet.hudson.plugins.m2release;

import hudson.model.Hudson;
import hudson.model.Cause.UserCause;

public class ReleaseCause extends UserCause {

private String authenticationName;


public ReleaseCause() {
this.authenticationName = Hudson.getAuthentication().getName();
}


@Override
public String getUserName() {
return authenticationName;
}


@Override
import hudson.model.Cause.UserIdCause;

public class ReleaseCause extends UserIdCause {

// Kept for backwards compatibility with saved builds from older versions of the plugin.
// Should be removed in the future!
@Deprecated
private String authenticationName;

@Override
public String getUserName() {
if (this.authenticationName != null) {
return authenticationName;
} else {
return super.getUserName();
}
}

@Override
public String getShortDescription() {
return Messages.ReleaseCause_ShortDescription(authenticationName);
return Messages.ReleaseCause_ShortDescription(getUserName());
}
}

0 comments on commit b1998ac

Please sign in to comment.
You can’t perform that action at this time.