]> source.dussan.org Git - jgit.git/commitdiff
Add $NON-NLS to suppress "Non-externalized string literal" warnings 19/64319/2
authorDavid Pursehouse <david.pursehouse@sonymobile.com>
Thu, 14 Jan 2016 07:37:39 +0000 (16:37 +0900)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 19 Jan 2016 16:27:45 +0000 (17:27 +0100)
Change-Id: I3e6f83ad2bc7d493e2c1ab5a8c60affa2b49c386
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Config.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Reset.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowPackDelta.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java

index fde0a78bf6ca9ab2fa7bfd9454c34dc723533b64..2cee2cb0071764d62a42c13475000d9b648eec40 100644 (file)
@@ -129,20 +129,20 @@ abstract class AbstractFetchCommand extends TextBuiltin {
                        final TrackingRefUpdate u) {
                final RefUpdate.Result r = u.getResult();
                if (r == RefUpdate.Result.LOCK_FAILURE)
-                       return "[lock fail]";
+                       return "[lock fail]"; //$NON-NLS-1$
                if (r == RefUpdate.Result.IO_FAILURE)
-                       return "[i/o error]";
+                       return "[i/o error]"; //$NON-NLS-1$
                if (r == RefUpdate.Result.REJECTED)
-                       return "[rejected]";
+                       return "[rejected]"; //$NON-NLS-1$
                if (ObjectId.zeroId().equals(u.getNewObjectId()))
-                       return "[deleted]";
+                       return "[deleted]"; //$NON-NLS-1$
 
                if (r == RefUpdate.Result.NEW) {
                        if (u.getRemoteName().startsWith(Constants.R_HEADS))
-                               return "[new branch]";
+                               return "[new branch]"; //$NON-NLS-1$
                        else if (u.getLocalName().startsWith(Constants.R_TAGS))
-                               return "[new tag]";
-                       return "[new]";
+                               return "[new tag]"; //$NON-NLS-1$
+                       return "[new]"; //$NON-NLS-1$
                }
 
                if (r == RefUpdate.Result.FORCED) {
@@ -158,7 +158,7 @@ abstract class AbstractFetchCommand extends TextBuiltin {
                }
 
                if (r == RefUpdate.Result.NO_CHANGE)
-                       return "[up to date]";
+                       return "[up to date]"; //$NON-NLS-1$
                return "[" + r.name() + "]"; //$NON-NLS-1$//$NON-NLS-2$
        }
 
index 8569e9278ecf0d61cd730101cdf3e9376509a59b..faae13a4d72381263bf8a0a0139b52da0d112764 100644 (file)
@@ -74,7 +74,7 @@ class Config extends TextBuiltin {
                        list();
                else
                        throw new NotSupportedException(
-                                       "only --list option is currently supported");
+                                       "only --list option is currently supported"); //$NON-NLS-1$
        }
 
        private void list() throws IOException, ConfigInvalidException {
index d43424c7ce2a050a10e9c4de13b42f739cb7da34..6947cdd100fbfe37a11a7a161c6374509eb67db6 100644 (file)
@@ -324,7 +324,7 @@ class Log extends RevWalkTextBuiltin {
                        return false;
                if (emptyLine)
                        outw.println();
-               outw.print("Notes");
+               outw.print("Notes"); //$NON-NLS-1$
                if (label != null) {
                        outw.print(" ("); //$NON-NLS-1$
                        outw.print(label);
index 9098c1263d6322773d5b148e956a372c5f3d4309..33ea1deb8ebb7e6728d7105bda5d873587afa86f 100644 (file)
@@ -182,15 +182,15 @@ class Push extends TextBuiltin {
                switch (rru.getStatus()) {
                case OK:
                        if (rru.isDelete())
-                               printUpdateLine('-', "[deleted]", null, remoteName, null);
+                               printUpdateLine('-', "[deleted]", null, remoteName, null); //$NON-NLS-1$
                        else {
                                final Ref oldRef = result.getAdvertisedRef(remoteName);
                                if (oldRef == null) {
                                        final String summary;
                                        if (remoteName.startsWith(Constants.R_TAGS))
-                                               summary = "[new tag]";
+                                               summary = "[new tag]"; //$NON-NLS-1$
                                        else
-                                               summary = "[new branch]";
+                                               summary = "[new branch]"; //$NON-NLS-1$
                                        printUpdateLine('*', summary, srcRef, remoteName, null);
                                } else {
                                        boolean fastForward = rru.isFastForward();
@@ -206,16 +206,16 @@ class Push extends TextBuiltin {
                        break;
 
                case NON_EXISTING:
-                       printUpdateLine('X', "[no match]", null, remoteName, null);
+                       printUpdateLine('X', "[no match]", null, remoteName, null); //$NON-NLS-1$
                        break;
 
                case REJECTED_NODELETE:
-                       printUpdateLine('!', "[rejected]", null, remoteName,
+                       printUpdateLine('!', "[rejected]", null, remoteName, //$NON-NLS-1$
                                        CLIText.get().remoteSideDoesNotSupportDeletingRefs);
                        break;
 
                case REJECTED_NONFASTFORWARD:
-                       printUpdateLine('!', "[rejected]", srcRef, remoteName,
+                       printUpdateLine('!', "[rejected]", srcRef, remoteName, //$NON-NLS-1$
                                        CLIText.get().nonFastForward);
                        break;
 
@@ -223,22 +223,22 @@ class Push extends TextBuiltin {
                        final String message = MessageFormat.format(
                                        CLIText.get().remoteRefObjectChangedIsNotExpectedOne,
                                        safeAbbreviate(reader, rru.getExpectedOldObjectId()));
-                       printUpdateLine('!', "[rejected]", srcRef, remoteName, message);
+                       printUpdateLine('!', "[rejected]", srcRef, remoteName, message); //$NON-NLS-1$
                        break;
 
                case REJECTED_OTHER_REASON:
-                       printUpdateLine('!', "[remote rejected]", srcRef, remoteName, rru
+                       printUpdateLine('!', "[remote rejected]", srcRef, remoteName, rru //$NON-NLS-1$
                                        .getMessage());
                        break;
 
                case UP_TO_DATE:
                        if (verbose)
-                               printUpdateLine('=', "[up to date]", srcRef, remoteName, null);
+                               printUpdateLine('=', "[up to date]", srcRef, remoteName, null); //$NON-NLS-1$
                        break;
 
                case NOT_ATTEMPTED:
                case AWAITING_REPORT:
-                       printUpdateLine('?', "[unexpected push-process behavior]", srcRef,
+                       printUpdateLine('?', "[unexpected push-process behavior]", srcRef, //$NON-NLS-1$
                                        remoteName, rru.getMessage());
                        break;
                }
index 6ba076290e710ed188cd3760e66897e915095e49..4d3af4b56078ad5149dd28ac3c8e6159790415db 100644 (file)
@@ -89,7 +89,7 @@ class Reset extends TextBuiltin {
                                if (hard)
                                        mode = selectMode(mode, ResetType.HARD);
                                if (mode == null)
-                                       throw die("no reset mode set");
+                                       throw die("no reset mode set"); //$NON-NLS-1$
                                command.setMode(mode);
                        }
                        command.call();
@@ -98,7 +98,7 @@ class Reset extends TextBuiltin {
 
        private static ResetType selectMode(ResetType mode, ResetType want) {
                if (mode != null)
-                       throw die("reset modes are mutually exclusive, select one");
+                       throw die("reset modes are mutually exclusive, select one"); //$NON-NLS-1$
                return want;
        }
 }
index d856989011693ec0b4f03a80f23ccbbbb6cfdc19..c96f2c1ba4e5f1b36636c71b72874fc4b2ed99a9 100644 (file)
@@ -136,7 +136,7 @@ class DiffAlgorithms extends TextBuiltin {
        protected void run() throws Exception {
                mxBean = ManagementFactory.getThreadMXBean();
                if (!mxBean.isCurrentThreadCpuTimeSupported())
-                       throw die("Current thread CPU time not supported on this JRE");
+                       throw die("Current thread CPU time not supported on this JRE"); //$NON-NLS-1$
 
                if (gitDirs.isEmpty()) {
                        RepositoryBuilder rb = new RepositoryBuilder() //
@@ -248,18 +248,18 @@ class DiffAlgorithms extends TextBuiltin {
                        File parent = directory.getParentFile();
                        if (name.equals(Constants.DOT_GIT) && parent != null)
                                name = parent.getName();
-                       outw.println(name + ": start at " + startId.name());
+                       outw.println(name + ": start at " + startId.name()); //$NON-NLS-1$
                }
 
-               outw.format("  %12d files,     %8d commits\n", valueOf(files),
+               outw.format("  %12d files,     %8d commits\n", valueOf(files), //$NON-NLS-1$
                                valueOf(commits));
-               outw.format("  N=%10d min lines, %8d max lines\n", valueOf(minN),
+               outw.format("  N=%10d min lines, %8d max lines\n", valueOf(minN), //$NON-NLS-1$
                                valueOf(maxN));
 
-               outw.format("%-25s %12s ( %12s  %12s )\n", //
-                               "Algorithm", "Time(ns)", "Time(ns) on", "Time(ns) on");
-               outw.format("%-25s %12s ( %12s  %12s )\n", //
-                               "", "", "N=" + minN, "N=" + maxN);
+               outw.format("%-25s %12s ( %12s  %12s )\n", //$NON-NLS-1$
+                               "Algorithm", "Time(ns)", "Time(ns) on", "Time(ns) on"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+               outw.format("%-25s %12s ( %12s  %12s )\n", //$NON-NLS-1$
+                               "", "", "N=" + minN, "N=" + maxN); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                outw.println("-----------------------------------------------------" //$NON-NLS-1$
                                + "----------------"); //$NON-NLS-1$
 
@@ -335,9 +335,9 @@ class DiffAlgorithms extends TextBuiltin {
                                }
                        }
                } catch (IllegalArgumentException e) {
-                       throw die("Cannot determine names", e);
+                       throw die("Cannot determine names", e); //$NON-NLS-1$
                } catch (IllegalAccessException e) {
-                       throw die("Cannot determine names", e);
+                       throw die("Cannot determine names", e); //$NON-NLS-1$
                }
 
                return all;
index 6260cd99faf6ea553c92bc6b8d987296c06ad1b1..e2f93f48148f9f602837c3b18032068ae1d7b19f 100644 (file)
@@ -167,7 +167,7 @@ class RebuildCommitGraph extends TextBuiltin {
                        }
                }
 
-               pm.beginTask("Rewriting commits", queue.size());
+               pm.beginTask("Rewriting commits", queue.size()); //$NON-NLS-1$
                try (ObjectInserter oi = db.newObjectInserter()) {
                        final ObjectId emptyTree = oi.insert(Constants.OBJ_TREE,
                                        new byte[] {});
@@ -203,7 +203,7 @@ class RebuildCommitGraph extends TextBuiltin {
                                        newc.setAuthor(new PersonIdent(me, new Date(t.commitTime)));
                                        newc.setCommitter(newc.getAuthor());
                                        newc.setParentIds(newParents);
-                                       newc.setMessage("ORIGINAL " + t.oldId.name() + "\n"); //$NON-NLS-2$
+                                       newc.setMessage("ORIGINAL " + t.oldId.name() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
                                        t.newId = oi.insert(newc);
                                        rewrites.put(t.oldId, t.newId);
                                        pm.update(1);
index d3eb245cd9f3ff7f507d2798c967fdf9ee0431da..150fe6eecb588422d007cc282d0c1611f3881839 100644 (file)
@@ -87,9 +87,9 @@ class ShowPackDelta extends TextBuiltin {
                long size = reader.getObjectSize(obj, obj.getType());
                try {
                        if (BinaryDelta.getResultSize(delta) != size)
-                               throw die("Object " + obj.name() + " is not a delta");
+                               throw die("Object " + obj.name() + " is not a delta"); //$NON-NLS-1$ //$NON-NLS-2$
                } catch (ArrayIndexOutOfBoundsException bad) {
-                       throw die("Object " + obj.name() + " is not a delta");
+                       throw die("Object " + obj.name() + " is not a delta"); //$NON-NLS-1$ //$NON-NLS-2$
                }
 
                outw.println(BinaryDelta.format(delta));
index 887ad08af753bc275101254d5b54fe91bc528c17..062f4e7a1ff01bb661a3066aee151532b4b89a26 100644 (file)
@@ -349,10 +349,10 @@ class TextHashFunctions extends TextBuiltin {
                                name = parent.getName();
                        outw.println(name + ":"); //$NON-NLS-1$
                }
-               outw.format("  %6d files; %5d avg. unique lines/file\n", //
+               outw.format("  %6d files; %5d avg. unique lines/file\n", //$NON-NLS-1$
                                valueOf(fileCnt), //
                                valueOf(lineCnt / fileCnt));
-               outw.format("%-20s %-15s %9s\n", "Hash", "Fold", "Max Len");
+               outw.format("%-20s %-15s %9s\n", "Hash", "Fold", "Max Len"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                outw.println("-----------------------------------------------"); //$NON-NLS-1$
                String lastHashName = null;
                for (Function fun : all) {
@@ -405,9 +405,9 @@ class TextHashFunctions extends TextBuiltin {
                                }
                        }
                } catch (IllegalArgumentException e) {
-                       throw new RuntimeException("Cannot determine names", e);
+                       throw new RuntimeException("Cannot determine names", e); //$NON-NLS-1$
                } catch (IllegalAccessException e) {
-                       throw new RuntimeException("Cannot determine names", e);
+                       throw new RuntimeException("Cannot determine names", e); //$NON-NLS-1$
                }
 
                List<Function> all = new ArrayList<Function>();
index 9aeb840ebe2e794846e43b2df39a4d943b287cf1..2f9dfa1d6b9d399ddf8c6d2e0b8d2a6973b4cec4 100644 (file)
@@ -715,7 +715,7 @@ public class URIish implements Serializable {
         */
        public String getHumanishName() throws IllegalArgumentException {
                String s = getPath();
-               if ("/".equals(s) || "".equals(s)) //$NON-NLS-1$
+               if ("/".equals(s) || "".equals(s)) //$NON-NLS-1$ //$NON-NLS-2$
                        s = getHost();
                if (s == null) // $NON-NLS-1$
                        throw new IllegalArgumentException();