summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2023-02-20 21:40:40 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2023-02-20 21:40:40 +0100
commit5d5a0d537697480ae5a7d530bad283a972aadf52 (patch)
treeb31972f06c1696f4e2fbdbd2b2c817287878fbfa
parent37dd45e8a963d7ac8ac7c23ab1572af5d8f9deb1 (diff)
downloadjgit-5d5a0d537697480ae5a7d530bad283a972aadf52.tar.gz
jgit-5d5a0d537697480ae5a7d530bad283a972aadf52.zip
Externalize strings introduced in c9552aba
Change-Id: I81bb78344df61e6eb42622fcef6235d4da0ae052
-rw-r--r--org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackObjectSizeIndexV1.java13
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackObjectSizeIndexWriter.java9
4 files changed, 21 insertions, 11 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 bdf35d8d73..72a3d1cdea 100644
--- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
+++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
@@ -111,6 +111,7 @@ cannotPullOnARepoWithState=Cannot pull into a repository with state: {0}
cannotRead=Cannot read {0}
cannotReadBackDelta=Cannot read delta type {0}
cannotReadBlob=Cannot read blob {0}
+cannotReadByte=Cannot read byte from stream
cannotReadCommit=Cannot read commit {0}
cannotReadFile=Cannot read file {0}
cannotReadHEAD=cannot read HEAD: {0} {1}
@@ -538,6 +539,7 @@ nothingToPush=Nothing to push.
notMergedExceptionMessage=Branch was not deleted as it has not been merged yet; use the force option to delete it anyway
notShallowedUnshallow=The server sent a unshallow for a commit that wasn''t marked as shallow: {0}
noXMLParserAvailable=No XML parser available.
+numberDoesntFit=Number doesn't fit in a single byte
objectAtHasBadZlibStream=Object at {0} in {1} has bad zlib stream
objectIsCorrupt=Object {0} is corrupt: {1}
objectIsCorrupt3={0}: object {1}: {2}
@@ -773,6 +775,7 @@ truncatedHunkOldLinesMissing=Truncated hunk, at least {0} old lines is missing
tSizeMustBeGreaterOrEqual1=tSize must be >= 1
unableToCheckConnectivity=Unable to check connectivity.
unableToCreateNewObject=Unable to create new object: {0}
+unableToReadFullInt=Unable to read a full int from the stream
unableToReadPackfile=Unable to read packfile {0}
unableToRemovePath=Unable to remove path ''{0}''
unableToWrite=Unable to write {0}
@@ -798,6 +801,7 @@ unknownObject=unknown object
unknownObjectInIndex=unknown object {0} found in index but not in pack file
unknownObjectType=Unknown object type {0}.
unknownObjectType2=unknown
+unknownPositionEncoding=Unknown position encoding %s
unknownRefStorageFormat=Unknown ref storage format "{0}"
unknownRepositoryFormat=Unknown repository format
unknownRepositoryFormat2=Unknown repository format "{0}"; expected "0".
@@ -825,6 +829,7 @@ unsupportedPackIndexVersion=Unsupported pack index version {0}
unsupportedPackVersion=Unsupported pack version {0}.
unsupportedReftableVersion=Unsupported reftable version {0}.
unsupportedRepositoryDescription=Repository description not supported
+unsupportedSizesObjSizeIndex=Unsupported sizes in object-size-index
updateRequiresOldIdAndNewId=Update requires both old ID and new ID to be nonzero
updatingHeadFailed=Updating HEAD failed
updatingReferences=Updating references
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 b502a1a98b..d8720be56f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
@@ -139,6 +139,7 @@ public class JGitText extends TranslationBundle {
/***/ public String cannotRead;
/***/ public String cannotReadBackDelta;
/***/ public String cannotReadBlob;
+ /***/ public String cannotReadByte;
/***/ public String cannotReadCommit;
/***/ public String cannotReadFile;
/***/ public String cannotReadHEAD;
@@ -566,6 +567,7 @@ public class JGitText extends TranslationBundle {
/***/ public String notMergedExceptionMessage;
/***/ public String notShallowedUnshallow;
/***/ public String noXMLParserAvailable;
+ /***/ public String numberDoesntFit;
/***/ public String objectAtHasBadZlibStream;
/***/ public String objectIsCorrupt;
/***/ public String objectIsCorrupt3;
@@ -801,6 +803,7 @@ public class JGitText extends TranslationBundle {
/***/ public String tSizeMustBeGreaterOrEqual1;
/***/ public String unableToCheckConnectivity;
/***/ public String unableToCreateNewObject;
+ /***/ public String unableToReadFullInt;
/***/ public String unableToReadPackfile;
/***/ public String unableToRemovePath;
/***/ public String unableToWrite;
@@ -826,6 +829,7 @@ public class JGitText extends TranslationBundle {
/***/ public String unknownObjectInIndex;
/***/ public String unknownObjectType;
/***/ public String unknownObjectType2;
+ /***/ public String unknownPositionEncoding;
/***/ public String unknownRefStorageFormat;
/***/ public String unknownRepositoryFormat;
/***/ public String unknownRepositoryFormat2;
@@ -853,6 +857,7 @@ public class JGitText extends TranslationBundle {
/***/ public String unsupportedPackVersion;
/***/ public String unsupportedReftableVersion;
/***/ public String unsupportedRepositoryDescription;
+ /***/ public String unsupportedSizesObjSizeIndex;
/***/ public String updateRequiresOldIdAndNewId;
/***/ public String updatingHeadFailed;
/***/ public String updatingReferences;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackObjectSizeIndexV1.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackObjectSizeIndexV1.java
index 68befc6ca5..be2ff67e4f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackObjectSizeIndexV1.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackObjectSizeIndexV1.java
@@ -14,6 +14,7 @@ import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.Arrays;
+import org.eclipse.jgit.internal.JGitText;
import org.eclipse.jgit.util.NB;
/**
@@ -75,7 +76,7 @@ class PackObjectSizeIndexV1 implements PackObjectSizeIndex {
pos32 = stream.readIntArray(sz);
} else {
throw new UnsupportedEncodingException(
- String.format("Unknown position encoding %s",
+ String.format(JGitText.get().unknownPositionEncoding,
Integer.toHexString(positionEncoding)));
}
}
@@ -92,7 +93,7 @@ class PackObjectSizeIndexV1 implements PackObjectSizeIndex {
int c128sizes = stream.readInt();
if (c128sizes != 0) {
// this MUST be 0 (we don't support 128 bits sizes yet)
- throw new IOException("Unsupported sizes in object-size-index");
+ throw new IOException(JGitText.get().unsupportedSizesObjSizeIndex);
}
}
@@ -145,8 +146,7 @@ class PackObjectSizeIndexV1 implements PackObjectSizeIndex {
int readInt() throws IOException {
int n = in.readNBytes(buffer, 0, 4);
if (n < 4) {
- throw new IOException(
- "Unable to read a full int from the stream");
+ throw new IOException(JGitText.get().unableToReadFullInt);
}
return NB.decodeInt32(buffer, 0);
}
@@ -166,8 +166,7 @@ class PackObjectSizeIndexV1 implements PackObjectSizeIndex {
long readLong() throws IOException {
int n = in.readNBytes(buffer, 0, 8);
if (n < 8) {
- throw new IOException(
- "Unable to read a full int from the stream");
+ throw new IOException(JGitText.get().unableToReadFullInt);
}
return NB.decodeInt64(buffer, 0);
}
@@ -187,7 +186,7 @@ class PackObjectSizeIndexV1 implements PackObjectSizeIndex {
byte readByte() throws IOException {
int n = in.readNBytes(buffer, 0, 1);
if (n != 1) {
- throw new IOException("Cannot read byte from stream");
+ throw new IOException(JGitText.get().cannotReadByte);
}
return buffer[0];
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackObjectSizeIndexWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackObjectSizeIndexWriter.java
index ae03797cad..65a065dd55 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackObjectSizeIndexWriter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackObjectSizeIndexWriter.java
@@ -14,6 +14,7 @@ import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
+import org.eclipse.jgit.internal.JGitText;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.transport.PackedObjectInfo;
import org.eclipse.jgit.util.NB;
@@ -70,11 +71,11 @@ public abstract class PackObjectSizeIndexWriter {
* Object size index v1.
*
* Store position (in the main index) to size as parallel arrays.
- *
+ *
* <p>Positions in the main index fit well in unsigned 24 bits (16M) for most
* repositories, but some outliers have even more objects, so we need to
* store also 32 bits positions.
- *
+ *
* <p>Sizes are stored as a first array parallel to positions. If a size
* doesn't fit in an element of that array, then we encode there a position
* on the next-size array. This "overflow" array doesn't have entries for
@@ -88,7 +89,7 @@ public abstract class PackObjectSizeIndexWriter {
* / /
* sizes (64 bits) [3GB, 6GB]
* </pre>
- *
+ *
* <p>For sizes we use 32 bits as the first level and 64 for the rare objects
* over 2GB.
*
@@ -173,7 +174,7 @@ public abstract class PackObjectSizeIndexWriter {
private void writeUInt8(int i) throws IOException {
if (i > 255) {
throw new IllegalStateException(
- "Number doesn't fit in a single byte");
+ JGitText.get().numberDoesntFit);
}
NB.encodeInt32(intBuffer, 0, i);
os.write(intBuffer, 3, 1);