Skip to content

Commit

Permalink
fix matching in non-hierarchy case
Browse files Browse the repository at this point in the history
  • Loading branch information
eschultink committed Dec 4, 2023
1 parent 6401709 commit 04cebad
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public Optional<BulkDataRules> getApplicableRules(RuleSet rules, String sourceOb
Optional<Match<BulkDataRules>> match =
pathTemplateUtils.matchVerbose(((MultiTypeBulkDataRules) rules).getFileRules(), sourceObjectPath);

if (match.isPresent())
if (match.isPresent()) {
if (match.get().getMatch() instanceof MultiTypeBulkDataRules) {
String subPath = match.get().getCapturedParams().get(match.get().getCapturedParams().size() - 1);
BulkDataRules nextMatch = pathTemplateUtils.match(((MultiTypeBulkDataRules) match.get().getMatch()).getFileRules(), subPath)
Expand All @@ -222,6 +222,9 @@ public Optional<BulkDataRules> getApplicableRules(RuleSet rules, String sourceOb
throw new RuntimeException("MultiTypeBulkDataRules cannot be nested more than 1 level");
}
applicableRules = nextMatch;
} else {
applicableRules = match.get().getMatch();
}
} else {
applicableRules = null;
}
Expand Down

0 comments on commit 04cebad

Please sign in to comment.