Skip to content

Commit 7078f6d

Browse files
Fix sonar
1 parent ebf91e6 commit 7078f6d

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/main/java/io/github/computerdaddyguy/jfiletreeprettyprinter/PrettyPrintOptions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ public PrettyPrintOptions filter(@Nullable Predicate<Path> filter) {
325325
private Function<Path, String> lineExtension;
326326

327327
@Override
328+
@Nullable
328329
public Function<Path, String> getLineExtension() {
329330
return lineExtension;
330331
}

src/main/java/io/github/computerdaddyguy/jfiletreeprettyprinter/renderer/DefaultTreeEntryRenderer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,18 @@ private String renderDirectory(Depth depth, DirectoryEntry dirEntry, List<Path>
6262
line += "\n";
6363
}
6464

65-
var childLines = "";
65+
var childLines = new StringBuilder();
6666

6767
while (childIt.hasNext()) {
6868
var childEntry = childIt.next();
6969
var childDepth = depth.append(childIt.hasNext() ? DepthSymbol.NON_LAST_FILE : DepthSymbol.LAST_FILE);
70-
childLines += renderTree(childEntry, childDepth);
70+
childLines.append(renderTree(childEntry, childDepth));
7171
if (childIt.hasNext()) {
72-
childLines += "\n";
72+
childLines.append('\n');
7373
}
7474
}
7575

76-
return line + childLines;
76+
return line + childLines.toString();
7777
}
7878

7979
private String computeLineExtension(Path path) {

src/main/java/io/github/computerdaddyguy/jfiletreeprettyprinter/renderer/LineRenderer.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,16 @@
1010
import java.nio.file.Path;
1111
import java.util.List;
1212
import org.jspecify.annotations.NullMarked;
13-
import org.jspecify.annotations.Nullable;
1413

1514
@NullMarked
1615
interface LineRenderer {
1716

18-
@Nullable
1917
String renderDirectoryBegin(Depth depth, DirectoryEntry dirEntry, List<Path> dirs);
2018

21-
@Nullable
2219
String renderFile(Depth depth, FileEntry fileEntry);
2320

24-
@Nullable
2521
String renderChildLimitReached(Depth depth, SkippedChildrenEntry skippedChildrenEntry);
2622

27-
@Nullable
2823
String renderMaxDepthReached(Depth depth, MaxDepthReachEntry maxDepthReachEntry);
2924

3025
/**

0 commit comments

Comments
 (0)