diff --git a/CHANGELOG.md b/CHANGELOG.md index b927d53..da22201 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and from version 3.2 this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +* [Issue 54](https://github.com/adoble/adr-j/issues/54) corrected. Many thanks to [Wesley Viana](https://github.com/wviana) for first identifying this and to [Sebastian Davids](https://github.com/sdavids) for providing the solution. + + ## [3.3.0] ### Added diff --git a/src/main/java/org/doble/commands/CommandList.java b/src/main/java/org/doble/commands/CommandList.java index 376d0fd..3175133 100644 --- a/src/main/java/org/doble/commands/CommandList.java +++ b/src/main/java/org/doble/commands/CommandList.java @@ -63,7 +63,10 @@ public Integer call() { Path docsPath = rootPath.resolve(properties.getProperty("docPath")); try (Stream<Path> stream = Files.list(docsPath)) { - stream.map(Path::getFileName).filter(ADRFilter.filter()).forEachOrdered(env.out::println); + // stream.map(Path::getFileName).filter(ADRFilter.filter()).forEachOrdered(env.out::println); + // Using sorted() here as oppsowd to forEachOrdered() to correct issue 54 + // (https://github.com/adoble/adr-j/issues/54) + stream.map(Path::getFileName).filter(ADRFilter.filter()).sorted().forEach(env.out::println); } catch (IOException e) { env.out.println("FATAL: Cannot access directory. Exception message ->" + e.getMessage()); return ADR.ERRORGENERAL;