From 4262150f740345b695d8150fa1b017c2ca352b85 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Fri, 22 Sep 2023 16:50:24 +0200 Subject: [PATCH] CommitGraphWriter: fix boxing warnings Change-Id: I35c3a3baadb8d7d73c01252fe4333fa2159722ee --- .../resources/org/eclipse/jgit/internal/JGitText.properties | 1 + org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java | 1 + .../jgit/internal/storage/commitgraph/CommitGraphWriter.java | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties index 141ea8e201..a7a7f18804 100644 --- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties +++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties @@ -158,6 +158,7 @@ commitGraphChunkNeeded=commit-graph 0x{0} chunk has not been loaded commitGraphChunkRepeated=commit-graph chunk id 0x{0} appears multiple times commitGraphChunkUnknown=unknown commit-graph chunk: 0x{0} commitGraphFileIsTooLargeForJgit=commit-graph file is too large for jgit +commitGraphUnexpectedSize=Commit-graph: expected %d bytes but out has %d bytes commitGraphWritingCancelled=commit-graph writing was canceled commitMessageNotSpecified=commit message not specified commitOnRepoWithoutHEADCurrentlyNotSupported=Commit on repo without HEAD currently not supported diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java index f0d6657336..f42e334049 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java @@ -187,6 +187,7 @@ public class JGitText extends TranslationBundle { /***/ public String commitGraphChunkRepeated; /***/ public String commitGraphChunkUnknown; /***/ public String commitGraphFileIsTooLargeForJgit; + /***/ public String commitGraphUnexpectedSize; /***/ public String commitGraphWritingCancelled; /***/ public String commitMessageNotSpecified; /***/ public String commitOnRepoWithoutHEADCurrentlyNotSupported; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphWriter.java index 38ae02957d..ae7b379c1c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphWriter.java @@ -146,8 +146,9 @@ public class CommitGraphWriter { writeCheckSum(out); if (expectedSize != out.length()) { throw new IllegalStateException(String.format( - "Commit-graph: expected %d bytes but out has %d bytes", //$NON-NLS-1$ - expectedSize, out.length())); + JGitText.get().commitGraphUnexpectedSize, + Long.valueOf(expectedSize), + Long.valueOf(out.length()))); } } catch (InterruptedIOException e) { throw new IOException(JGitText.get().commitGraphWritingCancelled, -- 2.39.5