aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-runner-impl/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-runner-impl/src/main')
-rw-r--r--sonar-runner-impl/src/main/java/org/sonar/runner/impl/BatchLauncher.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/sonar-runner-impl/src/main/java/org/sonar/runner/impl/BatchLauncher.java b/sonar-runner-impl/src/main/java/org/sonar/runner/impl/BatchLauncher.java
index 96c28db..a862a38 100644
--- a/sonar-runner-impl/src/main/java/org/sonar/runner/impl/BatchLauncher.java
+++ b/sonar-runner-impl/src/main/java/org/sonar/runner/impl/BatchLauncher.java
@@ -50,6 +50,18 @@ public class BatchLauncher {
doExecute(jarDownloader, props, extensions);
}
+ private static String[][] getMaskRules(final Properties props) {
+ String maskRulesProp = props.getProperty(InternalProperties.RUNNER_MASK_RULES, null);
+ String[] maskRulesConcat = maskRulesProp != null ? maskRulesProp.split(",") : new String[0];
+ String[][] maskRules = new String[maskRulesConcat.length][2];
+ for (int i = 0; i < maskRulesConcat.length; i++) {
+ String[] splitted = maskRulesConcat[i].split("\\|");
+ maskRules[i][0] = splitted[0];
+ maskRules[i][1] = splitted.length > 1 ? splitted[1] : "";
+ }
+ return maskRules;
+ }
+
/**
* @return the {@link org.sonar.runner.batch.IsolatedLauncher} instance for unit tests
*/
@@ -57,14 +69,7 @@ public class BatchLauncher {
Object launcher = AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
List<File> jarFiles = jarDownloader.download();
- String maskRulesProp = props.getProperty(InternalProperties.RUNNER_MASK_RULES, null);
- String[] maskRulesConcat = maskRulesProp != null ? maskRulesProp.split(",") : new String[0];
- String[][] maskRules = new String[maskRulesConcat.length][2];
- for (int i = 0; i < maskRulesConcat.length; i++) {
- String[] splitted = maskRulesConcat[i].split("\\|");
- maskRules[i][0] = splitted[0];
- maskRules[i][1] = splitted.length > 1 ? splitted[1] : "";
- }
+ String[][] maskRules = getMaskRules(props);
IsolatedClassloader classloader = new IsolatedClassloader(getClass().getClassLoader(), maskRules);
classloader.addFiles(jarFiles);
Object launcher = delegateExecution(classloader, props, extensions);