Skip to content

Commit

Permalink
Remove a hack introduced for Liquibase that is no longer needed.
Browse files Browse the repository at this point in the history
With the new index, we don't need that anymore. I tested that the test
introduced in this commit is still working fine
(LiquibaseExtensionMigrateAtStartDirectoryChangeLogTest).

Note that I fixed it as I forgot to consider the less priority elements
there and I went for fixing it and then was wondering why this would be
even useful.

I also introduced a shortcut for empty resource.
  • Loading branch information
gsmet committed Aug 27, 2024
1 parent 94a2d7d commit 97879a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ public static Builder builder() {
* Probably something we will have to tweak for corner cases but let's try to keep it fast.
*/
static String getResourceKey(String resource) {
if (resource.isEmpty()) {
return resource;
}

// we don't really care about this part, it can be slower
if (resource.startsWith(META_INF_MAVEN)) {
return META_INF_MAVEN;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,6 @@ public Enumeration<URL> getResources(String unsanitisedName, boolean parentAlrea
}
}
}
} else if (name.isEmpty()) {
for (int i = 0; i < normalPriorityElements.size(); i++) {
List<ClassPathResource> resList = normalPriorityElements.get(i).getResources("");
for (var res : resList) {
if (res != null) {
resources.add(res.getUrl());
}
}
}
}
if (!banned) {
if ((resources.isEmpty() && !parentAlreadyFoundResources) || aggregateParentResources) {
Expand Down

0 comments on commit 97879a3

Please sign in to comment.