Skip to content
Permalink
Browse files

Merge pull request #14 from andham/JENKINS-20791

[JENKINS-20791] ReleaseCause should extend UserIdCause
  • Loading branch information...
jtnord committed Dec 3, 2013
2 parents 531f00d + b1998ac commit 6ecc03b4d2b6beae10642ae809b9266183e389f2
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 6ecc03b

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