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

Cleanup #91

Merged
merged 3 commits into from
Feb 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

package org.jenkinsci.plugins.workflow.support.actions;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.FilePath;
import hudson.model.DirectoryBrowserSupport;
import hudson.model.Item;
Expand All @@ -51,7 +50,6 @@ public final class WorkspaceActionImpl extends WorkspaceAction implements FlowNo
private final Set<LabelAtom> labels;
private transient FlowNode parent;

@SuppressFBWarnings(value="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", justification="TODO 1.653+ switch to Jenkins.getInstanceOrNull")
public WorkspaceActionImpl(FilePath workspace, FlowNode parent) {
node = FilePathUtils.getNodeName(workspace);
Jenkins j = Jenkins.getInstanceOrNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import hudson.FilePath;
import hudson.Util;
import hudson.remoting.VirtualChannel;
import hudson.util.ClassLoaderSanityThreadFactory;
import hudson.util.DaemonThreadFactory;
import hudson.util.NamingThreadFactory;
import java.util.concurrent.Executors;
Expand All @@ -44,17 +45,7 @@ public class Timeout implements AutoCloseable {

private static final Logger LOGGER = Logger.getLogger(Timeout.class.getName());

// TODO 2.105+ use ClassLoaderSanityThreadFactory from core
static class ClassloaderSanityDaemonThreadFactory extends DaemonThreadFactory {
public Thread newThread(Runnable r) {
Thread t = super.newThread(r);
t.setContextClassLoader(Timeout.class.getClassLoader());
return t;
}
}


private static final ScheduledExecutorService interruptions = Executors.newSingleThreadScheduledExecutor(new NamingThreadFactory(new ClassloaderSanityDaemonThreadFactory(), "Timeout.interruptions"));
private static final ScheduledExecutorService interruptions = Executors.newSingleThreadScheduledExecutor(new NamingThreadFactory(new ClassLoaderSanityThreadFactory(new DaemonThreadFactory()), "Timeout.interruptions"));

private final Thread thread;
private volatile boolean completed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void run() {
try {
printWaitingMessage(listener);
} catch (Exception x) {
listener.getLogger().println(Functions.printThrowable(x).trim()); // TODO 2.43+ use Functions.printStackTrace
Functions.printStackTrace(x, listener.getLogger());
}
} catch (IOException x) {
LOGGER.log(Level.WARNING, null, x);
Expand Down