Source:
<code>private void compileRulesLevel(PackageDescr packageDescr, PackageRegistry pkgRegistry, List<RuleDescr> rules) { boolean parallelRulesBuild = this.kBase == null && parallelRulesBuildThreshold != -1 && rules.size() > parallelRulesBuildThreshold; if (parallelRulesBuild) { Map<String, RuleBuildContext> ruleCxts = new ConcurrentHashMap<>(); ForkJoinPool pool = new ForkJoinPool(); try { pool.submit(() -> rules.stream().parallel() .filter(ruleDescr -> filterAccepts(ResourceChange.Type.RULE, ruleDescr.getNamespace(), ruleDescr.getName())) .forEach(ruleDescr -> { initRuleDescr(packageDescr, pkgRegistry, ruleDescr); RuleBuildContext context = buildRuleBuilderContext(pkgRegistry, ruleDescr); ruleCxts.put(ruleDescr.getName(), context); List<? extends KnowledgeBuilderResult> results = addRule(context); if (!results.isEmpty()) { synchronized (this.results) { this.results.addAll(results); } } }) ).get(); } catch (InterruptedException | ExecutionException e) { <START> logger.error("An error has occurred during rules compilation", e); <END> } for (RuleDescr ruleDescr : rules) { RuleBuildContext context = ruleCxts.get(ruleDescr.getName()); if (context != null) { pkgRegistry.getPackage().addRule(context.getRule()); } } } else { for (RuleDescr ruleDescr : rules) { if (filterAccepts(ResourceChange.Type.RULE, ruleDescr.getNamespace(), ruleDescr.getName())) { initRuleDescr(packageDescr, pkgRegistry, ruleDescr); RuleBuildContext context = buildRuleBuilderContext(pkgRegistry, ruleDescr); this.results.addAll(addRule(context)); pkgRegistry.getPackage().addRule(context.getRule()); } } } }</code><technical_language>sure, if want error logged. do @mariofusco</technical_language>

Target:
private void compileRulesLevel(PackageDescr packageDescr, PackageRegistry pkgRegistry, List<RuleDescr> rules) { boolean parallelRulesBuild = this.kBase == null && parallelRulesBuildThreshold != -1 && rules.size() > parallelRulesBuildThreshold; if (parallelRulesBuild) { Map<String, RuleBuildContext> ruleCxts = new ConcurrentHashMap<>(); ForkJoinPool pool = new ForkJoinPool(); try { pool.submit(() -> rules.stream().parallel() .filter(ruleDescr -> filterAccepts(ResourceChange.Type.RULE, ruleDescr.getNamespace(), ruleDescr.getName())) .forEach(ruleDescr -> { initRuleDescr(packageDescr, pkgRegistry, ruleDescr); RuleBuildContext context = buildRuleBuilderContext(pkgRegistry, ruleDescr); ruleCxts.put(ruleDescr.getName(), context); List<? extends KnowledgeBuilderResult> results = addRule(context); if (!results.isEmpty()) { synchronized (this.results) { this.results.addAll(results); } } }) ).get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException("Rules compilation failed or interrupted", e); } for (RuleDescr ruleDescr : rules) { RuleBuildContext context = ruleCxts.get(ruleDescr.getName()); if (context != null) { pkgRegistry.getPackage().addRule(context.getRule()); } } } else { for (RuleDescr ruleDescr : rules) { if (filterAccepts(ResourceChange.Type.RULE, ruleDescr.getNamespace(), ruleDescr.getName())) { initRuleDescr(packageDescr, pkgRegistry, ruleDescr); RuleBuildContext context = buildRuleBuilderContext(pkgRegistry, ruleDescr); this.results.addAll(addRule(context)); pkgRegistry.getPackage().addRule(context.getRule()); } } } }