aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/lib/Tree.java
diff options
context:
space:
mode:
authorSasa Zivkov <sasa.zivkov@sap.com>2010-05-19 16:59:28 +0200
committerShawn O. Pearce <spearce@spearce.org>2010-05-19 14:37:16 -0700
commitf3d8a8ecad614906a2c4ec0077cdb24129da6c6d (patch)
tree34d041692beff0f392c27869f49b76c0fc2053e6 /org.eclipse.jgit/src/org/eclipse/jgit/lib/Tree.java
parent2e961989e42b1fe7e8bd9eaa7a3d2e88a0d1d001 (diff)
downloadjgit-f3d8a8ecad614906a2c4ec0077cdb24129da6c6d.tar.gz
jgit-f3d8a8ecad614906a2c4ec0077cdb24129da6c6d.zip
Externalize strings from JGit
The strings are externalized into the root resource bundles. The resource bundles are stored under the new "resources" source folder to get proper maven build. Strings from tests are, in general, not externalized. Only in cases where it was necessary to make the test pass the strings were externalized. This was typically necessary in cases where e.getMessage() was used in assert and the exception message was slightly changed due to reuse of the externalized strings. Change-Id: Ic0f29c80b9a54fcec8320d8539a3e112852a1f7b Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/lib/Tree.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/Tree.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Tree.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Tree.java
index 61607cba95..2aa3098f17 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Tree.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Tree.java
@@ -46,7 +46,9 @@
package org.eclipse.jgit.lib;
import java.io.IOException;
+import java.text.MessageFormat;
+import org.eclipse.jgit.JGitText;
import org.eclipse.jgit.errors.CorruptObjectException;
import org.eclipse.jgit.errors.EntryExistsException;
import org.eclipse.jgit.errors.MissingObjectException;
@@ -245,7 +247,7 @@ public class Tree extends TreeEntry implements Treeish {
*/
public void unload() {
if (isModified())
- throw new IllegalStateException("Cannot unload a modified tree.");
+ throw new IllegalStateException(JGitText.get().cannotUnloadAModifiedTree);
contents = null;
}
@@ -555,14 +557,14 @@ public class Tree extends TreeEntry implements Treeish {
while (rawPtr < rawSize) {
int c = raw[rawPtr++];
if (c < '0' || c > '7')
- throw new CorruptObjectException(getId(), "invalid entry mode");
+ throw new CorruptObjectException(getId(), JGitText.get().corruptObjectInvalidEntryMode);
int mode = c - '0';
for (;;) {
c = raw[rawPtr++];
if (' ' == c)
break;
else if (c < '0' || c > '7')
- throw new CorruptObjectException(getId(), "invalid mode");
+ throw new CorruptObjectException(getId(), JGitText.get().corruptObjectInvalidMode);
mode <<= 3;
mode += c - '0';
}
@@ -589,8 +591,8 @@ public class Tree extends TreeEntry implements Treeish {
else if (FileMode.GITLINK.equals(mode))
ent = new GitlinkTreeEntry(this, id, name);
else
- throw new CorruptObjectException(getId(), "Invalid mode: "
- + Integer.toOctalString(mode));
+ throw new CorruptObjectException(getId(), MessageFormat.format(
+ JGitText.get().corruptObjectInvalidMode2, Integer.toOctalString(mode)));
temp[nextIndex++] = ent;
}