When you setup a slave to do a build the tasks plugin fails to run with a NPE
(ignore the line numbers, they are off since the plugin has been modified a
number of times in CVS since the last release, I'll give the correct line
Total time: 7 minutes 13 seconds
Scanning workspace files for tasks...
I've found what was causing the NPE issue and have 2 possible solutions
The NPE was happening on line 87 in WorkspaceScanner:
87: Collection<Task> tasks = taskScanner.scan(new
After debugging it turns out its because the taskScanner object is null!
The reason is because taskScanner is defined as a transient object:
33: private final transient TaskScanner taskScanner;
Therefore the object does not get serialized when the WorkspaceScanner
object is passed over the network to the slave.
Make the taskScanner non-transient. I like this solution as it is
simple, and the taskScanner should be passed along with the
WorkspaceScanner object I think. I may be wrong of course, we would have
to consult with the author of the plugin who is currently on vacation I
Instantiate the taskScanner object at the point it is needed, not in the
constructor. This would of course mean the taskScanner member should not
be final - or it need not be a member at all, it can be a functional
variable. On the flip side we would have to make high, normal & low as
After some discussion with Kohsuke I'll go ahead and implement solution 2. I
emailed you Drulli but it looks like you're on vacation, hope to touch base with
you when you're back to discuss/go over the changes.