Skip to content

Commit 6e59e9f

Browse files
committed
Sort rules directories and files
By using the natural order of their type, so that we can benefit from a determisnic order when processing the rules.
1 parent 697b07d commit 6e59e9f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

lkql_jit/language/src/main/java/com/adacore/lkql_jit/LKQLContext.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ public String[] getRuleDirectories() {
366366
if (additionalRulesDirs != null) {
367367
rulesDirsList.addAll(Arrays.asList(StringUtils.splitPaths(additionalRulesDirs)));
368368
}
369+
rulesDirsList.sort(null);
369370
this.ruleDirectories = rulesDirsList.toArray(new String[0]);
370371
}
371372
return this.ruleDirectories;

lkql_jit/language/src/main/java/com/adacore/lkql_jit/nodes/TopLevelList.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ public void addRuleImports() {
141141
if (ruleDirectoryFiles != null) {
142142
ruleImports.addAll(
143143
Arrays.stream(ruleDirectoryFiles)
144+
.sorted()
144145
.filter(File::canRead)
145146
.map(f ->
146147
new Import(

0 commit comments

Comments
 (0)