-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid deprecated api usage #109
Conversation
@@ -275,7 +275,10 @@ public WorkflowRun(WorkflowJob job, File dir) throws IOException { | |||
if (!auth.equals(ACL.SYSTEM)) { | |||
String name = auth.getName(); | |||
if (!auth.equals(Jenkins.ANONYMOUS)) { | |||
name = ModelHyperlinkNote.encodeTo(User.get(name)); | |||
User user = User.getById(name, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be a separate fix... but a worthwhile one that avoids an NPE potentially.
import java.io.IOException; | ||
import java.io.PrintWriter; | ||
import java.io.StringWriter; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
import jenkins.model.TransientActionFactory; | ||
import org.apache.commons.io.IOUtils; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused -- were we somehow importing the wrong dependency here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, explanation for context: we're just wrapping a call to the Commons IOUtils method, no point in doing that.
This is based on the analysis https://ci.jenkins.io/job/Infra/job/deprecated-usage-in-plugins/job/master/566/artifact/output/usage-by-plugin.html.