Skip to content
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

Merged
merged 4 commits into from
Nov 6, 2018
Merged

Avoid deprecated api usage #109

merged 4 commits into from
Nov 6, 2018

Conversation

darxriggs
Copy link
Contributor

@darxriggs darxriggs changed the title Avoid deprecated methods Avoid deprecated api usage Oct 6, 2018
@@ -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);
Copy link
Member

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;
Copy link
Member

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?

Copy link
Member

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.

@svanoort svanoort merged commit 8339c98 into jenkinsci:master Nov 6, 2018
@darxriggs darxriggs deleted the avoid-deprecated-methods branch November 6, 2018 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants