Skip to content

Commit d63bf86

Browse files
Fix Sonar
1 parent 1323644 commit d63bf86

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/main/java/io/github/computerdaddyguy/jfiletreeprettyprinter/scanner/DefaultPathToTreeScanner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private List<TreeEntry> handleDirectoryChildren(Path root, int depth, Path dir,
8585

8686
// Loop has early exit?
8787
if (pathIterator.hasNext()) {
88-
childEntries.add(new SkippedChildrenEntry());
88+
childEntries.add(new SkippedChildrenEntry(dir));
8989
}
9090

9191
return childEntries;

src/main/java/io/github/computerdaddyguy/jfiletreeprettyprinter/scanner/TreeEntry.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,15 @@ public BasicFileAttributes getAttrs() {
6161

6262
final class SkippedChildrenEntry implements TreeEntry {
6363

64-
public SkippedChildrenEntry() {
64+
final Path dir;
65+
66+
public SkippedChildrenEntry(Path dir) {
67+
this.dir = Objects.requireNonNull(dir, "dir is null");
6568
}
6669

6770
@Override
6871
public String toString() {
69-
return "SkippedChildrenEntry[]";
72+
return "SkippedChildrenEntry[dir: " + dir.getFileName() + "]";
7073
}
7174

7275
}

0 commit comments

Comments
 (0)