]> source.dussan.org Git - jgit.git/commitdiff
Fix string externalization warnings in BaseFormat 59/43759/2
authorMatthias Sohn <matthias.sohn@sap.com>
Thu, 12 Mar 2015 21:19:26 +0000 (14:19 -0700)
committerMatthias Sohn <matthias.sohn@sap.com>
Fri, 13 Mar 2015 01:35:47 +0000 (18:35 -0700)
Change-Id: Ie40aa1f889191e45e4d4a7a144c3176d521f6cfa
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.archive/resources/org/eclipse/jgit/archive/internal/ArchiveText.properties
org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/BaseFormat.java
org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/internal/ArchiveText.java

index fecf99e575c3491b93deb3035af2b9afbafa6210..3b50bb4fd5d222323771d00e9f100fc4a83a148b 100644 (file)
@@ -1,2 +1,3 @@
+cannotSetOption=Cannot set option: {0}
 pathDoesNotMatchMode=Path {0} does not match mode {1}
 unsupportedMode=Unsupported mode {0}
index f47fa12a44d9519a7bb974b53bba43e68047cf10..e80d42143eed4f6d2ef2b56081564f140c3a8b0e 100644 (file)
@@ -45,9 +45,11 @@ package org.eclipse.jgit.archive;
 
 import java.beans.Statement;
 import java.io.IOException;
+import java.text.MessageFormat;
 import java.util.Map;
 
 import org.apache.commons.compress.archivers.ArchiveOutputStream;
+import org.eclipse.jgit.archive.internal.ArchiveText;
 import org.eclipse.jgit.util.StringUtils;
 
 /**
@@ -71,11 +73,11 @@ public class BaseFormat {
                        Map<String, Object> o) throws IOException {
                for (Map.Entry<String, Object> p : o.entrySet()) {
                        try {
-                               new Statement(s,
-                                               "set" + StringUtils.capitalize(p.getKey()),
-                                               new Object[]{p.getValue()}).execute();
+                               new Statement(s, "set" + StringUtils.capitalize(p.getKey()), //$NON-NLS-1$
+                                               new Object[] { p.getValue() }).execute();
                        } catch (Exception e) {
-                               throw new IOException("cannot set option: " + p.getKey(), e);
+                               throw new IOException(MessageFormat.format(
+                                               ArchiveText.get().cannotSetOption, p.getKey()), e);
                        }
                }
                return s;
index edadf1c81d08653231f27662f4b23491fb00029e..f631cf8ecf2cd7fa5721bb113a5098868fe4fd2f 100644 (file)
@@ -58,6 +58,7 @@ public class ArchiveText extends TranslationBundle {
        }
 
        // @formatter:off
+       /***/ public String cannotSetOption;
        /***/ public String pathDoesNotMatchMode;
        /***/ public String unsupportedMode;
 }