diff --git a/src/main/java/hudson/plugins/scm_sync_configuration/ScmSyncConfigurationPlugin.java b/src/main/java/hudson/plugins/scm_sync_configuration/ScmSyncConfigurationPlugin.java index b4612674..c4826eac 100644 --- a/src/main/java/hudson/plugins/scm_sync_configuration/ScmSyncConfigurationPlugin.java +++ b/src/main/java/hudson/plugins/scm_sync_configuration/ScmSyncConfigurationPlugin.java @@ -30,7 +30,6 @@ import hudson.util.PluginServletFilter; import net.sf.json.JSONObject; -import org.acegisecurity.AccessDeniedException; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; @@ -322,14 +321,6 @@ public List getDefaultIncludes(){ return includes; } - private User getCurrentUser(){ - User user = null; - try { - user = Jenkins.getInstance().getMe(); - }catch(AccessDeniedException e){} - return user; - } - public static ScmSyncConfigurationPlugin getInstance(){ return Jenkins.getInstance().getPlugin(ScmSyncConfigurationPlugin.class); } @@ -447,7 +438,7 @@ public void startThreadedTransaction(){ public Future commitChangeset(ChangeSet changeset){ try { if(!changeset.isEmpty()){ - return this.business.queueChangeSet(createScmContext(), changeset, getCurrentUser(), ScmSyncConfigurationDataProvider.retrieveComment(false)); + return this.business.queueChangeSet(createScmContext(), changeset, User.current(), ScmSyncConfigurationDataProvider.retrieveComment(false)); } else { return null; }