[FIXED JENKINS-36494] Switch to a try with resources form of impersonation

This commit is contained in:
Stephen Connolly committed 2016-07-07 11:46:45 +01:00
1 parent f9efe65249
commit 0203504a2c
12 files changed
+299 -226

No files matched your search

+4 -6
View File
@@ -24,6 +24,7 @@
package hudson;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.security.ACLContext;
import jenkins.util.SystemProperties;
import hudson.PluginWrapper.Dependency;
import hudson.init.InitMilestone;
@@ -1352,12 +1353,9 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
}
updateCenter.persistInstallStatus();
if(!failures) {
ACL.impersonate(currentAuth, new Runnable() {
@Override
public void run() {
InstallUtil.proceedToNextStateFrom(InstallState.INITIAL_PLUGINS_INSTALLING);
}
});
try (ACLContext _ = ACL.as(currentAuth)) {
InstallUtil.proceedToNextStateFrom(InstallState.INITIAL_PLUGINS_INSTALLING);
}
}
}
}.start();