Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-18360

Incorrect use of project.getWorkspace()

XMLWordPrintable

      If you were on GitHub I would probably just file a pull request, but since you are not, the following code in https://svn.jenkins-ci.org/trunk/hudson/plugins/copy-to-slave/src/main/java/com/michelin/cio/hudson/plugins/copytoslave/CopyToMasterNotifier.java looks wrong:

      public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
      ...
          FilePath projectWorkspaceOnSlave = build.getProject().getWorkspace();
      

      This is likely wrong since the project can have many workspaces, and if there are concurrent builds this one may be from a different build. build.getWorkspace() is more correct, and simpler too.

            danielpetisme Daniel Petisme
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: