diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2025-03-04 09:05:34 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2025-03-04 09:05:34 +0100 |
commit | 28136bc499832d6031e1b99d98d0328c17d469d3 (patch) | |
tree | 15eabdf679fff2b1a451c8eac247137a7fbbd5a2 | |
parent | 1468a80ff7859995c3a2e2018bbfea81312c76e9 (diff) | |
download | jgit-28136bc499832d6031e1b99d98d0328c17d469d3.tar.gz jgit-28136bc499832d6031e1b99d98d0328c17d469d3.zip |
CacheRegion: fix non translatable text warnings
Change-Id: I163957653b075f1f05a6219f4d23b340588ffcbd
3 files changed, 8 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 f8c8ecaeab..27270a1f25 100644 --- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties +++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties @@ -76,6 +76,7 @@ branchNameInvalid=Branch name {0} is not allowed buildingBitmaps=Building bitmaps cachedPacksPreventsIndexCreation=Using cached packs prevents index creation cachedPacksPreventsListingObjects=Using cached packs prevents listing objects +cacheRegionAllOrNoneNull=expected all null or none: {0}, {1} cannotAccessLastModifiedForSafeDeletion=Unable to access lastModifiedTime of file {0}, skip deletion since we cannot safely avoid race condition cannotBeCombined=Cannot be combined. cannotBeRecursiveWhenTreesAreIncluded=TreeWalk shouldn't be recursive when tree objects are included. diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/blame/cache/CacheRegion.java b/org.eclipse.jgit/src/org/eclipse/jgit/blame/cache/CacheRegion.java index 6aa4eef2ca..cf3f978044 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/blame/cache/CacheRegion.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/blame/cache/CacheRegion.java @@ -9,6 +9,9 @@ */ package org.eclipse.jgit.blame.cache; +import java.text.MessageFormat; + +import org.eclipse.jgit.internal.JGitText; import org.eclipse.jgit.lib.ObjectId; /** @@ -92,6 +95,7 @@ public class CacheRegion implements Comparable<CacheRegion> { return start - o.start; } + @SuppressWarnings("nls") @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -115,7 +119,7 @@ public class CacheRegion implements Comparable<CacheRegion> { if (path == null && commit == null) { return; } - throw new IllegalArgumentException(String.format( - "expected all null or none: %s, %s", path, commit)); + throw new IllegalArgumentException(MessageFormat + .format(JGitText.get().cacheRegionAllOrNoneNull, path, commit)); } } 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 91ce3479e2..bf252f9968 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java @@ -106,6 +106,7 @@ public class JGitText extends TranslationBundle { /***/ public String buildingBitmaps; /***/ public String cachedPacksPreventsIndexCreation; /***/ public String cachedPacksPreventsListingObjects; + /***/ public String cacheRegionAllOrNoneNull; /***/ public String cannotAccessLastModifiedForSafeDeletion; /***/ public String cannotBeCombined; /***/ public String cannotBeRecursiveWhenTreesAreIncluded; |