Skip to content

Commit 03eca64

Browse files
fix(intelligence): explicit UTF-8 in RepositoryIdentity.runGit() — DM_DEFAULT_ENCODING (RAN-160)
Replace new String(is.readAllBytes()) with new String(is.readAllBytes(), StandardCharsets.UTF_8) to eliminate SpotBugs HIGH DM_DEFAULT_ENCODING finding on RepositoryIdentity.java:44. This was the sole blocker gating all Phase 1-3 PRs from merge. Co-Authored-By: Paperclip <noreply@paperclip.ing>
1 parent c855019 commit 03eca64

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/java/io/github/randomcodespace/iq/intelligence/RepositoryIdentity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.github.randomcodespace.iq.intelligence;
22

3+
import java.nio.charset.StandardCharsets;
34
import java.time.Instant;
45

56
/**
@@ -41,7 +42,7 @@ private static String runGit(java.nio.file.Path repoPath, String... args) {
4142
.redirectErrorStream(true);
4243
var proc = pb.start();
4344
try (var is = proc.getInputStream()) {
44-
String out = new String(is.readAllBytes()).trim();
45+
String out = new String(is.readAllBytes(), StandardCharsets.UTF_8).trim();
4546
int exit = proc.waitFor();
4647
return (exit == 0 && !out.isBlank()) ? out : null;
4748
} finally {

0 commit comments

Comments
 (0)