From a614cfbd6bfb36465d5bc486658204dfc64263c9 Mon Sep 17 00:00:00 2001 From: Christopher Simons Date: Wed, 3 Feb 2016 20:08:57 -0500 Subject: [PATCH] [FIXED JENKINS-32717] fix directory separator bug --- src/main/java/hudson/plugins/jacoco/JacocoPublisher.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/hudson/plugins/jacoco/JacocoPublisher.java b/src/main/java/hudson/plugins/jacoco/JacocoPublisher.java index 1356d586..d036893e 100644 --- a/src/main/java/hudson/plugins/jacoco/JacocoPublisher.java +++ b/src/main/java/hudson/plugins/jacoco/JacocoPublisher.java @@ -76,6 +76,7 @@ public class JacocoPublisher extends Recorder { private final String maximumClassCoverage; private final boolean changeBuildStatus; + private static final String DIR_SEP = "\\s*,\\s*"; /** * Loads the configuration set by user. @@ -269,7 +270,7 @@ protected static FilePath[] resolveDirPaths(AbstractBuild build, BuildList public FilePath[] invoke(File f, VirtualChannel channel) throws IOException { FilePath base = new FilePath(f); ArrayList localDirectoryPaths= new ArrayList(); - String[] includes = input.split(","); + String[] includes = input.split(DIR_SEP); DirectoryScanner ds = new DirectoryScanner(); ds.setIncludes(includes); @@ -359,12 +360,12 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListene logger.println("\n[JaCoCo plugin] Loading inclusions files.."); String[] includes = {}; if (inclusionPattern != null) { - includes = inclusionPattern.split(","); + includes = inclusionPattern.split(DIR_SEP); logger.println("[JaCoCo plugin] inclusions: " + Arrays.toString(includes)); } String[] excludes = {}; if (exclusionPattern != null) { - excludes = exclusionPattern.split(","); + excludes = exclusionPattern.split(DIR_SEP); logger.println("[JaCoCo plugin] exclusions: " + Arrays.toString(excludes)); }