瀏覽代碼

Externalize error messages used in ObjectDirectoryInserter

Change-Id: I3bc26847071fbc31267a4a4cf5a10b428bcf229d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
tags/v4.0.0.201505050340-m2
Matthias Sohn 9 年之前
父節點
當前提交
fc2d723dd9

+ 2
- 0
org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties 查看文件

initFailedBareRepoDifferentDirs=When initializing a bare repo with directory {0} and separate git-dir {1} specified both folders must point to the same location initFailedBareRepoDifferentDirs=When initializing a bare repo with directory {0} and separate git-dir {1} specified both folders must point to the same location
initFailedNonBareRepoSameDirs=When initializing a non-bare repo with directory {0} and separate git-dir {1} specified both folders should not point to the same location initFailedNonBareRepoSameDirs=When initializing a non-bare repo with directory {0} and separate git-dir {1} specified both folders should not point to the same location
inMemoryBufferLimitExceeded=In-memory buffer limit exceeded inMemoryBufferLimitExceeded=In-memory buffer limit exceeded
inputDidntMatchLength=Input did not match supplied length. {0} bytes are missing.
inputStreamMustSupportMark=InputStream must support mark() inputStreamMustSupportMark=InputStream must support mark()
integerValueOutOfRange=Integer value {0}.{1} out of range integerValueOutOfRange=Integer value {0}.{1} out of range
internalRevisionError=internal revision error internalRevisionError=internal revision error
truncatedHunkOldLinesMissing=Truncated hunk, at least {0} old lines is missing truncatedHunkOldLinesMissing=Truncated hunk, at least {0} old lines is missing
tSizeMustBeGreaterOrEqual1=tSize must be >= 1 tSizeMustBeGreaterOrEqual1=tSize must be >= 1
unableToCheckConnectivity=Unable to check connectivity. unableToCheckConnectivity=Unable to check connectivity.
unableToCreateNewObject=Unable to create new object: {0}
unableToStore=Unable to store {0}. unableToStore=Unable to store {0}.
unableToWrite=Unable to write {0} unableToWrite=Unable to write {0}
unencodeableFile=Unencodable file: {0} unencodeableFile=Unencodable file: {0}

+ 2
- 0
org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java 查看文件

/***/ public String initFailedBareRepoDifferentDirs; /***/ public String initFailedBareRepoDifferentDirs;
/***/ public String initFailedNonBareRepoSameDirs; /***/ public String initFailedNonBareRepoSameDirs;
/***/ public String inMemoryBufferLimitExceeded; /***/ public String inMemoryBufferLimitExceeded;
/***/ public String inputDidntMatchLength;
/***/ public String inputStreamMustSupportMark; /***/ public String inputStreamMustSupportMark;
/***/ public String integerValueOutOfRange; /***/ public String integerValueOutOfRange;
/***/ public String internalRevisionError; /***/ public String internalRevisionError;
/***/ public String truncatedHunkOldLinesMissing; /***/ public String truncatedHunkOldLinesMissing;
/***/ public String tSizeMustBeGreaterOrEqual1; /***/ public String tSizeMustBeGreaterOrEqual1;
/***/ public String unableToCheckConnectivity; /***/ public String unableToCheckConnectivity;
/***/ public String unableToCreateNewObject;
/***/ public String unableToStore; /***/ public String unableToStore;
/***/ public String unableToWrite; /***/ public String unableToWrite;
/***/ public String unencodeableFile; /***/ public String unencodeableFile;

+ 6
- 3
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryInserter.java 查看文件

import java.nio.channels.Channels; import java.nio.channels.Channels;
import java.security.DigestOutputStream; import java.security.DigestOutputStream;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.text.MessageFormat;
import java.util.zip.Deflater; import java.util.zip.Deflater;
import java.util.zip.DeflaterOutputStream; import java.util.zip.DeflaterOutputStream;


import org.eclipse.jgit.errors.ObjectWritingException; import org.eclipse.jgit.errors.ObjectWritingException;
import org.eclipse.jgit.internal.JGitText;
import org.eclipse.jgit.lib.Config; import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectId;
} }


final File dst = db.fileFor(id); final File dst = db.fileFor(id);
throw new ObjectWritingException("Unable to create new object: " + dst);
throw new ObjectWritingException(MessageFormat
.format(JGitText.get().unableToCreateNewObject, dst));
} }


@Override @Override
} }


private static EOFException shortInput(long missing) { private static EOFException shortInput(long missing) {
return new EOFException("Input did not match supplied length. "
+ missing + " bytes are missing.");
return new EOFException(MessageFormat.format(
JGitText.get().inputDidntMatchLength, Long.valueOf(missing)));
} }
} }

Loading…
取消
儲存