aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.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/transport/WalkRemoteObjectDatabase.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/transport/WalkRemoteObjectDatabase.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java
index 2aa644ce8b..f1743b378d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkRemoteObjectDatabase.java
@@ -50,10 +50,12 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
+import org.eclipse.jgit.JGitText;
import org.eclipse.jgit.errors.TransportException;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
@@ -198,7 +200,7 @@ abstract class WalkRemoteObjectDatabase {
* deletion is not supported, or deletion failed.
*/
void deleteFile(final String path) throws IOException {
- throw new IOException("Deleting '" + path + "' not supported.");
+ throw new IOException(MessageFormat.format(JGitText.get().deletingNotSupported, path));
}
/**
@@ -230,7 +232,7 @@ abstract class WalkRemoteObjectDatabase {
*/
OutputStream writeFile(final String path, final ProgressMonitor monitor,
final String monitorTask) throws IOException {
- throw new IOException("Writing of '" + path + "' not supported.");
+ throw new IOException(MessageFormat.format(JGitText.get().writingNotSupported, path));
}
/**
@@ -428,7 +430,7 @@ abstract class WalkRemoteObjectDatabase {
} catch (FileNotFoundException notPacked) {
// Perhaps it wasn't worthwhile, or is just an older repository.
} catch (IOException e) {
- throw new TransportException(getURI(), "error in packed-refs", e);
+ throw new TransportException(getURI(), JGitText.get().errorInPackedRefs, e);
}
}
@@ -449,7 +451,7 @@ abstract class WalkRemoteObjectDatabase {
}
if (line.charAt(0) == '^') {
if (last == null)
- throw new TransportException("Peeled line before ref.");
+ throw new TransportException(JGitText.get().peeledLineBeforeRef);
final ObjectId id = ObjectId.fromString(line.substring(1));
last = new ObjectIdRef.PeeledTag(Ref.Storage.PACKED, last
.getName(), last.getObjectId(), id);
@@ -459,7 +461,7 @@ abstract class WalkRemoteObjectDatabase {
final int sp = line.indexOf(' ');
if (sp < 0)
- throw new TransportException("Unrecognized ref: " + line);
+ throw new TransportException(MessageFormat.format(JGitText.get().unrecognizedRef, line));
final ObjectId id = ObjectId.fromString(line.substring(0, sp));
final String name = line.substring(sp + 1);
if (peeled)