Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 b1998ac
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions src/main/java/org/jvnet/hudson/plugins/m2release/ReleaseCause.java
Expand Up @@ -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.