Skip to content

Commit

Permalink
fix: assumption that the first deepListHelper result is always self
Browse files Browse the repository at this point in the history
It seems that on some systems (e.g. github actions) the order of the deepListHelper results
is not gauranteed such that the first entry is always self.

When it is not, we throw away a needed result, and later get an error as we try to
process a result which *is* self, and is an empty string. This causes the
substring method to throw an error, though generally it is swallowed later,
and rarely seen (another problem)
  • Loading branch information
cmhulbert committed Dec 17, 2024
1 parent afd3a95 commit df47b3f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/org/janelia/saalfeldlab/n5/N5Reader.java
Original file line number Diff line number Diff line change
Expand Up @@ -565,10 +565,9 @@ default String[] deepList(
final LinkedBlockingQueue<Future<String>> datasetFutures = new LinkedBlockingQueue<>();
deepListHelper(this, normalPathName, false, filter, executor, datasetFutures);

datasetFutures.poll().get(); // skip self
while (!datasetFutures.isEmpty()) {
final String result = datasetFutures.poll().get();
if (result != null)
if (result != null && !result.isEmpty())
results.add(result.substring(normalPathName.length() + groupSeparator.length()));
}

Expand Down

0 comments on commit df47b3f

Please sign in to comment.