// TODO see FilePathPickle:
node = FilePathPickle.Listener.channelNames.get(workspace.getChannel());
if (node == null) {
throw new IllegalStateException("no known slave for " + workspace);
}
Jenkins j = Jenkins.getInstance();
Node n = j == null ? null : node.isEmpty() ? j : j.getNode(node);
labels = new TreeSet<LabelAtom>();
if (n != null) {
labels.addAll(n.getAssignedLabels());
labels.remove(n.getSelfLabel());
}