Browse Source

Mark non-externalizable strings as such

A few classes such as Constanrs are marked with @SuppressWarnings, as are
toString() methods with many liternal, but otherwise $NLS-n$ is used for
string containing text that should not be translated. A few literals may
fall into the gray zone, but mostly I've tried to only tag the obvious
ones.

Change-Id: I22e50a77e2bf9e0b842a66bdf674e8fa1692f590
tags/v2.3.0.201302130906
Robin Rosenberg 11 years ago
parent
commit
c310fa0c80
100 changed files with 429 additions and 411 deletions
  1. 4
    4
      org.eclipse.jgit.console/src/org/eclipse/jgit/console/ConsoleAuthenticator.java
  2. 6
    6
      org.eclipse.jgit.console/src/org/eclipse/jgit/console/ConsoleCredentialsProvider.java
  3. 4
    4
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java
  4. 4
    4
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AmazonS3Client.java
  5. 31
    31
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java
  6. 3
    3
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java
  7. 3
    3
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java
  8. 3
    3
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java
  9. 3
    3
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandRef.java
  10. 1
    1
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java
  11. 3
    3
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Config.java
  12. 8
    8
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java
  13. 1
    1
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Glog.java
  14. 12
    12
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java
  15. 1
    1
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java
  16. 12
    12
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
  17. 4
    4
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java
  18. 5
    5
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
  19. 5
    5
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Reflog.java
  20. 11
    11
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java
  21. 1
    1
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ShowRef.java
  22. 5
    5
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java
  23. 1
    1
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java
  24. 3
    4
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java
  25. 3
    3
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java
  26. 1
    1
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ReadDirCache.java
  27. 6
    6
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
  28. 1
    1
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java
  29. 1
    1
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowDirCache.java
  30. 4
    4
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java
  31. 1
    1
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/eclipse/Ipzilla.java
  32. 2
    2
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java
  33. 2
    2
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevCommitHandler.java
  34. 1
    1
      org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java
  35. 3
    3
      org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AwtAuthenticator.java
  36. 7
    6
      org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java
  37. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java
  38. 3
    3
      org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java
  39. 3
    3
      org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java
  40. 2
    2
      org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java
  41. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/api/CleanCommand.java
  42. 2
    1
      org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java
  43. 12
    12
      org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java
  44. 13
    13
      org.eclipse.jgit/src/org/eclipse/jgit/api/CreateBranchCommand.java
  45. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteBranchCommand.java
  46. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/api/DiffCommand.java
  47. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java
  48. 2
    2
      org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java
  49. 7
    7
      org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java
  50. 1
    0
      org.eclipse.jgit/src/org/eclipse/jgit/api/MergeResult.java
  51. 2
    2
      org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java
  52. 1
    0
      org.eclipse.jgit/src/org/eclipse/jgit/api/PullResult.java
  53. 42
    38
      org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
  54. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/api/RenameBranchCommand.java
  55. 3
    3
      org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java
  56. 5
    5
      org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java
  57. 3
    3
      org.eclipse.jgit/src/org/eclipse/jgit/api/StashApplyCommand.java
  58. 2
    2
      org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java
  59. 2
    2
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/ConcurrentRefUpdateException.java
  60. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java
  61. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameResult.java
  62. 3
    2
      org.eclipse.jgit/src/org/eclipse/jgit/blame/Candidate.java
  63. 8
    8
      org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffConfig.java
  64. 2
    1
      org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffEntry.java
  65. 28
    28
      org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java
  66. 1
    0
      org.eclipse.jgit/src/org/eclipse/jgit/diff/Edit.java
  67. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/diff/EditList.java
  68. 3
    3
      org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java
  69. 2
    2
      org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java
  70. 3
    3
      org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
  71. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheBuilder.java
  72. 6
    6
      org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
  73. 1
    0
      org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java
  74. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/errors/CheckoutConflictException.java
  75. 2
    2
      org.eclipse.jgit/src/org/eclipse/jgit/errors/CompoundException.java
  76. 3
    3
      org.eclipse.jgit/src/org/eclipse/jgit/errors/InvalidObjectIdException.java
  77. 2
    2
      org.eclipse.jgit/src/org/eclipse/jgit/errors/MissingBundlePrerequisiteException.java
  78. 2
    2
      org.eclipse.jgit/src/org/eclipse/jgit/errors/PackProtocolException.java
  79. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/errors/RevisionSyntaxException.java
  80. 2
    2
      org.eclipse.jgit/src/org/eclipse/jgit/errors/TranslationBundleLoadingException.java
  81. 2
    2
      org.eclipse.jgit/src/org/eclipse/jgit/errors/TranslationStringMissingException.java
  82. 2
    2
      org.eclipse.jgit/src/org/eclipse/jgit/errors/TransportException.java
  83. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/errors/UnsupportedCredentialItem.java
  84. 1
    0
      org.eclipse.jgit/src/org/eclipse/jgit/events/ListenerHandle.java
  85. 1
    0
      org.eclipse.jgit/src/org/eclipse/jgit/events/RepositoryEvent.java
  86. 5
    5
      org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/FileNameMatcher.java
  87. 17
    17
      org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java
  88. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreNode.java
  89. 12
    12
      org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreRule.java
  90. 2
    1
      org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java
  91. 1
    0
      org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java
  92. 3
    3
      org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
  93. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java
  94. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchingProgressMonitor.java
  95. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/lib/BranchConfig.java
  96. 6
    5
      org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java
  97. 19
    19
      org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java
  98. 1
    0
      org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java
  99. 1
    0
      org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigLine.java
  100. 0
    0
      org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigSnapshot.java

+ 4
- 4
org.eclipse.jgit.console/src/org/eclipse/jgit/console/ConsoleAuthenticator.java View File

@@ -66,11 +66,11 @@ public class ConsoleAuthenticator extends CachedAuthenticator {
@Override
protected PasswordAuthentication promptPasswordAuthentication() {
final String realm = formatRealm();
String username = cons.readLine(MessageFormat.format(ConsoleText.get().usernameFor + " ", realm));
String username = cons.readLine(MessageFormat.format(ConsoleText.get().usernameFor + " ", realm)); //$NON-NLS-1$
if (username == null || username.isEmpty()) {
return null;
}
char[] password = cons.readPassword(ConsoleText.get().password + " ");
char[] password = cons.readPassword(ConsoleText.get().password + " "); //$NON-NLS-1$
if (password == null) {
password = new char[0];
}
@@ -81,10 +81,10 @@ public class ConsoleAuthenticator extends CachedAuthenticator {
final StringBuilder realm = new StringBuilder();
if (getRequestorType() == RequestorType.PROXY) {
realm.append(getRequestorType());
realm.append(" ");
realm.append(" "); //$NON-NLS-1$
realm.append(getRequestingHost());
if (getRequestingPort() > 0) {
realm.append(":");
realm.append(":"); //$NON-NLS-1$
realm.append(getRequestingPort());
}
} else {

+ 6
- 6
org.eclipse.jgit.console/src/org/eclipse/jgit/console/ConsoleCredentialsProvider.java View File

@@ -118,7 +118,7 @@ public class ConsoleCredentialsProvider extends CredentialsProvider {

private boolean get(CredentialItem.StringType item) {
if (item.isValueSecure()) {
char[] v = cons.readPassword("%s: ", item.getPromptText());
char[] v = cons.readPassword("%s: ", item.getPromptText()); //$NON-NLS-1$
if (v != null) {
item.setValue(new String(v));
return true;
@@ -126,7 +126,7 @@ public class ConsoleCredentialsProvider extends CredentialsProvider {
return false;
}
} else {
String v = cons.readLine("%s: ", item.getPromptText());
String v = cons.readLine("%s: ", item.getPromptText()); //$NON-NLS-1$
if (v != null) {
item.setValue(v);
return true;
@@ -138,7 +138,7 @@ public class ConsoleCredentialsProvider extends CredentialsProvider {

private boolean get(CredentialItem.CharArrayType item) {
if (item.isValueSecure()) {
char[] v = cons.readPassword("%s: ", item.getPromptText());
char[] v = cons.readPassword("%s: ", item.getPromptText()); //$NON-NLS-1$
if (v != null) {
item.setValueNoCopy(v);
return true;
@@ -146,7 +146,7 @@ public class ConsoleCredentialsProvider extends CredentialsProvider {
return false;
}
} else {
String v = cons.readLine("%s: ", item.getPromptText());
String v = cons.readLine("%s: ", item.getPromptText()); //$NON-NLS-1$
if (v != null) {
item.setValueNoCopy(v.toCharArray());
return true;
@@ -157,13 +157,13 @@ public class ConsoleCredentialsProvider extends CredentialsProvider {
}

private boolean get(CredentialItem.InformationalMessage item) {
cons.printf("%s\n", item.getPromptText());
cons.printf("%s\n", item.getPromptText()); //$NON-NLS-1$
cons.flush();
return true;
}

private boolean get(CredentialItem.YesNoType item) {
String r = cons.readLine("%s [%s/%s]? ", item.getPromptText(),
String r = cons.readLine("%s [%s/%s]? ", item.getPromptText(), //$NON-NLS-1$
ConsoleText.get().answerYes, ConsoleText.get().answerNo);
if (r != null) {
item.setValue(ConsoleText.get().answerYes.equalsIgnoreCase(r));

+ 4
- 4
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java View File

@@ -84,7 +84,7 @@ abstract class AbstractFetchCommand extends TextBuiltin {
shownURI = true;
}

outw.format(" %c %-17s %-10s -> %s", valueOf(type), longType,
outw.format(" %c %-17s %-10s -> %s", valueOf(type), longType, //$NON-NLS-1$
src, dst);
outw.println();
}
@@ -150,18 +150,18 @@ abstract class AbstractFetchCommand extends TextBuiltin {
if (r == RefUpdate.Result.FORCED) {
final String aOld = safeAbbreviate(reader, u.getOldObjectId());
final String aNew = safeAbbreviate(reader, u.getNewObjectId());
return aOld + "..." + aNew;
return aOld + "..." + aNew; //$NON-NLS-1$
}

if (r == RefUpdate.Result.FAST_FORWARD) {
final String aOld = safeAbbreviate(reader, u.getOldObjectId());
final String aNew = safeAbbreviate(reader, u.getNewObjectId());
return aOld + ".." + aNew;
return aOld + ".." + aNew; //$NON-NLS-1$
}

if (r == RefUpdate.Result.NO_CHANGE)
return "[up to date]";
return "[" + r.name() + "]";
return "[" + r.name() + "]"; //$NON-NLS-1$//$NON-NLS-2$
}

private String safeAbbreviate(ObjectReader reader, ObjectId id) {

+ 4
- 4
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AmazonS3Client.java View File

@@ -83,7 +83,7 @@ class AmazonS3Client extends TextBuiltin {
protected void run() throws Exception {
final AmazonS3 s3 = new AmazonS3(properties());

if ("get".equals(op)) {
if ("get".equals(op)) { //$NON-NLS-1$
final URLConnection c = s3.get(bucket, key);
int len = c.getContentLength();
final InputStream in = c.getInputStream();
@@ -104,14 +104,14 @@ class AmazonS3Client extends TextBuiltin {
in.close();
}

} else if ("ls".equals(op) || "list".equals(op)) {
} else if ("ls".equals(op) || "list".equals(op)) { //$NON-NLS-1$//$NON-NLS-2$
for (final String k : s3.list(bucket, key))
outw.println(k);

} else if ("rm".equals(op) || "delete".equals(op)) {
} else if ("rm".equals(op) || "delete".equals(op)) { //$NON-NLS-1$ //$NON-NLS-2$
s3.delete(bucket, key);

} else if ("put".equals(op)) {
} else if ("put".equals(op)) { //$NON-NLS-1$
final OutputStream os = s3.beginPut(bucket, key, null, null);
final byte[] tmp = new byte[2048];
int n;

+ 31
- 31
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java View File

@@ -143,16 +143,16 @@ class Blame extends TextBuiltin {
}

if (abbrev == 0)
abbrev = db.getConfig().getInt("core", "abbrev", 7);
abbrev = db.getConfig().getInt("core", "abbrev", 7); //$NON-NLS-1$ //$NON-NLS-2$
if (!showBlankBoundary)
root = db.getConfig().getBoolean("blame", "blankboundary", false);
root = db.getConfig().getBoolean("blame", "blankboundary", false); //$NON-NLS-1$ //$NON-NLS-2$
if (!root)
root = db.getConfig().getBoolean("blame", "showroot", false);
root = db.getConfig().getBoolean("blame", "showroot", false); //$NON-NLS-1$ //$NON-NLS-2$

if (showRawTimestamp)
dateFmt = new SimpleDateFormat("ZZZZ");
dateFmt = new SimpleDateFormat("ZZZZ"); //$NON-NLS-1$
else
dateFmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss ZZZZ");
dateFmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss ZZZZ"); //$NON-NLS-1$

BlameGenerator generator = new BlameGenerator(db, file);
reader = db.newObjectReader();
@@ -170,7 +170,7 @@ class Blame extends TextBuiltin {
}
generator.reverse(rangeStart, rangeEnd);
} else if (revision != null) {
generator.push(null, db.resolve(revision + "^{commit}"));
generator.push(null, db.resolve(revision + "^{commit}")); //$NON-NLS-1$
} else {
generator.push(null, db.resolve(Constants.HEAD));
if (!db.isBare()) {
@@ -203,12 +203,12 @@ class Blame extends TextBuiltin {
maxSourceLine = Math.max(maxSourceLine, blame.getSourceLine(line));
}

String pathFmt = MessageFormat.format(" %{0}s", valueOf(pathWidth));
String numFmt = MessageFormat.format(" %{0}d",
String pathFmt = MessageFormat.format(" %{0}s", valueOf(pathWidth)); //$NON-NLS-1$
String numFmt = MessageFormat.format(" %{0}d", //$NON-NLS-1$
valueOf(1 + (int) Math.log10(maxSourceLine + 1)));
String lineFmt = MessageFormat.format(" %{0}d) ",
String lineFmt = MessageFormat.format(" %{0}d) ", //$NON-NLS-1$
valueOf(1 + (int) Math.log10(end + 1)));
String authorFmt = MessageFormat.format(" (%-{0}s %{1}s",
String authorFmt = MessageFormat.format(" (%-{0}s %{1}s", //$NON-NLS-1$
valueOf(authorWidth), valueOf(dateWidth));

for (int line = begin; line < end; line++) {
@@ -233,8 +233,8 @@ class Blame extends TextBuiltin {

private void parseLineRangeOption() {
String beginStr, endStr;
if (rangeString.startsWith("/")) {
int c = rangeString.indexOf("/,", 1);
if (rangeString.startsWith("/")) { //$NON-NLS-1$
int c = rangeString.indexOf("/,", 1); //$NON-NLS-1$
if (c < 0) {
beginStr = rangeString;
endStr = String.valueOf(end);
@@ -249,7 +249,7 @@ class Blame extends TextBuiltin {
beginStr = rangeString;
endStr = String.valueOf(end);
} else if (c == 0) {
beginStr = "0";
beginStr = "0"; //$NON-NLS-1$
endStr = rangeString.substring(1);
} else {
beginStr = rangeString.substring(0, c);
@@ -257,20 +257,20 @@ class Blame extends TextBuiltin {
}
}

if (beginStr.equals(""))
if (beginStr.equals("")) //$NON-NLS-1$
begin = 0;
else if (beginStr.startsWith("/"))
else if (beginStr.startsWith("/")) //$NON-NLS-1$
begin = findLine(0, beginStr);
else
begin = Math.max(0, Integer.parseInt(beginStr) - 1);

if (endStr.equals(""))
if (endStr.equals("")) //$NON-NLS-1$
end = blame.getResultContents().size();
else if (endStr.startsWith("/"))
else if (endStr.startsWith("/")) //$NON-NLS-1$
end = findLine(begin, endStr);
else if (endStr.startsWith("-"))
else if (endStr.startsWith("-")) //$NON-NLS-1$
end = begin + Integer.parseInt(endStr);
else if (endStr.startsWith("+"))
else if (endStr.startsWith("+")) //$NON-NLS-1$
end = begin + Integer.parseInt(endStr.substring(1));
else
end = Math.max(0, Integer.parseInt(endStr) - 1);
@@ -278,10 +278,10 @@ class Blame extends TextBuiltin {

private int findLine(int b, String regex) {
String re = regex.substring(1, regex.length() - 1);
if (!re.startsWith("^"))
re = ".*" + re;
if (!re.endsWith("$"))
re = re + ".*";
if (!re.startsWith("^")) //$NON-NLS-1$
re = ".*" + re; //$NON-NLS-1$
if (!re.endsWith("$")) //$NON-NLS-1$
re = re + ".*"; //$NON-NLS-1$
Pattern p = Pattern.compile(re);
RawText text = blame.getResultContents();
for (int line = b; line < text.size(); line++) {
@@ -293,30 +293,30 @@ class Blame extends TextBuiltin {

private String path(int line) {
String p = blame.getSourcePath(line);
return p != null ? p : "";
return p != null ? p : ""; //$NON-NLS-1$
}

private String author(int line) {
PersonIdent author = blame.getSourceAuthor(line);
if (author == null)
return "";
return ""; //$NON-NLS-1$
String name = showAuthorEmail ? author.getEmailAddress() : author
.getName();
return name != null ? name : "";
return name != null ? name : ""; //$NON-NLS-1$
}

private String date(int line) {
if (blame.getSourceCommit(line) == null)
return "";
return ""; //$NON-NLS-1$

PersonIdent author = blame.getSourceAuthor(line);
if (author == null)
return "";
return ""; //$NON-NLS-1$

dateFmt.setTimeZone(author.getTimeZone());
if (!showRawTimestamp)
return dateFmt.format(author.getWhen());
return String.format("%d %s",
return String.format("%d %s", //$NON-NLS-1$
valueOf(author.getWhen().getTime() / 1000L),
dateFmt.format(author.getWhen()));
}
@@ -338,9 +338,9 @@ class Blame extends TextBuiltin {

} else if (!root && commit.getParentCount() == 0) {
if (showLongRevision)
r = "^" + commit.name().substring(0, OBJECT_ID_STRING_LENGTH - 1);
r = "^" + commit.name().substring(0, OBJECT_ID_STRING_LENGTH - 1); //$NON-NLS-1$
else
r = "^" + reader.abbreviate(commit, abbrev).name();
r = "^" + reader.abbreviate(commit, abbrev).name(); //$NON-NLS-1$
} else {
if (showLongRevision)
r = commit.name();

+ 3
- 3
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java View File

@@ -145,7 +145,7 @@ class Branch extends TextBuiltin {
else
startBranch = Constants.HEAD;
Ref startRef = db.getRef(startBranch);
ObjectId startAt = db.resolve(startBranch + "^0");
ObjectId startAt = db.resolve(startBranch + "^0"); //$NON-NLS-1$
if (startRef != null)
startBranch = startRef.getName();
else
@@ -180,7 +180,7 @@ class Branch extends TextBuiltin {
if (head != null) {
String current = head.getLeaf().getName();
if (current.equals(Constants.HEAD))
addRef("(no branch)", head);
addRef("(no branch)", head); //$NON-NLS-1$
addRefs(refs, Constants.R_HEADS, !remote);
addRefs(refs, Constants.R_REMOTES, remote);

@@ -220,7 +220,7 @@ class Branch extends TextBuiltin {
outw.print(ref);
if (verbose) {
final int spaces = maxNameLength - ref.length() + 1;
outw.format("%" + spaces + "s", "");
outw.format("%" + spaces + "s", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
final ObjectId objectId = refObj.getObjectId();
outw.print(reader.abbreviate(objectId).name());
outw.print(' ');

+ 3
- 3
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java View File

@@ -110,7 +110,7 @@ class Clone extends AbstractFetchCommand {
dst = new FileRepository(gitdir);
dst.create();
final FileBasedConfig dstcfg = dst.getConfig();
dstcfg.setBoolean("core", null, "bare", false);
dstcfg.setBoolean("core", null, "bare", false); //$NON-NLS-1$ //$NON-NLS-2$
dstcfg.save();
db = dst;

@@ -131,8 +131,8 @@ class Clone extends AbstractFetchCommand {
final RemoteConfig rc = new RemoteConfig(dstcfg, remoteName);
rc.addURI(uri);
rc.addFetchRefSpec(new RefSpec().setForceUpdate(true)
.setSourceDestination(Constants.R_HEADS + "*",
Constants.R_REMOTES + remoteName + "/*"));
.setSourceDestination(Constants.R_HEADS + "*", //$NON-NLS-1$
Constants.R_REMOTES + remoteName + "/*")); //$NON-NLS-1$
rc.update(dstcfg);
dstcfg.save();
}

+ 3
- 3
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java View File

@@ -132,7 +132,7 @@ public class CommandCatalog {

private Enumeration<URL> catalogs() {
try {
final String pfx = "META-INF/services/";
final String pfx = "META-INF/services/"; //$NON-NLS-1$
return ldr.getResources(pfx + TextBuiltin.class.getName());
} catch (IOException err) {
return new Vector<URL>().elements();
@@ -143,7 +143,7 @@ public class CommandCatalog {
final BufferedReader cIn;
try {
final InputStream in = cUrl.openStream();
cIn = new BufferedReader(new InputStreamReader(in, "UTF-8"));
cIn = new BufferedReader(new InputStreamReader(in, "UTF-8")); //$NON-NLS-1$
} catch (IOException err) {
// If we cannot read from the service list, go to the next.
//
@@ -153,7 +153,7 @@ public class CommandCatalog {
try {
String line;
while ((line = cIn.readLine()) != null) {
if (line.length() > 0 && !line.startsWith("#"))
if (line.length() > 0 && !line.startsWith("#")) //$NON-NLS-1$
load(line);
}
} catch (IOException err) {

+ 3
- 3
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandRef.java View File

@@ -76,13 +76,13 @@ public class CommandRef {
private CommandRef(final Class<? extends TextBuiltin> clazz, final String cn) {
impl = clazz;
name = cn;
usage = "";
usage = ""; //$NON-NLS-1$
}

private static String guessName(final Class<? extends TextBuiltin> clazz) {
final StringBuilder s = new StringBuilder();
if (clazz.getName().startsWith("org.eclipse.jgit.pgm.debug."))
s.append("debug-");
if (clazz.getName().startsWith("org.eclipse.jgit.pgm.debug.")) //$NON-NLS-1$
s.append("debug-"); //$NON-NLS-1$

boolean lastWasDash = true;
for (final char c : clazz.getSimpleName().toCharArray()) {

+ 1
- 1
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java View File

@@ -109,7 +109,7 @@ class Commit extends TextBuiltin {
if (branchName.startsWith(Constants.R_HEADS))
branchName = branchName.substring(Constants.R_HEADS.length());
}
outw.println("[" + branchName + " " + commit.name() + "] "
outw.println("[" + branchName + " " + commit.name() + "] " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ commit.getShortMessage());
}
}

+ 3
- 3
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Config.java View File

@@ -103,7 +103,7 @@ class Config extends TextBuiltin {
Set<String> names = config.getNames(section);
for (String name : names) {
for (String value : config.getStringList(section, null, name))
outw.println(section + "." + name + "=" + value);
outw.println(section + "." + name + "=" + value); //$NON-NLS-1$ //$NON-NLS-2$
}
if (names.isEmpty()) {
for (String subsection : config.getSubsections(section)) {
@@ -111,8 +111,8 @@ class Config extends TextBuiltin {
for (String name : names) {
for (String value : config.getStringList(section,
subsection, name))
outw.println(section + "." + subsection + "."
+ name + "=" + value);
outw.println(section + "." + subsection + "." //$NON-NLS-1$ //$NON-NLS-2$
+ name + "=" + value); //$NON-NLS-1$
}
}
}

+ 8
- 8
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java View File

@@ -161,8 +161,8 @@ class Diff extends TextBuiltin {

@Option(name = "--no-prefix", usage = "usage_noPrefix")
void noPrefix(@SuppressWarnings("unused") boolean on) {
diffFmt.setOldPrefix("");
diffFmt.setNewPrefix("");
diffFmt.setOldPrefix(""); //$NON-NLS-1$
diffFmt.setNewPrefix(""); //$NON-NLS-1$
}

// END -- Options shared with Log
@@ -179,7 +179,7 @@ class Diff extends TextBuiltin {
try {
if (cached) {
if (oldTree == null) {
ObjectId head = db.resolve(HEAD + "^{tree}");
ObjectId head = db.resolve(HEAD + "^{tree}"); //$NON-NLS-1$
if (head == null)
die(MessageFormat.format(CLIText.get().notATree, HEAD));
CanonicalTreeParser p = new CanonicalTreeParser();
@@ -227,21 +227,21 @@ class Diff extends TextBuiltin {
for (DiffEntry ent : files) {
switch (ent.getChangeType()) {
case ADD:
out.println("A\t" + ent.getNewPath());
out.println("A\t" + ent.getNewPath()); //$NON-NLS-1$
break;
case DELETE:
out.println("D\t" + ent.getOldPath());
out.println("D\t" + ent.getOldPath()); //$NON-NLS-1$
break;
case MODIFY:
out.println("M\t" + ent.getNewPath());
out.println("M\t" + ent.getNewPath()); //$NON-NLS-1$
break;
case COPY:
out.format("C%1$03d\t%2$s\t%3$s", valueOf(ent.getScore()), //
out.format("C%1$03d\t%2$s\t%3$s", valueOf(ent.getScore()), // //$NON-NLS-1$
ent.getOldPath(), ent.getNewPath());
out.println();
break;
case RENAME:
out.format("R%1$03d\t%2$s\t%3$s", valueOf(ent.getScore()), //
out.format("R%1$03d\t%2$s\t%3$s", valueOf(ent.getScore()), // //$NON-NLS-1$
ent.getOldPath(), ent.getNewPath());
out.println();
break;

+ 1
- 1
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Glog.java View File

@@ -104,7 +104,7 @@ class Glog extends RevWalkTextBuiltin {
graphPane.getCommitList().source(walk);
graphPane.getCommitList().fillTo(Integer.MAX_VALUE);

frame.setTitle("[" + repoName() + "]");
frame.setTitle("[" + repoName() + "]"); //$NON-NLS-1$ //$NON-NLS-2$
frame.pack();
frame.setVisible(true);
return graphPane.getCommitList().size();

+ 12
- 12
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java View File

@@ -171,8 +171,8 @@ class Log extends RevWalkTextBuiltin {

@Option(name = "--no-prefix", usage = "usage_noPrefix")
void noPrefix(@SuppressWarnings("unused") boolean on) {
diffFmt.setOldPrefix("");
diffFmt.setNewPrefix("");
diffFmt.setOldPrefix(""); //$NON-NLS-1$
diffFmt.setNewPrefix(""); //$NON-NLS-1$
}

// END -- Options shared with Diff
@@ -238,18 +238,18 @@ class Log extends RevWalkTextBuiltin {
@Override
protected void show(final RevCommit c) throws Exception {
outw.print(CLIText.get().commitLabel);
outw.print(" ");
outw.print(" "); //$NON-NLS-1$
c.getId().copyTo(outbuffer, outw);
if (decorate) {
Collection<Ref> list = allRefsByPeeledObjectId.get(c);
if (list != null) {
outw.print(" (");
outw.print(" ("); //$NON-NLS-1$
for (Iterator<Ref> i = list.iterator(); i.hasNext(); ) {
outw.print(i.next().getName());
if (i.hasNext())
outw.print(" ");
outw.print(" "); //$NON-NLS-1$
}
outw.print(")");
outw.print(")"); //$NON-NLS-1$
}
}
outw.println();
@@ -260,9 +260,9 @@ class Log extends RevWalkTextBuiltin {
dateFormatter.formatDate(author)));

outw.println();
final String[] lines = c.getFullMessage().split("\n");
final String[] lines = c.getFullMessage().split("\n"); //$NON-NLS-1$
for (final String s : lines) {
outw.print(" ");
outw.print(" "); //$NON-NLS-1$
outw.print(s);
outw.println();
}
@@ -324,16 +324,16 @@ class Log extends RevWalkTextBuiltin {
outw.println();
outw.print("Notes");
if (label != null) {
outw.print(" (");
outw.print(" ("); //$NON-NLS-1$
outw.print(label);
outw.print(")");
outw.print(")"); //$NON-NLS-1$
}
outw.println(":");
outw.println(":"); //$NON-NLS-1$
try {
RawText rawText = new RawText(argWalk.getObjectReader()
.open(blobId).getCachedBytes(Integer.MAX_VALUE));
for (int i = 0; i < rawText.size(); i++) {
outw.print(" ");
outw.print(" "); //$NON-NLS-1$
outw.println(rawText.getString(i));
}
} catch (LargeObjectException e) {

+ 1
- 1
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java View File

@@ -71,7 +71,7 @@ class LsRemote extends TextBuiltin {
for (final Ref r : c.getRefs()) {
show(r.getObjectId(), r.getName());
if (r.getPeeledObjectId() != null)
show(r.getPeeledObjectId(), r.getName() + "^{}");
show(r.getPeeledObjectId(), r.getName() + "^{}"); //$NON-NLS-1$
}
} finally {
c.close();

+ 12
- 12
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java View File

@@ -128,7 +128,7 @@ public class Main {
&& err instanceof TransportException)
System.err.println(MessageFormat.format(CLIText.get().fatalError, err.getCause().getMessage()));

if (err.getClass().getName().startsWith("org.eclipse.jgit.errors.")) {
if (err.getClass().getName().startsWith("org.eclipse.jgit.errors.")) { //$NON-NLS-1$
System.err.println(MessageFormat.format(CLIText.get().fatalError, err.getMessage()));
if (showStackTrace)
err.printStackTrace();
@@ -163,7 +163,7 @@ public class Main {

if (argv.length == 0 || help) {
final String ex = clp.printExample(ExampleMode.ALL, CLIText.get().resourceBundle());
writer.println("jgit" + ex + " command [ARG ...]");
writer.println("jgit" + ex + " command [ARG ...]"); //$NON-NLS-1$
if (help) {
writer.println();
clp.printUsage(writer, CLIText.get().resourceBundle());
@@ -226,8 +226,8 @@ public class Main {

private static boolean installConsole() {
try {
install("org.eclipse.jgit.console.ConsoleAuthenticator");
install("org.eclipse.jgit.console.ConsoleCredentialsProvider");
install("org.eclipse.jgit.console.ConsoleAuthenticator"); //$NON-NLS-1$
install("org.eclipse.jgit.console.ConsoleCredentialsProvider"); //$NON-NLS-1$
return true;
} catch (ClassNotFoundException e) {
return false;
@@ -253,7 +253,7 @@ public class Main {
throws IllegalAccessException, InvocationTargetException,
NoSuchMethodException, ClassNotFoundException {
try {
Class.forName(name).getMethod("install").invoke(null);
Class.forName(name).getMethod("install").invoke(null); //$NON-NLS-1$
} catch (InvocationTargetException e) {
if (e.getCause() instanceof RuntimeException)
throw (RuntimeException) e.getCause();
@@ -276,23 +276,23 @@ public class Main {
* the value in <code>http_proxy</code> is unsupportable.
*/
private static void configureHttpProxy() throws MalformedURLException {
final String s = System.getenv("http_proxy");
if (s == null || s.equals(""))
final String s = System.getenv("http_proxy"); //$NON-NLS-1$
if (s == null || s.equals("")) //$NON-NLS-1$
return;

final URL u = new URL((s.indexOf("://") == -1) ? "http://" + s : s);
if (!"http".equals(u.getProtocol()))
final URL u = new URL((s.indexOf("://") == -1) ? "http://" + s : s); //$NON-NLS-1$ //$NON-NLS-2$
if (!"http".equals(u.getProtocol())) //$NON-NLS-1$
throw new MalformedURLException(MessageFormat.format(CLIText.get().invalidHttpProxyOnlyHttpSupported, s));

final String proxyHost = u.getHost();
final int proxyPort = u.getPort();

System.setProperty("http.proxyHost", proxyHost);
System.setProperty("http.proxyHost", proxyHost); //$NON-NLS-1$
if (proxyPort > 0)
System.setProperty("http.proxyPort", String.valueOf(proxyPort));
System.setProperty("http.proxyPort", String.valueOf(proxyPort)); //$NON-NLS-1$

final String userpass = u.getUserInfo();
if (userpass != null && userpass.contains(":")) {
if (userpass != null && userpass.contains(":")) { //$NON-NLS-1$
final int c = userpass.indexOf(':');
final String user = userpass.substring(0, c);
final String pass = userpass.substring(c + 1);

+ 4
- 4
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java View File

@@ -103,7 +103,7 @@ class Merge extends TextBuiltin {

// determine the other revision we want to merge with HEAD
final Ref srcRef = db.getRef(ref);
final ObjectId src = db.resolve(ref + "^{commit}");
final ObjectId src = db.resolve(ref + "^{commit}"); //$NON-NLS-1$
if (src == null)
throw die(MessageFormat.format(
CLIText.get().refDoesNotExistOrNoCommit, ref));
@@ -144,11 +144,11 @@ class Merge extends TextBuiltin {
case DIRTY_WORKTREE:
case DIRTY_INDEX:
outw.println(CLIText.get().dontOverwriteLocalChanges);
outw.println(" " + entry.getKey());
outw.println(" " + entry.getKey()); //$NON-NLS-1$
break;
case COULD_NOT_DELETE:
outw.println(CLIText.get().cannotDeleteFile);
outw.println(" " + entry.getKey());
outw.println(" " + entry.getKey()); //$NON-NLS-1$
break;
}
break;
@@ -157,7 +157,7 @@ class Merge extends TextBuiltin {
if (!isMergedInto(oldHead, src))
name = mergeStrategy.getName();
else
name = "recursive";
name = "recursive"; //$NON-NLS-1$
outw.println(MessageFormat.format(CLIText.get().mergeMadeBy, name));
break;
case MERGED_SQUASHED:

+ 5
- 5
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java View File

@@ -194,7 +194,7 @@ class Push extends TextBuiltin {
final char flag = fastForward ? ' ' : '+';
final String summary = safeAbbreviate(reader, oldRef
.getObjectId())
+ (fastForward ? ".." : "...")
+ (fastForward ? ".." : "...") //$NON-NLS-1$ //$NON-NLS-2$
+ safeAbbreviate(reader, rru.getNewObjectId());
final String message = fastForward ? null : CLIText.get().forcedUpdate;
printUpdateLine(flag, summary, srcRef, remoteName, message);
@@ -252,14 +252,14 @@ class Push extends TextBuiltin {
private void printUpdateLine(final char flag, final String summary,
final String srcRef, final String destRef, final String message)
throws IOException {
outw.format(" %c %-17s", valueOf(flag), summary);
outw.format(" %c %-17s", valueOf(flag), summary); //$NON-NLS-1$

if (srcRef != null)
outw.format(" %s ->", abbreviateRef(srcRef, true));
outw.format(" %s", abbreviateRef(destRef, true));
outw.format(" %s ->", abbreviateRef(srcRef, true)); //$NON-NLS-1$
outw.format(" %s", abbreviateRef(destRef, true)); //$NON-NLS-1$

if (message != null)
outw.format(" (%s)", message);
outw.format(" (%s)", message); //$NON-NLS-1$

outw.println();
}

+ 5
- 5
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Reflog.java View File

@@ -73,14 +73,14 @@ class Reflog extends TextBuiltin {
private String toString(ReflogEntry entry, int i) {
final StringBuilder s = new StringBuilder();
s.append(entry.getNewId().abbreviate(7).name());
s.append(" ");
s.append(" "); //$NON-NLS-1$
s.append(ref == null ? Constants.HEAD : Repository.shortenRefName(ref));
s.append("@{" + i + "}:");
s.append(" ");
s.append("@{" + i + "}:"); //$NON-NLS-1$ //$NON-NLS-2$
s.append(" "); //$NON-NLS-1$
// temporary workaround for bug 393463
if (entry.getOldId().equals(ObjectId.zeroId()))
s.append(entry.getComment().replaceFirst("^commit:",
"commit (initial):"));
s.append(entry.getComment().replaceFirst("^commit:", //$NON-NLS-1$
"commit (initial):")); //$NON-NLS-1$
else
s.append(entry.getComment());
return s.toString();

+ 11
- 11
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java View File

@@ -154,14 +154,14 @@ class Show extends TextBuiltin {

@Option(name = "--no-prefix", usage = "usage_noPrefix")
void noPrefix(@SuppressWarnings("unused") boolean on) {
diffFmt.setOldPrefix("");
diffFmt.setNewPrefix("");
diffFmt.setOldPrefix(""); //$NON-NLS-1$
diffFmt.setNewPrefix(""); //$NON-NLS-1$
}

// END -- Options shared with Diff

Show() {
fmt = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy ZZZZZ", Locale.US);
fmt = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy ZZZZZ", Locale.US); //$NON-NLS-1$
}

@SuppressWarnings("boxing")
@@ -198,7 +198,7 @@ class Show extends TextBuiltin {
break;

case Constants.OBJ_TREE:
outw.print("tree ");
outw.print("tree "); //$NON-NLS-1$
outw.print(objectName);
outw.println();
outw.println();
@@ -225,7 +225,7 @@ class Show extends TextBuiltin {

private void show(RevTag tag) throws IOException {
outw.print(CLIText.get().tagLabel);
outw.print(" ");
outw.print(" "); //$NON-NLS-1$
outw.print(tag.getTagName());
outw.println();

@@ -241,9 +241,9 @@ class Show extends TextBuiltin {
}

outw.println();
final String[] lines = tag.getFullMessage().split("\n");
final String[] lines = tag.getFullMessage().split("\n"); //$NON-NLS-1$
for (final String s : lines) {
outw.print(" ");
outw.print(" "); //$NON-NLS-1$
outw.print(s);
outw.println();
}
@@ -261,7 +261,7 @@ class Show extends TextBuiltin {
outw.print(walk.getPathString());
final FileMode mode = walk.getFileMode(0);
if (mode == FileMode.TREE)
outw.print("/");
outw.print("/"); //$NON-NLS-1$
outw.println();
}
}
@@ -270,7 +270,7 @@ class Show extends TextBuiltin {
char[] outbuffer = new char[Constants.OBJECT_ID_LENGTH * 2];

outw.print(CLIText.get().commitLabel);
outw.print(" ");
outw.print(" "); //$NON-NLS-1$
c.getId().copyTo(outbuffer, outw);
outw.println();

@@ -284,9 +284,9 @@ class Show extends TextBuiltin {
fmt.format(author.getWhen())));

outw.println();
final String[] lines = c.getFullMessage().split("\n");
final String[] lines = c.getFullMessage().split("\n"); //$NON-NLS-1$
for (final String s : lines) {
outw.print(" ");
outw.print(" "); //$NON-NLS-1$
outw.print(s);
outw.println();
}

+ 1
- 1
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ShowRef.java View File

@@ -60,7 +60,7 @@ class ShowRef extends TextBuiltin {
for (final Ref r : getSortedRefs()) {
show(r.getObjectId(), r.getName());
if (r.getPeeledObjectId() != null)
show(r.getPeeledObjectId(), r.getName() + "^{}");
show(r.getPeeledObjectId(), r.getName() + "^{}"); //$NON-NLS-1$
}
}


+ 5
- 5
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java View File

@@ -99,7 +99,7 @@ class Status extends TextBuiltin {
int nbNotStagedForCommit = notStagedForCommit.size();
if (nbNotStagedForCommit > 0) {
if (!firstHeader)
printSectionHeader("");
printSectionHeader(""); //$NON-NLS-1$
printSectionHeader(CLIText.get().changesNotStagedForCommit);
printList(CLIText.get().statusModified,
CLIText.get().statusRemoved, null, notStagedForCommit,
@@ -109,7 +109,7 @@ class Status extends TextBuiltin {
int nbUnmerged = unmerged.size();
if (nbUnmerged > 0) {
if (!firstHeader)
printSectionHeader("");
printSectionHeader(""); //$NON-NLS-1$
printSectionHeader(CLIText.get().unmergedPaths);
printList(unmerged);
firstHeader = false;
@@ -117,7 +117,7 @@ class Status extends TextBuiltin {
int nbUntracked = untracked.size();
if (nbUntracked > 0) {
if (!firstHeader)
printSectionHeader("");
printSectionHeader(""); //$NON-NLS-1$
printSectionHeader(CLIText.get().untrackedFiles);
printList(untracked);
}
@@ -127,8 +127,8 @@ class Status extends TextBuiltin {
throws IOException {
outw.println(CLIText.formatLine(MessageFormat
.format(pattern, arguments)));
if (!pattern.equals(""))
outw.println(CLIText.formatLine(""));
if (!pattern.equals("")) //$NON-NLS-1$
outw.println(CLIText.formatLine("")); //$NON-NLS-1$
outw.flush();
}


+ 1
- 1
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java View File

@@ -68,7 +68,7 @@ class Tag extends TextBuiltin {
private boolean force;

@Option(name = "-m", metaVar = "metaVar_message", usage = "usage_tagMessage")
private String message = "";
private String message = ""; //$NON-NLS-1$

@Argument(index = 0, metaVar = "metaVar_name")
private String tagName;

+ 3
- 4
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java View File

@@ -134,8 +134,7 @@ public abstract class TextBuiltin {
protected void init(final Repository repository, final String gitDir) {
try {
final String outputEncoding = repository != null ? repository
.getConfig()
.getString("i18n", null, "logOutputEncoding") : null;
.getConfig().getString("i18n", null, "logOutputEncoding") : null; //$NON-NLS-1$ //$NON-NLS-2$
if (outs == null)
outs = new FileOutputStream(FileDescriptor.out);
BufferedWriter bufw;
@@ -208,7 +207,7 @@ public abstract class TextBuiltin {
* @param clp
*/
public void printUsageAndExit(final CmdLineParser clp) {
printUsageAndExit("", clp);
printUsageAndExit("", clp); //$NON-NLS-1$
}

/**
@@ -220,7 +219,7 @@ public abstract class TextBuiltin {
public void printUsageAndExit(final String message, final CmdLineParser clp) {
PrintWriter writer = new PrintWriter(System.err);
writer.println(message);
writer.print("jgit ");
writer.print("jgit "); //$NON-NLS-1$
writer.print(commandName);
clp.printSingleLineUsage(writer, getResourceBundle());
writer.println();

+ 3
- 3
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java View File

@@ -260,11 +260,11 @@ class DiffAlgorithms extends TextBuiltin {
"Algorithm", "Time(ns)", "Time(ns) on", "Time(ns) on");
outw.format("%-25s %12s ( %12s %12s )\n", //
"", "", "N=" + minN, "N=" + maxN);
outw.println("-----------------------------------------------------"
+ "----------------");
outw.println("-----------------------------------------------------" //$NON-NLS-1$
+ "----------------"); //$NON-NLS-1$

for (Test test : all) {
outw.format("%-25s %12d ( %12d %12d )", //
outw.format("%-25s %12d ( %12d %12d )", // //$NON-NLS-1$
test.algorithm.name, //
valueOf(test.runningTimeNanos), //
valueOf(test.minN.runningTimeNanos), //

+ 1
- 1
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ReadDirCache.java View File

@@ -59,7 +59,7 @@ class ReadDirCache extends TextBuiltin {
for (int i = 0; i < cnt; i++)
db.readDirCache();
final long end = System.currentTimeMillis();
outw.print(" ");
outw.print(" "); //$NON-NLS-1$
outw.println(MessageFormat.format(CLIText.get().averageMSPerRead,
valueOf((end - start) / cnt)));
}

+ 6
- 6
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java View File

@@ -95,7 +95,7 @@ import org.kohsuke.args4j.Option;
* <p>
*/
class RebuildCommitGraph extends TextBuiltin {
private static final String REALLY = "--destroy-this-repository";
private static final String REALLY = "--destroy-this-repository"; //$NON-NLS-1$

@Option(name = REALLY, usage = "usage_approveDestructionOfRepository")
boolean really;
@@ -138,7 +138,7 @@ class RebuildCommitGraph extends TextBuiltin {
try {
String line;
while ((line = br.readLine()) != null) {
final String[] parts = line.split("[ \t]{1,}");
final String[] parts = line.split("[ \t]{1,}"); //$NON-NLS-1$
final ObjectId oldId = ObjectId.fromString(parts[0]);
try {
rw.parseCommit(oldId);
@@ -165,8 +165,8 @@ class RebuildCommitGraph extends TextBuiltin {
pm.beginTask("Rewriting commits", queue.size());
final ObjectInserter oi = db.newObjectInserter();
final ObjectId emptyTree = oi.insert(Constants.OBJ_TREE, new byte[] {});
final PersonIdent me = new PersonIdent("jgit rebuild-commitgraph",
"rebuild-commitgraph@localhost");
final PersonIdent me = new PersonIdent("jgit rebuild-commitgraph", //$NON-NLS-1$
"rebuild-commitgraph@localhost"); //$NON-NLS-1$
while (!queue.isEmpty()) {
final ListIterator<ToRewrite> itr = queue
.listIterator(queue.size());
@@ -196,7 +196,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");
newc.setMessage("ORIGINAL " + t.oldId.name() + "\n"); //$NON-NLS-2$
t.newId = oi.insert(newc);
rewrites.put(t.oldId, t.newId);
pm.update(1);
@@ -277,7 +277,7 @@ class RebuildCommitGraph extends TextBuiltin {
try {
String line;
while ((line = br.readLine()) != null) {
final String[] parts = line.split("[ \t]{1,}");
final String[] parts = line.split("[ \t]{1,}"); //$NON-NLS-1$
final ObjectId origId = ObjectId.fromString(parts[0]);
final String type = parts[1];
final String name = parts[2];

+ 1
- 1
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java View File

@@ -103,7 +103,7 @@ class ShowCommands extends TextBuiltin {
final ClassLoader ldr = c.getImplementationClassLoader();

String cn = c.getImplementationClassName();
cn = cn.replace('.', '/') + ".class";
cn = cn.replace('.', '/') + ".class"; //$NON-NLS-1$

final URL url = ldr.getResource(cn);
if (url == null) {

+ 1
- 1
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowDirCache.java View File

@@ -71,7 +71,7 @@ class ShowDirCache extends TextBuiltin {
final int stage = ent.getStage();

outw.print(mode);
outw.format(" %6d", valueOf(len));
outw.format(" %6d", valueOf(len)); //$NON-NLS-1$
outw.print(' ');
outw.print(fmt.format(mtime));
outw.print(' ');

+ 4
- 4
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java View File

@@ -347,19 +347,19 @@ class TextHashFunctions extends TextBuiltin {
File parent = db.getDirectory().getParentFile();
if (name.equals(Constants.DOT_GIT) && parent != null)
name = parent.getName();
outw.println(name + ":");
outw.println(name + ":"); //$NON-NLS-1$
}
outw.format(" %6d files; %5d avg. unique lines/file\n", //
valueOf(fileCnt), //
valueOf(lineCnt / fileCnt));
outw.format("%-20s %-15s %9s\n", "Hash", "Fold", "Max Len");
outw.println("-----------------------------------------------");
outw.println("-----------------------------------------------"); //$NON-NLS-1$
String lastHashName = null;
for (Function fun : all) {
String hashName = fun.hash.name;
if (hashName.equals(lastHashName))
hashName = "";
outw.format("%-20s %-15s %9d\n", //
hashName = ""; //$NON-NLS-1$
outw.format("%-20s %-15s %9d\n", // //$NON-NLS-1$
hashName, //
fun.fold.name, //
valueOf(fun.maxChainLength));

+ 1
- 1
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/eclipse/Ipzilla.java View File

@@ -59,7 +59,7 @@ import org.kohsuke.args4j.Option;
@Command(name = "eclipse-ipzilla", common = false, usage = "usage_synchronizeIPZillaData")
class Ipzilla extends TextBuiltin {
@Option(name = "--url", metaVar = "metaVar_url", usage = "usage_IPZillaURL")
private String url = "https://dev.eclipse.org/ipzilla/";
private String url = "https://dev.eclipse.org/ipzilla/"; //$NON-NLS-1$

@Option(name = "--username", metaVar = "metaVar_user", usage = "usage_IPZillaUsername")
private String username;

+ 2
- 2
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java View File

@@ -127,13 +127,13 @@ public class CmdLineParser extends org.kohsuke.args4j.CmdLineParser {
final ArrayList<String> tmp = new ArrayList<String>(args.length);
for (int argi = 0; argi < args.length; argi++) {
final String str = args[argi];
if (str.equals("--")) {
if (str.equals("--")) { //$NON-NLS-1$
while (argi < args.length)
tmp.add(args[argi++]);
break;
}

if (str.startsWith("--")) {
if (str.startsWith("--")) { //$NON-NLS-1$
final int eq = str.indexOf('=');
if (eq > 0) {
tmp.add(str.substring(0, eq));

+ 2
- 2
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/RevCommitHandler.java View File

@@ -88,12 +88,12 @@ public class RevCommitHandler extends OptionHandler<RevCommit> {
String name = params.getParameter(0);

boolean interesting = true;
if (name.startsWith("^")) {
if (name.startsWith("^")) { //$NON-NLS-1$
name = name.substring(1);
interesting = false;
}

final int dot2 = name.indexOf("..");
final int dot2 = name.indexOf(".."); //$NON-NLS-1$
if (dot2 != -1) {
if (!option.isMultiValued())
throw new CmdLineException(MessageFormat.format(CLIText.get().onlyOneMetaVarExpectedIn

+ 1
- 1
org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AWTPlotRenderer.java View File

@@ -176,7 +176,7 @@ final class AWTPlotRenderer extends AbstractPlotRenderer<SwingLane, Color>
g.setBackground(new Color(colorComponents[0],colorComponents[1],colorComponents[2]));
}
if (txt.length() > 12)
txt = txt.substring(0,11) + "\u2026"; // ellipsis "…" (in UTF-8)
txt = txt.substring(0,11) + "\u2026"; // ellipsis "…" (in UTF-8) //$NON-NLS-1$

final int texth = g.getFontMetrics().getHeight();
int textw = g.getFontMetrics().stringWidth(txt);

+ 3
- 3
org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/AwtAuthenticator.java View File

@@ -75,13 +75,13 @@ public class AwtAuthenticator extends CachedAuthenticator {

final StringBuilder instruction = new StringBuilder();
instruction.append(UIText.get().enterUsernameAndPasswordFor);
instruction.append(" ");
instruction.append(" "); //$NON-NLS-1$
if (getRequestorType() == RequestorType.PROXY) {
instruction.append(getRequestorType());
instruction.append(" ");
instruction.append(" "); //$NON-NLS-1$
instruction.append(getRequestingHost());
if (getRequestingPort() > 0) {
instruction.append(":");
instruction.append(":"); //$NON-NLS-1$
instruction.append(getRequestingPort());
}
} else {

+ 7
- 6
org.eclipse.jgit.ui/src/org/eclipse/jgit/awtui/CommitGraphPane.java View File

@@ -94,7 +94,8 @@ public class CommitGraphPane extends JTable {
int h = 0;
for (int i = 0; i<getColumnCount(); ++i) {
TableCellRenderer renderer = getDefaultRenderer(getColumnClass(i));
Component c = renderer.getTableCellRendererComponent(this, "ÅOj", false, false, 0, i);
Component c = renderer.getTableCellRendererComponent(this,
"ÅOj", false, false, 0, i); //$NON-NLS-1$
h = Math.max(h, c.getPreferredSize().height);
}
setRowHeight(h + getRowMargin());
@@ -129,7 +130,7 @@ public class CommitGraphPane extends JTable {
final TableColumn author = cols.getColumn(1);
final TableColumn date = cols.getColumn(2);

graph.setHeaderValue("");
graph.setHeaderValue(""); //$NON-NLS-1$
author.setHeaderValue(UIText.get().author);
date.setHeaderValue(UIText.get().date);

@@ -186,9 +187,9 @@ public class CommitGraphPane extends JTable {

final String valueStr;
if (pi != null)
valueStr = pi.getName() + " <" + pi.getEmailAddress() + ">";
valueStr = pi.getName() + " <" + pi.getEmailAddress() + ">"; //$NON-NLS-1$ //$NON-NLS-2$
else
valueStr = "";
valueStr = ""; //$NON-NLS-1$
return super.getTableCellRendererComponent(table, valueStr,
isSelected, hasFocus, row, column);
}
@@ -198,7 +199,7 @@ public class CommitGraphPane extends JTable {
private static final long serialVersionUID = 1L;

private final DateFormat fmt = new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss");
"yyyy-MM-dd HH:mm:ss"); //$NON-NLS-1$

public Component getTableCellRendererComponent(final JTable table,
final Object value, final boolean isSelected,
@@ -209,7 +210,7 @@ public class CommitGraphPane extends JTable {
if (pi != null)
valueStr = fmt.format(pi.getWhen());
else
valueStr = "";
valueStr = ""; //$NON-NLS-1$
return super.getTableCellRendererComponent(table, valueStr,
isSelected, hasFocus, row, column);
}

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java View File

@@ -130,7 +130,7 @@ public class AddCommand extends GitCommand<DirCache> {
checkCallable();
DirCache dc = null;
boolean addAll = false;
if (filepatterns.contains("."))
if (filepatterns.contains(".")) //$NON-NLS-1$
addAll = true;

ObjectInserter inserter = repo.newObjectInserter();

+ 3
- 3
org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java View File

@@ -227,14 +227,14 @@ public class ApplyCommand extends GitCommand<ApplyResult> {
}
}
if (!isNoNewlineAtEndOfFile(fh))
newLines.add("");
newLines.add(""); //$NON-NLS-1$
if (!rt.isMissingNewlineAtEnd())
oldLines.add("");
oldLines.add(""); //$NON-NLS-1$
if (!isChanged(oldLines, newLines))
return; // don't touch the file
StringBuilder sb = new StringBuilder();
final String eol = rt.size() == 0
|| (rt.size() == 1 && rt.isMissingNewlineAtEnd()) ? "\n" : rt
|| (rt.size() == 1 && rt.isMissingNewlineAtEnd()) ? "\n" : rt //$NON-NLS-1$
.getLineDelimiter();
for (String l : newLines) {
sb.append(l);

+ 3
- 3
org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java View File

@@ -218,7 +218,7 @@ public class CheckoutCommand extends GitCommand<Ref> {

Ref headRef = repo.getRef(Constants.HEAD);
String shortHeadRef = getShortBranchName(headRef);
String refLogMessage = "checkout: moving from " + shortHeadRef;
String refLogMessage = "checkout: moving from " + shortHeadRef; //$NON-NLS-1$
ObjectId branch = repo.resolve(name);
if (branch == null)
throw new RefNotFoundException(MessageFormat.format(JGitText
@@ -252,7 +252,7 @@ public class CheckoutCommand extends GitCommand<Ref> {
String toName = Repository.shortenRefName(name);
RefUpdate refUpdate = repo.updateRef(Constants.HEAD, ref == null);
refUpdate.setForceUpdate(force);
refUpdate.setRefLogMessage(refLogMessage + " to " + toName, false);
refUpdate.setRefLogMessage(refLogMessage + " to " + toName, false); //$NON-NLS-1$
Result updateResult;
if (ref != null)
updateResult = refUpdate.link(ref.getName());
@@ -469,7 +469,7 @@ public class CheckoutCommand extends GitCommand<Ref> {
&& (name == null || !Repository
.isValidRefName(Constants.R_HEADS + name)))
throw new InvalidRefNameException(MessageFormat.format(JGitText
.get().branchNameInvalid, name == null ? "<null>" : name));
.get().branchNameInvalid, name == null ? "<null>" : name)); //$NON-NLS-1$
}

/**

+ 2
- 2
org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java View File

@@ -148,7 +148,7 @@ public class CherryPickCommand extends GitCommand<CherryPickResult> {

String ourName = calculateOurName(headRef);
String cherryPickName = srcCommit.getId().abbreviate(7).name()
+ " " + srcCommit.getShortMessage();
+ " " + srcCommit.getShortMessage(); //$NON-NLS-1$

ResolveMerger merger = (ResolveMerger) MergeStrategy.RESOLVE
.newMerger(repo);
@@ -168,7 +168,7 @@ public class CherryPickCommand extends GitCommand<CherryPickResult> {
newHead = new Git(getRepository()).commit()
.setMessage(srcCommit.getFullMessage())
.setReflogComment(
"cherry-pick: "
"cherry-pick: " //$NON-NLS-1$
+ srcCommit.getShortMessage())
.setAuthor(srcCommit.getAuthorIdent()).call();
cherryPickedRefs.add(src);

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/api/CleanCommand.java View File

@@ -131,7 +131,7 @@ public class CleanCommand extends GitCommand<Set<String>> {
if (!dryRun)
FileUtils.delete(new File(repo.getWorkTree(), dir),
FileUtils.RECURSIVE);
files.add(dir + "/");
files.add(dir + "/"); //$NON-NLS-1$
}
} catch (IOException e) {
throw new JGitInternalException(e.getMessage(), e);

+ 2
- 1
org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java View File

@@ -158,7 +158,8 @@ public class CloneCommand extends TransportCommand<CloneCommand, Git> {
+ config.getName();
RefSpec refSpec = new RefSpec();
refSpec = refSpec.setForceUpdate(true);
refSpec = refSpec.setSourceDestination(Constants.R_HEADS + "*", dst + "/*"); //$NON-NLS-1$ //$NON-NLS-2$
refSpec = refSpec.setSourceDestination(
Constants.R_HEADS + "*", dst + "/*"); //$NON-NLS-1$ //$NON-NLS-2$

config.addFetchRefSpec(refSpec);
config.update(clonedRepo.getConfig());

+ 12
- 12
org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java View File

@@ -159,7 +159,7 @@ public class CommitCommand extends GitCommand<RevCommit> {
Git git = new Git(repo);
try {
git.add()
.addFilepattern(".")
.addFilepattern(".") //$NON-NLS-1$
.setUpdate(true).call();
} catch (NoFilepatternException e) {
// should really not happen
@@ -173,7 +173,7 @@ public class CommitCommand extends GitCommand<RevCommit> {
JGitText.get().commitOnRepoWithoutHEADCurrentlyNotSupported);

// determine the current HEAD and the commit it is referring to
ObjectId headId = repo.resolve(Constants.HEAD + "^{commit}");
ObjectId headId = repo.resolve(Constants.HEAD + "^{commit}"); //$NON-NLS-1$
if (headId == null && amend)
throw new WrongRepositoryStateException(
JGitText.get().commitAmendOnInitialNotPossible);
@@ -226,7 +226,7 @@ public class CommitCommand extends GitCommand<RevCommit> {
if (reflogComment != null) {
ru.setRefLogMessage(reflogComment, false);
} else {
String prefix = amend ? "commit (amend): "
String prefix = amend ? "commit (amend): " //$NON-NLS-1$
: "commit: ";
ru.setRefLogMessage(
prefix + revCommit.getShortMessage(), false);
@@ -287,9 +287,9 @@ public class CommitCommand extends GitCommand<RevCommit> {
author, committer, message);
message = ChangeIdUtil.insertId(message, changeId);
if (changeId != null)
message = message.replaceAll("\nChange-Id: I"
+ ObjectId.zeroId().getName() + "\n", "\nChange-Id: I"
+ changeId.getName() + "\n");
message = message.replaceAll("\nChange-Id: I" //$NON-NLS-1$
+ ObjectId.zeroId().getName() + "\n", "\nChange-Id: I" //$NON-NLS-1$ //$NON-NLS-2$
+ changeId.getName() + "\n"); //$NON-NLS-1$
}

private DirCache createTemporaryIndex(ObjectId headId, DirCache index)
@@ -455,7 +455,7 @@ public class CommitCommand extends GitCommand<RevCommit> {
while (true) {
if (p.equals(o))
return i;
int l = p.lastIndexOf("/");
int l = p.lastIndexOf("/"); //$NON-NLS-1$
if (l < 1)
break;
p = p.substring(0, l);
@@ -633,8 +633,8 @@ public class CommitCommand extends GitCommand<RevCommit> {
checkCallable();
if (!only.isEmpty())
throw new JGitInternalException(MessageFormat.format(
JGitText.get().illegalCombinationOfArguments, "--all",
"--only"));
JGitText.get().illegalCombinationOfArguments, "--all", //$NON-NLS-1$
"--only")); //$NON-NLS-1$
this.all = all;
return this;
}
@@ -668,9 +668,9 @@ public class CommitCommand extends GitCommand<RevCommit> {
checkCallable();
if (all)
throw new JGitInternalException(MessageFormat.format(
JGitText.get().illegalCombinationOfArguments, "--only",
"--all"));
String o = only.endsWith("/") ? only.substring(0, only.length() - 1)
JGitText.get().illegalCombinationOfArguments, "--only", //$NON-NLS-1$
"--all")); //$NON-NLS-1$
String o = only.endsWith("/") ? only.substring(0, only.length() - 1) //$NON-NLS-1$
: only;
// ignore duplicates
if (!this.only.contains(o))

+ 13
- 13
org.eclipse.jgit/src/org/eclipse/jgit/api/CreateBranchCommand.java View File

@@ -144,7 +144,7 @@ public class CreateBranchCommand extends GitCommand<Ref> {
// determine whether we are based on a commit,
// a branch, or a tag and compose the reflog message
String refLogMessage;
String baseBranch = "";
String baseBranch = ""; //$NON-NLS-1$
if (startPointFullName == null) {
String baseCommit;
if (startCommit != null)
@@ -155,26 +155,26 @@ public class CreateBranchCommand extends GitCommand<Ref> {
baseCommit = commit.getShortMessage();
}
if (exists)
refLogMessage = "branch: Reset start-point to commit "
refLogMessage = "branch: Reset start-point to commit " //$NON-NLS-1$
+ baseCommit;
else
refLogMessage = "branch: Created from commit " + baseCommit;
refLogMessage = "branch: Created from commit " + baseCommit; //$NON-NLS-1$

} else if (startPointFullName.startsWith(Constants.R_HEADS)
|| startPointFullName.startsWith(Constants.R_REMOTES)) {
baseBranch = startPointFullName;
if (exists)
refLogMessage = "branch: Reset start-point to branch "
refLogMessage = "branch: Reset start-point to branch " //$NON-NLS-1$
+ startPointFullName; // TODO
else
refLogMessage = "branch: Created from branch " + baseBranch;
refLogMessage = "branch: Created from branch " + baseBranch; //$NON-NLS-1$
} else {
startAt = revWalk.peel(revWalk.parseAny(startAt));
if (exists)
refLogMessage = "branch: Reset start-point to tag "
refLogMessage = "branch: Reset start-point to tag " //$NON-NLS-1$
+ startPointFullName;
else
refLogMessage = "branch: Created from tag "
refLogMessage = "branch: Created from tag " //$NON-NLS-1$
+ startPointFullName;
}

@@ -233,9 +233,9 @@ public class CreateBranchCommand extends GitCommand<Ref> {
String autosetupflag = repo.getConfig().getString(
ConfigConstants.CONFIG_BRANCH_SECTION, null,
ConfigConstants.CONFIG_KEY_AUTOSETUPMERGE);
if ("false".equals(autosetupflag)) {
if ("false".equals(autosetupflag)) { //$NON-NLS-1$
doConfigure = false;
} else if ("always".equals(autosetupflag)) {
} else if ("always".equals(autosetupflag)) { //$NON-NLS-1$
doConfigure = true;
} else {
// in this case, the default is to configure
@@ -246,8 +246,8 @@ public class CreateBranchCommand extends GitCommand<Ref> {

if (doConfigure) {
StoredConfig config = repo.getConfig();
String[] tokens = baseBranch.split("/", 4);
boolean isRemote = tokens[1].equals("remotes");
String[] tokens = baseBranch.split("/", 4); //$NON-NLS-1$
boolean isRemote = tokens[1].equals("remotes"); //$NON-NLS-1$
if (isRemote) {
// refs/remotes/<remote name>/<branch>
String remoteName = tokens[2];
@@ -262,7 +262,7 @@ public class CreateBranchCommand extends GitCommand<Ref> {
} else {
// set "." as remote
config.setString(ConfigConstants.CONFIG_BRANCH_SECTION,
name, ConfigConstants.CONFIG_KEY_REMOTE, ".");
name, ConfigConstants.CONFIG_KEY_REMOTE, "."); //$NON-NLS-1$
config.setString(ConfigConstants.CONFIG_BRANCH_SECTION,
name, ConfigConstants.CONFIG_KEY_MERGE, baseBranch);
}
@@ -298,7 +298,7 @@ public class CreateBranchCommand extends GitCommand<Ref> {
if (name == null
|| !Repository.isValidRefName(Constants.R_HEADS + name))
throw new InvalidRefNameException(MessageFormat.format(JGitText
.get().branchNameInvalid, name == null ? "<null>" : name));
.get().branchNameInvalid, name == null ? "<null>" : name)); //$NON-NLS-1$
}

/**

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteBranchCommand.java View File

@@ -138,7 +138,7 @@ public class DeleteBranchCommand extends GitCommand<List<String>> {
JGitText.get().cannotDeleteCheckedOutBranch,
branchName));
RefUpdate update = repo.updateRef(fullName);
update.setRefLogMessage("branch deleted", false);
update.setRefLogMessage("branch deleted", false); //$NON-NLS-1$
update.setForceUpdate(true);
Result deleteResult = update.delete();


+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/api/DiffCommand.java View File

@@ -120,7 +120,7 @@ public class DiffCommand extends GitCommand<List<DiffEntry>> {
try {
if (cached) {
if (oldTree == null) {
ObjectId head = repo.resolve(HEAD + "^{tree}");
ObjectId head = repo.resolve(HEAD + "^{tree}"); //$NON-NLS-1$
if (head == null)
throw new NoHeadException(JGitText.get().cannotReadTree);
CanonicalTreeParser p = new CanonicalTreeParser();

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java View File

@@ -80,7 +80,7 @@ public class InitCommand implements Callable<Git> {
d = new File(d, Constants.DOT_GIT);
builder.setGitDir(d);
} else if (builder.getGitDir() == null) {
File d = new File(".");
File d = new File("."); //$NON-NLS-1$
if (d.getParentFile() != null)
d = d.getParentFile();
if (!bare)

+ 2
- 2
org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java View File

@@ -161,9 +161,9 @@ public class LsRemoteCommand extends
Collection<RefSpec> refSpecs = new ArrayList<RefSpec>(1);
if (tags)
refSpecs.add(new RefSpec(
"refs/tags/*:refs/remotes/origin/tags/*"));
"refs/tags/*:refs/remotes/origin/tags/*")); //$NON-NLS-1$
if (heads)
refSpecs.add(new RefSpec("refs/heads/*:refs/remotes/origin/*"));
refSpecs.add(new RefSpec("refs/heads/*:refs/remotes/origin/*")); //$NON-NLS-1$
Collection<Ref> refs;
Map<String, Ref> refmap = new HashMap<String, Ref>();
fc = transport.openFetch();

+ 7
- 7
org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java View File

@@ -151,7 +151,7 @@ public class MergeCommand extends GitCommand<MergeResult> {
if (head == null)
throw new NoHeadException(
JGitText.get().commitOnRepoWithoutHEADCurrentlyNotSupported);
StringBuilder refLogMessage = new StringBuilder("merge ");
StringBuilder refLogMessage = new StringBuilder("merge "); //$NON-NLS-1$

// Check for FAST_FORWARD, ALREADY_UP_TO_DATE
revWalk = new RevWalk(repo);
@@ -179,7 +179,7 @@ public class MergeCommand extends GitCommand<MergeResult> {
.updateRef(head.getTarget().getName());
refUpdate.setNewObjectId(objectId);
refUpdate.setExpectedOldObjectId(null);
refUpdate.setRefLogMessage("initial pull", false);
refUpdate.setRefLogMessage("initial pull", false); //$NON-NLS-1$
if (refUpdate.update() != Result.NEW)
throw new NoHeadException(
JGitText.get().commitOnRepoWithoutHEADCurrentlyNotSupported);
@@ -200,7 +200,7 @@ public class MergeCommand extends GitCommand<MergeResult> {
&& fastForwardMode == FastForwardMode.FF) {
// FAST_FORWARD detected: skip doing a real merge but only
// update HEAD
refLogMessage.append(": " + MergeStatus.FAST_FORWARD);
refLogMessage.append(": " + MergeStatus.FAST_FORWARD); //$NON-NLS-1$
dco = new DirCacheCheckout(repo,
headCommit.getTree(), repo.lockDirCache(),
srcCommit.getTree());
@@ -233,7 +233,7 @@ public class MergeCommand extends GitCommand<MergeResult> {
new ObjectId[] { headCommit, srcCommit },
MergeStatus.ABORTED, mergeStrategy, null, null);
}
String mergeMessage = "";
String mergeMessage = ""; //$NON-NLS-1$
if (!squash) {
mergeMessage = new MergeMessageFormatter().format(
commits, head);
@@ -254,7 +254,7 @@ public class MergeCommand extends GitCommand<MergeResult> {
if (merger instanceof ResolveMerger) {
ResolveMerger resolveMerger = (ResolveMerger) merger;
resolveMerger.setCommitNames(new String[] {
"BASE", "HEAD", ref.getName() });
"BASE", "HEAD", ref.getName() }); //$NON-NLS-1$
resolveMerger.setWorkingTreeIterator(new FileTreeIterator(repo));
noProblems = merger.merge(headCommit, srcCommit);
lowLevelResults = resolveMerger
@@ -263,11 +263,11 @@ public class MergeCommand extends GitCommand<MergeResult> {
unmergedPaths = resolveMerger.getUnmergedPaths();
} else
noProblems = merger.merge(headCommit, srcCommit);
refLogMessage.append(": Merge made by ");
refLogMessage.append(": Merge made by "); //$NON-NLS-1$
if (!revWalk.isMergedInto(headCommit, srcCommit))
refLogMessage.append(mergeStrategy.getName());
else
refLogMessage.append("recursive");
refLogMessage.append("recursive"); //$NON-NLS-1$
refLogMessage.append('.');
if (noProblems) {
dco = new DirCacheCheckout(repo,

+ 1
- 0
org.eclipse.jgit/src/org/eclipse/jgit/api/MergeResult.java View File

@@ -324,6 +324,7 @@ public class MergeResult {
return base;
}

@SuppressWarnings("nls")
@Override
public String toString() {
boolean first = true;

+ 2
- 2
org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java View File

@@ -76,7 +76,7 @@ import org.eclipse.jgit.transport.FetchResult;
*/
public class PullCommand extends TransportCommand<PullCommand, PullResult> {

private final static String DOT = ".";
private final static String DOT = "."; //$NON-NLS-1$

private ProgressMonitor monitor = NullProgressMonitor.INSTANCE;

@@ -218,7 +218,7 @@ public class PullCommand extends TransportCommand<PullCommand, PullResult> {
JGitText.get().missingConfigurationForKey, missingKey));
}

final boolean isRemote = !remote.equals(".");
final boolean isRemote = !remote.equals("."); //$NON-NLS-1$
String remoteUri;
FetchResult fetchRes;
if (isRemote) {

+ 1
- 0
org.eclipse.jgit/src/org/eclipse/jgit/api/PullResult.java View File

@@ -112,6 +112,7 @@ public class PullResult {
return true;
}

@SuppressWarnings("nls")
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

+ 42
- 38
org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java View File

@@ -110,40 +110,40 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
/**
* The name of the "rebase-merge" folder
*/
public static final String REBASE_MERGE = "rebase-merge";
public static final String REBASE_MERGE = "rebase-merge"; //$NON-NLS-1$

/**
* The name of the "stopped-sha" file
*/
public static final String STOPPED_SHA = "stopped-sha";
public static final String STOPPED_SHA = "stopped-sha"; //$NON-NLS-1$

private static final String AUTHOR_SCRIPT = "author-script";
private static final String AUTHOR_SCRIPT = "author-script"; //$NON-NLS-1$

private static final String DONE = "done";
private static final String DONE = "done"; //$NON-NLS-1$

private static final String GIT_AUTHOR_DATE = "GIT_AUTHOR_DATE";
private static final String GIT_AUTHOR_DATE = "GIT_AUTHOR_DATE"; //$NON-NLS-1$

private static final String GIT_AUTHOR_EMAIL = "GIT_AUTHOR_EMAIL";
private static final String GIT_AUTHOR_EMAIL = "GIT_AUTHOR_EMAIL"; //$NON-NLS-1$

private static final String GIT_AUTHOR_NAME = "GIT_AUTHOR_NAME";
private static final String GIT_AUTHOR_NAME = "GIT_AUTHOR_NAME"; //$NON-NLS-1$

private static final String GIT_REBASE_TODO = "git-rebase-todo";
private static final String GIT_REBASE_TODO = "git-rebase-todo"; //$NON-NLS-1$

private static final String HEAD_NAME = "head-name";
private static final String HEAD_NAME = "head-name"; //$NON-NLS-1$

private static final String INTERACTIVE = "interactive";
private static final String INTERACTIVE = "interactive"; //$NON-NLS-1$

private static final String MESSAGE = "message";
private static final String MESSAGE = "message"; //$NON-NLS-1$

private static final String ONTO = "onto";
private static final String ONTO = "onto"; //$NON-NLS-1$

private static final String ONTO_NAME = "onto-name";
private static final String ONTO_NAME = "onto-name"; //$NON-NLS-1$

private static final String PATCH = "patch";
private static final String PATCH = "patch"; //$NON-NLS-1$

private static final String REBASE_HEAD = "head";
private static final String REBASE_HEAD = "head"; //$NON-NLS-1$

private static final String AMEND = "amend";
private static final String AMEND = "amend"; //$NON-NLS-1$

/**
* The available operations
@@ -275,9 +275,9 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
for (Step step : steps) {
sb.setLength(0);
sb.append(step.action.token);
sb.append(" ");
sb.append(" "); //$NON-NLS-1$
sb.append(step.commit.name());
sb.append(" ");
sb.append(" "); //$NON-NLS-1$
sb.append(RawParseUtils.decode(step.shortMessage)
.trim());
fw.write(sb.toString());
@@ -398,7 +398,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
}

private RevCommit checkoutCurrentHead() throws IOException, NoHeadException {
ObjectId headTree = repo.resolve(Constants.HEAD + "^{tree}");
ObjectId headTree = repo.resolve(Constants.HEAD + "^{tree}"); //$NON-NLS-1$
if (headTree == null)
throw new NoHeadException(
JGitText.get().cannotRebaseWithoutCurrentHead);
@@ -442,7 +442,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
treeWalk.reset();
treeWalk.setRecursive(true);
treeWalk.addTree(new DirCacheIterator(dc));
ObjectId id = repo.resolve(Constants.HEAD + "^{tree}");
ObjectId id = repo.resolve(Constants.HEAD + "^{tree}"); //$NON-NLS-1$
if (id == null)
throw new NoHeadException(
JGitText.get().cannotRebaseWithoutCurrentHead);
@@ -496,23 +496,23 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
String toAuthorScript(PersonIdent author) {
StringBuilder sb = new StringBuilder(100);
sb.append(GIT_AUTHOR_NAME);
sb.append("='");
sb.append("='"); //$NON-NLS-1$
sb.append(author.getName());
sb.append("'\n");
sb.append("'\n"); //$NON-NLS-1$
sb.append(GIT_AUTHOR_EMAIL);
sb.append("='");
sb.append("='"); //$NON-NLS-1$
sb.append(author.getEmailAddress());
sb.append("'\n");
sb.append("'\n"); //$NON-NLS-1$
// the command line uses the "external String"
// representation for date and timezone
sb.append(GIT_AUTHOR_DATE);
sb.append("='");
sb.append("@"); // @ for time in seconds since 1970
sb.append("='"); //$NON-NLS-1$
sb.append("@"); // @ for time in seconds since 1970 //$NON-NLS-1$
String externalString = author.toExternalString();
sb
.append(externalString.substring(externalString
.lastIndexOf('>') + 2));
sb.append("'\n");
sb.append("'\n"); //$NON-NLS-1$
return sb.toString();
}

@@ -655,7 +655,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
createFile(rebaseDir, HEAD_NAME, headName);
createFile(rebaseDir, ONTO, upstreamCommit.name());
createFile(rebaseDir, ONTO_NAME, upstreamCommitName);
createFile(rebaseDir, INTERACTIVE, "");
createFile(rebaseDir, INTERACTIVE, ""); //$NON-NLS-1$
BufferedWriter fw = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(new File(rebaseDir, GIT_REBASE_TODO)),
Constants.CHARACTER_ENCODING));
@@ -668,9 +668,9 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
for (RevCommit commit : cherryPickList) {
sb.setLength(0);
sb.append(Action.PICK.toToken());
sb.append(" ");
sb.append(" "); //$NON-NLS-1$
sb.append(reader.abbreviate(commit).name());
sb.append(" ");
sb.append(" "); //$NON-NLS-1$
sb.append(commit.getShortMessage());
fw.write(sb.toString());
fw.newLine();
@@ -747,8 +747,8 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
RefUpdate rup = repo.updateRef(headName);
rup.setExpectedOldObjectId(oldCommit);
rup.setNewObjectId(newCommit);
rup.setRefLogMessage("Fast-foward from " + oldCommit.name()
+ " to " + newCommit.name(), false);
rup.setRefLogMessage("Fast-foward from " + oldCommit.name() //$NON-NLS-1$
+ " to " + newCommit.name(), false); //$NON-NLS-1$
Result res = rup.update(walk);
switch (res) {
case FAST_FORWARD:
@@ -756,7 +756,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
case FORCED:
break;
default:
throw new IOException("Could not fast-forward");
throw new IOException("Could not fast-forward"); //$NON-NLS-1$
}
}
return newCommit;
@@ -1082,11 +1082,11 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
*/
public static enum Action {
/** Use commit */
PICK("pick", "p"),
PICK("pick", "p"), //$NON-NLS-1$ //$NON-NLS-2$
/** Use commit, but edit the commit message */
REWORD("reword", "r"),
REWORD("reword", "r"), //$NON-NLS-1$ //$NON-NLS-2$
/** Use commit, but stop for amending */
EDIT("edit", "e"); // later add SQUASH, FIXUP, etc.
EDIT("edit", "e"); // later add SQUASH, FIXUP, etc. //$NON-NLS-1$ //$NON-NLS-2$

private final String token;

@@ -1104,6 +1104,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
return this.token;
}

@SuppressWarnings("nls")
@Override
public String toString() {
return "Action[" + token + "]";
@@ -1165,9 +1166,12 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
return shortMessage;
}

@SuppressWarnings("nls")
@Override
public String toString() {
return "Step[" + action + ", "
return "Step["
+ action
+ ", "
+ ((commit == null) ? "null" : commit)
+ ", "
+ ((shortMessage == null) ? "null" : new String(
@@ -1199,7 +1203,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {

// the time is saved as <seconds since 1970> <timezone offset>
int timeStart = 0;
if (time.startsWith("@"))
if (time.startsWith("@")) //$NON-NLS-1$
timeStart = 1;
else
timeStart = 0;

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/api/RenameBranchCommand.java View File

@@ -101,7 +101,7 @@ public class RenameBranchCommand extends GitCommand<Ref> {

if (newName == null)
throw new InvalidRefNameException(MessageFormat.format(JGitText
.get().branchNameInvalid, "<null>"));
.get().branchNameInvalid, "<null>")); //$NON-NLS-1$

try {
String fullOldName;

+ 3
- 3
org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java View File

@@ -153,7 +153,7 @@ public class ResetCommand extends GitCommand<Ref> {
// resolve the ref to a commit
final ObjectId commitId;
try {
commitId = repo.resolve(ref + "^{commit}");
commitId = repo.resolve(ref + "^{commit}"); //$NON-NLS-1$
if (commitId == null) {
// @TODO throw an InvalidRefNameException. We can't do that
// now because this would break the API
@@ -253,7 +253,7 @@ public class ResetCommand extends GitCommand<Ref> {
if (!filepaths.isEmpty())
throw new JGitInternalException(MessageFormat.format(
JGitText.get().illegalCombinationOfArguments,
"[--mixed | --soft | --hard]", "<paths>..."));
"[--mixed | --soft | --hard]", "<paths>...")); //$NON-NLS-1$
this.mode = mode;
return this;
}
@@ -267,7 +267,7 @@ public class ResetCommand extends GitCommand<Ref> {
if (mode != null)
throw new JGitInternalException(MessageFormat.format(
JGitText.get().illegalCombinationOfArguments, "<paths>...",
"[--mixed | --soft | --hard]"));
"[--mixed | --soft | --hard]")); //$NON-NLS-1$
filepaths.add(file);
return this;
}

+ 5
- 5
org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java View File

@@ -164,13 +164,13 @@ public class RevertCommand extends GitCommand<RevCommit> {
merger.getResultTreeId());
dco.setFailOnConflict(true);
dco.checkout();
String shortMessage = "Revert \"" + srcCommit.getShortMessage() + "\"";
String newMessage = shortMessage + "\n\n"
+ "This reverts commit "
+ srcCommit.getId().getName() + ".\n";
String shortMessage = "Revert \"" + srcCommit.getShortMessage() + "\""; //$NON-NLS-2$
String newMessage = shortMessage + "\n\n" //$NON-NLS-1$
+ "This reverts commit " //$NON-NLS-1$
+ srcCommit.getId().getName() + ".\n"; //$NON-NLS-1$
newHead = new Git(getRepository()).commit()
.setMessage(newMessage)
.setReflogComment("revert: " + shortMessage).call();
.setReflogComment("revert: " + shortMessage).call(); //$NON-NLS-1$
revertedRefs.add(src);
} else {
unmergedPaths = merger.getUnmergedPaths();

+ 3
- 3
org.eclipse.jgit/src/org/eclipse/jgit/api/StashApplyCommand.java View File

@@ -84,7 +84,7 @@ import org.eclipse.jgit.util.FileUtils;
*/
public class StashApplyCommand extends GitCommand<ObjectId> {

private static final String DEFAULT_REF = Constants.STASH + "@{0}";
private static final String DEFAULT_REF = Constants.STASH + "@{0}"; //$NON-NLS-1$

/**
* Stash diff filter that looks for differences in the first three trees
@@ -115,7 +115,7 @@ public class StashApplyCommand extends GitCommand<ObjectId> {

@Override
public String toString() {
return "STASH_DIFF";
return "STASH_DIFF"; //$NON-NLS-1$
}
}

@@ -192,7 +192,7 @@ public class StashApplyCommand extends GitCommand<ObjectId> {
private ObjectId getHeadTree() throws GitAPIException {
final ObjectId headTree;
try {
headTree = repo.resolve(Constants.HEAD + "^{tree}");
headTree = repo.resolve(Constants.HEAD + "^{tree}"); //$NON-NLS-1$
} catch (IOException e) {
throw new JGitInternalException(JGitText.get().cannotReadTree, e);
}

+ 2
- 2
org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java View File

@@ -120,7 +120,7 @@ public class TagCommand extends GitCommand<Ref> {

// if no id is set, we should attempt to use HEAD
if (id == null) {
ObjectId objectId = repo.resolve(Constants.HEAD + "^{commit}");
ObjectId objectId = repo.resolve(Constants.HEAD + "^{commit}"); //$NON-NLS-1$
if (objectId == null)
throw new NoHeadException(
JGitText.get().tagOnRepoWithoutHEADCurrentlyNotSupported);
@@ -142,7 +142,7 @@ public class TagCommand extends GitCommand<Ref> {
RefUpdate tagRef = repo.updateRef(refName);
tagRef.setNewObjectId(tagId);
tagRef.setForceUpdate(forceUpdate);
tagRef.setRefLogMessage("tagged " + name, false);
tagRef.setRefLogMessage("tagged " + name, false); //$NON-NLS-1$
Result updateResult = tagRef.update(revWalk);
switch (updateResult) {
case NEW:

+ 2
- 2
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/ConcurrentRefUpdateException.java View File

@@ -62,7 +62,7 @@ public class ConcurrentRefUpdateException extends GitAPIException {
*/
public ConcurrentRefUpdateException(String message, Ref ref,
RefUpdate.Result rc, Throwable cause) {
super((rc == null) ? message : message + ". "
super((rc == null) ? message : message + ". " //$NON-NLS-1$
+ MessageFormat.format(JGitText.get().refUpdateReturnCodeWas, rc), cause);
this.rc = rc;
this.ref = ref;
@@ -75,7 +75,7 @@ public class ConcurrentRefUpdateException extends GitAPIException {
*/
public ConcurrentRefUpdateException(String message, Ref ref,
RefUpdate.Result rc) {
super((rc == null) ? message : message + ". "
super((rc == null) ? message : message + ". " //$NON-NLS-1$
+ MessageFormat.format(JGitText.get().refUpdateReturnCodeWas, rc));
this.rc = rc;
this.ref = ref;

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java View File

@@ -177,7 +177,7 @@ public class BlameGenerator {
revPool = new RevWalk(getRepository());

revPool.setRetainBody(true);
SEEN = revPool.newFlag("SEEN");
SEEN = revPool.newFlag("SEEN"); //$NON-NLS-1$
reader = revPool.getObjectReader();
treeWalk = new TreeWalk(reader);
treeWalk.setRecursive(true);

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameResult.java View File

@@ -321,7 +321,7 @@ public class BlameResult {
@Override
public String toString() {
StringBuilder r = new StringBuilder();
r.append("BlameResult: ");
r.append("BlameResult: "); //$NON-NLS-1$
r.append(getResultPath());
return r.toString();
}

+ 3
- 2
org.eclipse.jgit/src/org/eclipse/jgit/blame/Candidate.java View File

@@ -275,6 +275,7 @@ class Candidate {
return r;
}

@SuppressWarnings("nls")
@Override
public String toString() {
StringBuilder r = new StringBuilder();
@@ -324,7 +325,7 @@ class Candidate {

@Override
public String toString() {
return "Reverse" + super.toString();
return "Reverse" + super.toString(); //$NON-NLS-1$
}
}

@@ -380,7 +381,7 @@ class Candidate {

@Override
PersonIdent getAuthor() {
return new PersonIdent(description, "");
return new PersonIdent(description, ""); //$NON-NLS-1$
}
}
}

+ 8
- 8
org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffConfig.java View File

@@ -78,10 +78,10 @@ public class DiffConfig {
private final int renameLimit;

private DiffConfig(final Config rc) {
noPrefix = rc.getBoolean("diff", "noprefix", false);
renameDetectionType = parseRenameDetectionType(rc.getString("diff",
null, "renames"));
renameLimit = rc.getInt("diff", "renamelimit", 200);
noPrefix = rc.getBoolean("diff", "noprefix", false); //$NON-NLS-1$ //$NON-NLS-2$
renameDetectionType = parseRenameDetectionType(rc.getString("diff", //$NON-NLS-1$
null, "renames")); //$NON-NLS-1$
renameLimit = rc.getInt("diff", "renamelimit", 200); //$NON-NLS-1$ //$NON-NLS-2$
}

/** @return true if the prefix "a/" and "b/" should be suppressed. */
@@ -108,16 +108,16 @@ public class DiffConfig {
final String renameString) {
if (renameString == null)
return RenameDetectionType.FALSE;
else if (StringUtils.equalsIgnoreCase("copy", renameString)
|| StringUtils.equalsIgnoreCase("copies", renameString))
else if (StringUtils.equalsIgnoreCase("copy", renameString) //$NON-NLS-1$
|| StringUtils.equalsIgnoreCase("copies", renameString)) //$NON-NLS-1$
return RenameDetectionType.COPY;
else {
final Boolean renameBoolean = StringUtils
.toBooleanOrNull(renameString);
if (renameBoolean == null)
throw new IllegalArgumentException(MessageFormat.format(
JGitText.get().enumValueNotSupported2, "diff",
"renames", renameString));
JGitText.get().enumValueNotSupported2, "diff", //$NON-NLS-1$
"renames", renameString)); //$NON-NLS-1$
else if (renameBoolean.booleanValue())
return RenameDetectionType.TRUE;
else

+ 2
- 1
org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffEntry.java View File

@@ -63,7 +63,7 @@ public class DiffEntry {
.fromObjectId(ObjectId.zeroId());

/** Magical file name used for file adds or deletes. */
public static final String DEV_NULL = "/dev/null";
public static final String DEV_NULL = "/dev/null"; //$NON-NLS-1$

/** General type of change a single file-level patch describes. */
public static enum ChangeType {
@@ -407,6 +407,7 @@ public class DiffEntry {
return side == Side.OLD ? getOldId() : getNewId();
}

@SuppressWarnings("nls")
@Override
public String toString() {
StringBuilder buf = new StringBuilder();

+ 28
- 28
org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java View File

@@ -105,7 +105,7 @@ import org.eclipse.jgit.util.io.DisabledOutputStream;
public class DiffFormatter {
private static final int DEFAULT_BINARY_FILE_THRESHOLD = PackConfig.DEFAULT_BIG_FILE_THRESHOLD;

private static final byte[] noNewLine = encodeASCII("\\ No newline at end of file\n");
private static final byte[] noNewLine = encodeASCII("\\ No newline at end of file\n"); //$NON-NLS-1$

/** Magic return content indicating it is empty or no content present. */
private static final byte[] EMPTY = new byte[] {};
@@ -129,9 +129,9 @@ public class DiffFormatter {

private int binaryFileThreshold = DEFAULT_BINARY_FILE_THRESHOLD;

private String oldPrefix = "a/";
private String oldPrefix = "a/"; //$NON-NLS-1$

private String newPrefix = "b/";
private String newPrefix = "b/"; //$NON-NLS-1$

private TreeFilter pathFilter = TreeFilter.ALL;

@@ -179,8 +179,8 @@ public class DiffFormatter {

DiffConfig dc = db.getConfig().get(DiffConfig.KEY);
if (dc.isNoPrefix()) {
setOldPrefix("");
setNewPrefix("");
setOldPrefix(""); //$NON-NLS-1$
setNewPrefix(""); //$NON-NLS-1$
}
setDetectRenames(dc.isRenameDetectionEnabled());

@@ -633,12 +633,12 @@ public class DiffFormatter {
private void writeGitLinkDiffText(OutputStream o, DiffEntry ent)
throws IOException {
if (ent.getOldMode() == GITLINK) {
o.write(encodeASCII("-Subproject commit " + ent.getOldId().name()
+ "\n"));
o.write(encodeASCII("-Subproject commit " + ent.getOldId().name() //$NON-NLS-1$
+ "\n")); //$NON-NLS-1$
}
if (ent.getNewMode() == GITLINK) {
o.write(encodeASCII("+Subproject commit " + ent.getNewId().name()
+ "\n"));
o.write(encodeASCII("+Subproject commit " + ent.getNewId().name() //$NON-NLS-1$
+ "\n")); //$NON-NLS-1$
}
}

@@ -918,7 +918,7 @@ public class DiffFormatter {
if (aRaw == BINARY || bRaw == BINARY //
|| RawText.isBinary(aRaw) || RawText.isBinary(bRaw)) {
formatOldNewPaths(buf, ent);
buf.write(encodeASCII("Binary files differ\n"));
buf.write(encodeASCII("Binary files differ\n")); //$NON-NLS-1$
editList = new EditList();
type = PatchType.BINARY;

@@ -1016,7 +1016,7 @@ public class DiffFormatter {
final FileMode oldMode = ent.getOldMode();
final FileMode newMode = ent.getNewMode();

o.write(encodeASCII("diff --git "));
o.write(encodeASCII("diff --git ")); //$NON-NLS-1$
o.write(encode(quotePath(oldPrefix + (type == ADD ? newp : oldp))));
o.write(' ');
o.write(encode(quotePath(newPrefix + (type == DELETE ? oldp : newp))));
@@ -1024,40 +1024,40 @@ public class DiffFormatter {

switch (type) {
case ADD:
o.write(encodeASCII("new file mode "));
o.write(encodeASCII("new file mode ")); //$NON-NLS-1$
newMode.copyTo(o);
o.write('\n');
break;

case DELETE:
o.write(encodeASCII("deleted file mode "));
o.write(encodeASCII("deleted file mode ")); //$NON-NLS-1$
oldMode.copyTo(o);
o.write('\n');
break;

case RENAME:
o.write(encodeASCII("similarity index " + ent.getScore() + "%"));
o.write(encodeASCII("similarity index " + ent.getScore() + "%")); //$NON-NLS-1$ //$NON-NLS-2$
o.write('\n');

o.write(encode("rename from " + quotePath(oldp)));
o.write(encode("rename from " + quotePath(oldp))); //$NON-NLS-1$
o.write('\n');

o.write(encode("rename to " + quotePath(newp)));
o.write(encode("rename to " + quotePath(newp))); //$NON-NLS-1$
o.write('\n');
break;

case COPY:
o.write(encodeASCII("similarity index " + ent.getScore() + "%"));
o.write(encodeASCII("similarity index " + ent.getScore() + "%")); //$NON-NLS-1$ //$NON-NLS-2$
o.write('\n');

o.write(encode("copy from " + quotePath(oldp)));
o.write(encode("copy from " + quotePath(oldp))); //$NON-NLS-1$
o.write('\n');

o.write(encode("copy to " + quotePath(newp)));
o.write(encode("copy to " + quotePath(newp))); //$NON-NLS-1$
o.write('\n');

if (!oldMode.equals(newMode)) {
o.write(encodeASCII("new file mode "));
o.write(encodeASCII("new file mode ")); //$NON-NLS-1$
newMode.copyTo(o);
o.write('\n');
}
@@ -1065,19 +1065,19 @@ public class DiffFormatter {

case MODIFY:
if (0 < ent.getScore()) {
o.write(encodeASCII("dissimilarity index "
+ (100 - ent.getScore()) + "%"));
o.write(encodeASCII("dissimilarity index " //$NON-NLS-1$
+ (100 - ent.getScore()) + "%")); //$NON-NLS-1$
o.write('\n');
}
break;
}

if ((type == MODIFY || type == RENAME) && !oldMode.equals(newMode)) {
o.write(encodeASCII("old mode "));
o.write(encodeASCII("old mode ")); //$NON-NLS-1$
oldMode.copyTo(o);
o.write('\n');

o.write(encodeASCII("new mode "));
o.write(encodeASCII("new mode ")); //$NON-NLS-1$
newMode.copyTo(o);
o.write('\n');
}
@@ -1097,9 +1097,9 @@ public class DiffFormatter {
*/
protected void formatIndexLine(OutputStream o, DiffEntry ent)
throws IOException {
o.write(encodeASCII("index " //
o.write(encodeASCII("index " // //$NON-NLS-1$
+ format(ent.getOldId()) //
+ ".." //
+ ".." // //$NON-NLS-1$
+ format(ent.getNewId())));
if (ent.getOldMode().equals(ent.getNewMode())) {
o.write(' ');
@@ -1133,8 +1133,8 @@ public class DiffFormatter {
break;
}

o.write(encode("--- " + oldp + "\n"));
o.write(encode("+++ " + newp + "\n"));
o.write(encode("--- " + oldp + "\n")); //$NON-NLS-1$ //$NON-NLS-2$
o.write(encode("+++ " + newp + "\n")); //$NON-NLS-1$ //$NON-NLS-2$
}

private int findCombinedEnd(final List<Edit> edits, final int i) {

+ 1
- 0
org.eclipse.jgit/src/org/eclipse/jgit/diff/Edit.java View File

@@ -233,6 +233,7 @@ public class Edit {
return false;
}

@SuppressWarnings("nls")
@Override
public String toString() {
final Type t = getType();

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/diff/EditList.java View File

@@ -80,6 +80,6 @@ public class EditList extends ArrayList<Edit> {

@Override
public String toString() {
return "EditList" + super.toString();
return "EditList" + super.toString(); //$NON-NLS-1$
}
}

+ 3
- 3
org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java View File

@@ -181,7 +181,7 @@ public class RawText extends Sequence {
*/
public String getString(int begin, int end, boolean dropLF) {
if (begin == end)
return "";
return ""; //$NON-NLS-1$

int s = getStart(begin);
int e = getEnd(end - 1);
@@ -290,8 +290,8 @@ public class RawText extends Sequence {
if (content[e - 1] != '\n')
return null;
if (content.length > 1 && content[e - 2] == '\r')
return "\r\n";
return "\r\n"; //$NON-NLS-1$
else
return "\n";
return "\n"; //$NON-NLS-1$
}
}

+ 2
- 2
org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java View File

@@ -320,8 +320,8 @@ class SimilarityRenameDetector {
}

static int nameScore(String a, String b) {
int aDirLen = a.lastIndexOf("/") + 1;
int bDirLen = b.lastIndexOf("/") + 1;
int aDirLen = a.lastIndexOf("/") + 1; //$NON-NLS-1$
int bDirLen = b.lastIndexOf("/") + 1; //$NON-NLS-1$

int dirMin = Math.min(aDirLen, bDirLen);
int dirMax = Math.max(aDirLen, bDirLen);

+ 3
- 3
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java View File

@@ -555,7 +555,7 @@ public class DirCache {

private static String formatExtensionName(final byte[] hdr)
throws UnsupportedEncodingException {
return "'" + new String(hdr, 0, 4, "ISO-8859-1") + "'";
return "'" + new String(hdr, 0, 4, "ISO-8859-1") + "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}

private static boolean is_DIRC(final byte[] hdr) {
@@ -855,8 +855,8 @@ public class DirCache {
System.arraycopy(sortedEntries, 0, r, 0, sortedEntries.length);
return r;
}
if (!path.endsWith("/"))
path += "/";
if (!path.endsWith("/")) //$NON-NLS-1$
path += "/"; //$NON-NLS-1$
final byte[] p = Constants.encode(path);
final int pLen = p.length;


+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheBuilder.java View File

@@ -244,7 +244,7 @@ public class DirCacheBuilder extends BaseDirCacheEditor {

private static IllegalStateException bad(final DirCacheEntry a,
final String msg) {
return new IllegalStateException(msg + ": " + a.getStage() + " "
return new IllegalStateException(msg + ": " + a.getStage() + " " //$NON-NLS-1$ //$NON-NLS-2$
+ a.getPathString());
}
}

+ 6
- 6
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java View File

@@ -417,7 +417,7 @@ public class DirCacheCheckout {
builder.finish();

File file = null;
String last = "";
String last = ""; //$NON-NLS-1$
// when deleting files process them in the opposite order as they have
// been reported. This ensures the files are deleted before we delete
// their parent folders
@@ -965,7 +965,7 @@ public class DirCacheCheckout {
ObjectLoader ol = or.open(entry.getObjectId());
File parentDir = f.getParentFile();
parentDir.mkdirs();
File tmpFile = File.createTempFile("._" + f.getName(), null, parentDir);
File tmpFile = File.createTempFile("._" + f.getName(), null, parentDir); //$NON-NLS-1$
WorkingTreeOptions opt = repo.getConfig().get(WorkingTreeOptions.KEY);
FileOutputStream rawChannel = new FileOutputStream(tmpFile);
OutputStream channel;
@@ -1007,10 +1007,10 @@ public class DirCacheCheckout {

private static byte[][] forbidden;
static {
String[] list = new String[] { "AUX", "COM1", "COM2", "COM3", "COM4",
"COM5", "COM6", "COM7", "COM8", "COM9", "CON", "LPT1", "LPT2",
"LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9", "NUL",
"PRN" };
String[] list = new String[] { "AUX", "COM1", "COM2", "COM3", "COM4", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
"COM5", "COM6", "COM7", "COM8", "COM9", "CON", "LPT1", "LPT2", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
"LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9", "NUL", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
"PRN" }; //$NON-NLS-1$
forbidden = new byte[list.length][];
for (int i = 0; i < list.length; ++i)
forbidden[i] = Constants.encodeASCII(list[i]);

+ 1
- 0
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java View File

@@ -637,6 +637,7 @@ public class DirCacheEntry {
/**
* Use for debugging only !
*/
@SuppressWarnings("nls")
@Override
public String toString() {
return getFileMode() + " " + getLength() + " " + getLastModified()

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/errors/CheckoutConflictException.java View File

@@ -77,7 +77,7 @@ public class CheckoutConflictException extends IOException {
private static String buildList(String[] files) {
StringBuilder builder = new StringBuilder();
for (String f : files) {
builder.append("\n");
builder.append("\n"); //$NON-NLS-1$
builder.append(f);
}
return builder.toString();

+ 2
- 2
org.eclipse.jgit/src/org/eclipse/jgit/errors/CompoundException.java View File

@@ -58,9 +58,9 @@ public class CompoundException extends Exception {
final StringBuilder msg = new StringBuilder();
msg.append(JGitText.get().failureDueToOneOfTheFollowing);
for (final Throwable c : causes) {
msg.append(" ");
msg.append(" "); //$NON-NLS-1$
msg.append(c.getMessage());
msg.append("\n");
msg.append("\n"); //$NON-NLS-1$
}
return msg.toString();
}

+ 3
- 3
org.eclipse.jgit/src/org/eclipse/jgit/errors/InvalidObjectIdException.java View File

@@ -69,11 +69,11 @@ public class InvalidObjectIdException extends IllegalArgumentException {

private static String asAscii(byte[] bytes, int offset, int length) {
try {
return ": " + new String(bytes, offset, length, "US-ASCII");
return ": " + new String(bytes, offset, length, "US-ASCII"); //$NON-NLS-1$ //$NON-NLS-2$
} catch (UnsupportedEncodingException e2) {
return "";
return ""; //$NON-NLS-1$
} catch (StringIndexOutOfBoundsException e2) {
return "";
return ""; //$NON-NLS-1$
}
}
}

+ 2
- 2
org.eclipse.jgit/src/org/eclipse/jgit/errors/MissingBundlePrerequisiteException.java View File

@@ -60,10 +60,10 @@ public class MissingBundlePrerequisiteException extends TransportException {
final StringBuilder r = new StringBuilder();
r.append(JGitText.get().missingPrerequisiteCommits);
for (final Map.Entry<ObjectId, String> e : missingCommits.entrySet()) {
r.append("\n ");
r.append("\n "); //$NON-NLS-1$
r.append(e.getKey().name());
if (e.getValue() != null)
r.append(" ").append(e.getValue());
r.append(" ").append(e.getValue()); //$NON-NLS-1$
}
return r.toString();
}

+ 2
- 2
org.eclipse.jgit/src/org/eclipse/jgit/errors/PackProtocolException.java View File

@@ -63,7 +63,7 @@ public class PackProtocolException extends TransportException {
* message
*/
public PackProtocolException(final URIish uri, final String s) {
super(uri + ": " + s);
super(uri + ": " + s); //$NON-NLS-1$
}

/**
@@ -79,7 +79,7 @@ public class PackProtocolException extends TransportException {
*/
public PackProtocolException(final URIish uri, final String s,
final Throwable cause) {
this(uri + ": " + s, cause);
this(uri + ": " + s, cause); //$NON-NLS-1$
}

/**

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/errors/RevisionSyntaxException.java View File

@@ -79,6 +79,6 @@ public class RevisionSyntaxException extends IllegalArgumentException {

@Override
public String toString() {
return super.toString() + ":" + revstr;
return super.toString() + ":" + revstr; //$NON-NLS-1$
}
}

+ 2
- 2
org.eclipse.jgit/src/org/eclipse/jgit/errors/TranslationBundleLoadingException.java View File

@@ -65,8 +65,8 @@ public class TranslationBundleLoadingException extends TranslationBundleExceptio
* {@link ResourceBundle#getBundle(String, Locale)} method.
*/
public TranslationBundleLoadingException(Class bundleClass, Locale locale, Exception cause) {
super("Loading of translation bundle failed for ["
+ bundleClass.getName() + ", " + locale.toString() + "]",
super("Loading of translation bundle failed for [" //$NON-NLS-1$
+ bundleClass.getName() + ", " + locale.toString() + "]", //$NON-NLS-1$ //$NON-NLS-2$
bundleClass, locale, cause);
}
}

+ 2
- 2
org.eclipse.jgit/src/org/eclipse/jgit/errors/TranslationStringMissingException.java View File

@@ -69,8 +69,8 @@ public class TranslationStringMissingException extends TranslationBundleExceptio
* {@link ResourceBundle#getString(String)} method.
*/
public TranslationStringMissingException(Class bundleClass, Locale locale, String key, Exception cause) {
super("Translation missing for [" + bundleClass.getName() + ", "
+ locale.toString() + ", " + key + "]", bundleClass, locale,
super("Translation missing for [" + bundleClass.getName() + ", " //$NON-NLS-1$ //$NON-NLS-2$
+ locale.toString() + ", " + key + "]", bundleClass, locale, //$NON-NLS-1$ //$NON-NLS-2$
cause);
this.key = key;
}

+ 2
- 2
org.eclipse.jgit/src/org/eclipse/jgit/errors/TransportException.java View File

@@ -65,7 +65,7 @@ public class TransportException extends IOException {
* message
*/
public TransportException(final URIish uri, final String s) {
super(uri.setPass(null) + ": " + s);
super(uri.setPass(null) + ": " + s); //$NON-NLS-1$
}

/**
@@ -81,7 +81,7 @@ public class TransportException extends IOException {
*/
public TransportException(final URIish uri, final String s,
final Throwable cause) {
this(uri.setPass(null) + ": " + s, cause);
this(uri.setPass(null) + ": " + s, cause); //$NON-NLS-1$
}

/**

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/errors/UnsupportedCredentialItem.java View File

@@ -64,6 +64,6 @@ public class UnsupportedCredentialItem extends RuntimeException {
* message
*/
public UnsupportedCredentialItem(final URIish uri, final String s) {
super(uri.setPass(null) + ": " + s);
super(uri.setPass(null) + ": " + s); //$NON-NLS-1$
}
}

+ 1
- 0
org.eclipse.jgit/src/org/eclipse/jgit/events/ListenerHandle.java View File

@@ -64,6 +64,7 @@ public class ListenerHandle {
parent.remove(this);
}

@SuppressWarnings("nls")
@Override
public String toString() {
return type.getSimpleName() + "[" + listener + "]";

+ 1
- 0
org.eclipse.jgit/src/org/eclipse/jgit/events/RepositoryEvent.java View File

@@ -85,6 +85,7 @@ public abstract class RepositoryEvent<T extends RepositoryListener> {
*/
public abstract void dispatch(T listener);

@SuppressWarnings("nls")
@Override
public String toString() {
String type = getClass().getSimpleName();

+ 5
- 5
org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/FileNameMatcher.java View File

@@ -86,7 +86,7 @@ public class FileNameMatcher {
static final List<Head> EMPTY_HEAD_LIST = Collections.emptyList();

private static final Pattern characterClassStartPattern = Pattern
.compile("\\[[.:=]");
.compile("\\[[.:=]"); //$NON-NLS-1$

private List<Head> headsStartValue;

@@ -185,7 +185,7 @@ public class FileNameMatcher {
int firstValidEndBracketIndex = indexOfStartBracket + 2;

if (indexOfStartBracket + 1 >= pattern.length())
throw new NoClosingBracketException(indexOfStartBracket, "[", "]",
throw new NoClosingBracketException(indexOfStartBracket, "[", "]", //$NON-NLS-1$ //$NON-NLS-2$
pattern);

if (pattern.charAt(firstValidCharClassIndex) == '!') {
@@ -202,8 +202,8 @@ public class FileNameMatcher {
final int possibleGroupEnd = pattern.indexOf(']',
firstValidEndBracketIndex);
if (possibleGroupEnd == -1)
throw new NoClosingBracketException(indexOfStartBracket, "[",
"]", pattern);
throw new NoClosingBracketException(indexOfStartBracket, "[", //$NON-NLS-1$
"]", pattern); //$NON-NLS-1$

final boolean foundCharClass = charClassStartMatcher
.find(firstValidCharClassIndex);
@@ -212,7 +212,7 @@ public class FileNameMatcher {
&& charClassStartMatcher.start() < possibleGroupEnd) {

final String classStart = charClassStartMatcher.group(0);
final String classEnd = classStart.charAt(1) + "]";
final String classEnd = classStart.charAt(1) + "]"; //$NON-NLS-1$

final int classStartIndex = charClassStartMatcher.start();
final int classEndIndex = pattern.indexOf(classEnd,

+ 17
- 17
org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java View File

@@ -57,7 +57,7 @@ final class GroupHead extends AbstractHead {
private final List<CharacterPattern> characterClasses;

private static final Pattern REGEX_PATTERN = Pattern
.compile("([^-][-][^-]|\\[[.:=].*?[.:=]\\])");
.compile("([^-][-][^-]|\\[[.:=].*?[.:=]\\])"); //$NON-NLS-1$

private final boolean inverse;

@@ -65,7 +65,7 @@ final class GroupHead extends AbstractHead {
throws InvalidPatternException {
super(false);
this.characterClasses = new ArrayList<CharacterPattern>();
this.inverse = pattern.startsWith("!");
this.inverse = pattern.startsWith("!"); //$NON-NLS-1$
if (inverse) {
pattern = pattern.substring(1);
}
@@ -76,40 +76,40 @@ final class GroupHead extends AbstractHead {
final char start = characterClass.charAt(0);
final char end = characterClass.charAt(2);
characterClasses.add(new CharacterRange(start, end));
} else if (characterClass.equals("[:alnum:]")) {
} else if (characterClass.equals("[:alnum:]")) { //$NON-NLS-1$
characterClasses.add(LetterPattern.INSTANCE);
characterClasses.add(DigitPattern.INSTANCE);
} else if (characterClass.equals("[:alpha:]")) {
} else if (characterClass.equals("[:alpha:]")) { //$NON-NLS-1$
characterClasses.add(LetterPattern.INSTANCE);
} else if (characterClass.equals("[:blank:]")) {
} else if (characterClass.equals("[:blank:]")) { //$NON-NLS-1$
characterClasses.add(new OneCharacterPattern(' '));
characterClasses.add(new OneCharacterPattern('\t'));
} else if (characterClass.equals("[:cntrl:]")) {
} else if (characterClass.equals("[:cntrl:]")) { //$NON-NLS-1$
characterClasses.add(new CharacterRange('\u0000', '\u001F'));
characterClasses.add(new OneCharacterPattern('\u007F'));
} else if (characterClass.equals("[:digit:]")) {
} else if (characterClass.equals("[:digit:]")) { //$NON-NLS-1$
characterClasses.add(DigitPattern.INSTANCE);
} else if (characterClass.equals("[:graph:]")) {
} else if (characterClass.equals("[:graph:]")) { //$NON-NLS-1$
characterClasses.add(new CharacterRange('\u0021', '\u007E'));
characterClasses.add(LetterPattern.INSTANCE);
characterClasses.add(DigitPattern.INSTANCE);
} else if (characterClass.equals("[:lower:]")) {
} else if (characterClass.equals("[:lower:]")) { //$NON-NLS-1$
characterClasses.add(LowerPattern.INSTANCE);
} else if (characterClass.equals("[:print:]")) {
} else if (characterClass.equals("[:print:]")) { //$NON-NLS-1$
characterClasses.add(new CharacterRange('\u0020', '\u007E'));
characterClasses.add(LetterPattern.INSTANCE);
characterClasses.add(DigitPattern.INSTANCE);
} else if (characterClass.equals("[:punct:]")) {
} else if (characterClass.equals("[:punct:]")) { //$NON-NLS-1$
characterClasses.add(PunctPattern.INSTANCE);
} else if (characterClass.equals("[:space:]")) {
} else if (characterClass.equals("[:space:]")) { //$NON-NLS-1$
characterClasses.add(WhitespacePattern.INSTANCE);
} else if (characterClass.equals("[:upper:]")) {
} else if (characterClass.equals("[:upper:]")) { //$NON-NLS-1$
characterClasses.add(UpperPattern.INSTANCE);
} else if (characterClass.equals("[:xdigit:]")) {
} else if (characterClass.equals("[:xdigit:]")) { //$NON-NLS-1$
characterClasses.add(new CharacterRange('0', '9'));
characterClasses.add(new CharacterRange('a', 'f'));
characterClasses.add(new CharacterRange('A', 'F'));
} else if (characterClass.equals("[:word:]")) {
} else if (characterClass.equals("[:word:]")) { //$NON-NLS-1$
characterClasses.add(new OneCharacterPattern('_'));
characterClasses.add(LetterPattern.INSTANCE);
characterClasses.add(DigitPattern.INSTANCE);
@@ -120,7 +120,7 @@ final class GroupHead extends AbstractHead {
throw new InvalidPatternException(message, wholePattern);
}

pattern = matcher.replaceFirst("");
pattern = matcher.replaceFirst(""); //$NON-NLS-1$
matcher.reset(pattern);
}
// pattern contains now no ranges
@@ -219,7 +219,7 @@ final class GroupHead extends AbstractHead {
private static final class PunctPattern implements CharacterPattern {
static final GroupHead.PunctPattern INSTANCE = new PunctPattern();

private static String punctCharacters = "-!\"#$%&'()*+,./:;<=>?@[\\]_`{|}~";
private static String punctCharacters = "-!\"#$%&'()*+,./:;<=>?@[\\]_`{|}~"; //$NON-NLS-1$

public boolean matches(char c) {
return punctCharacters.indexOf(c) != -1;

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreNode.java View File

@@ -102,7 +102,7 @@ public class IgnoreNode {
String txt;
while ((txt = br.readLine()) != null) {
txt = txt.trim();
if (txt.length() > 0 && !txt.startsWith("#"))
if (txt.length() > 0 && !txt.startsWith("#")) //$NON-NLS-1$
rules.add(new IgnoreRule(txt));
}
}

+ 12
- 12
org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreRule.java View File

@@ -82,28 +82,28 @@ public class IgnoreRule {
private void setup() {
int startIndex = 0;
int endIndex = pattern.length();
if (pattern.startsWith("!")) {
if (pattern.startsWith("!")) { //$NON-NLS-1$
startIndex++;
negation = true;
}

if (pattern.endsWith("/")) {
if (pattern.endsWith("/")) { //$NON-NLS-1$
endIndex --;
dirOnly = true;
}

pattern = pattern.substring(startIndex, endIndex);
boolean hasSlash = pattern.contains("/");
boolean hasSlash = pattern.contains("/"); //$NON-NLS-1$

if (!hasSlash)
nameOnly = true;
else if (!pattern.startsWith("/")) {
else if (!pattern.startsWith("/")) { //$NON-NLS-1$
//Contains "/" but does not start with one
//Adding / to the start should not interfere with matching
pattern = "/" + pattern;
pattern = "/" + pattern; //$NON-NLS-1$
}

if (pattern.contains("*") || pattern.contains("?") || pattern.contains("[")) {
if (pattern.contains("*") || pattern.contains("?") || pattern.contains("[")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
try {
matcher = new FileNameMatcher(pattern, Character.valueOf('/'));
} catch (InvalidPatternException e) {
@@ -164,8 +164,8 @@ public class IgnoreRule {
* the target is ignored. Call {@link IgnoreRule#getResult() getResult()} for the result.
*/
public boolean isMatch(String target, boolean isDirectory) {
if (!target.startsWith("/"))
target = "/" + target;
if (!target.startsWith("/")) //$NON-NLS-1$
target = "/" + target; //$NON-NLS-1$

if (matcher == null) {
if (target.equals(pattern)) {
@@ -183,12 +183,12 @@ public class IgnoreRule {
* "/src/new" to /src/newfile" but allows "/src/new" to match
* "/src/new/newfile", as is the git standard
*/
if ((target).startsWith(pattern + "/"))
if ((target).startsWith(pattern + "/")) //$NON-NLS-1$
return true;

if (nameOnly) {
//Iterate through each sub-name
final String[] segments = target.split("/");
final String[] segments = target.split("/"); //$NON-NLS-1$
for (int idx = 0; idx < segments.length; idx++) {
final String segmentName = segments[idx];
if (segmentName.equals(pattern) &&
@@ -202,7 +202,7 @@ public class IgnoreRule {
if (matcher.isMatch())
return true;

final String[] segments = target.split("/");
final String[] segments = target.split("/"); //$NON-NLS-1$
if (nameOnly) {
for (int idx = 0; idx < segments.length; idx++) {
final String segmentName = segments[idx];
@@ -220,7 +220,7 @@ public class IgnoreRule {
for (int idx = 0; idx < segments.length; idx++) {
final String segmentName = segments[idx];
if (segmentName.length() > 0) {
matcher.append("/" + segmentName);
matcher.append("/" + segmentName); //$NON-NLS-1$
}

if (matcher.isMatch() &&

+ 2
- 1
org.eclipse.jgit/src/org/eclipse/jgit/lib/AbbreviatedObjectId.java View File

@@ -375,8 +375,9 @@ public final class AbbreviatedObjectId implements Serializable {
return new String(b, 0, nibbles);
}

@SuppressWarnings("nls")
@Override
public String toString() {
return "AbbreviatedObjectId[" + name() + "]";
return "AbbreviatedObjectId[" + name() + "]"; //$NON-NLS-1$
}
}

+ 1
- 0
org.eclipse.jgit/src/org/eclipse/jgit/lib/AnyObjectId.java View File

@@ -489,6 +489,7 @@ public abstract class AnyObjectId implements Comparable<Object> {
dst[o--] = '0';
}

@SuppressWarnings("nls")
@Override
public String toString() {
return "AnyObjectId[" + name() + "]";

+ 3
- 3
org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java View File

@@ -487,7 +487,7 @@ public class BaseRepositoryBuilder<B extends BaseRepositoryBuilder, R extends Re
*/
public B findGitDir() {
if (getGitDir() == null)
findGitDir(new File("").getAbsoluteFile());
findGitDir(new File("").getAbsoluteFile()); //$NON-NLS-1$
return self();
}

@@ -628,7 +628,7 @@ public class BaseRepositoryBuilder<B extends BaseRepositoryBuilder, R extends Re
if (getGitDir() == null)
setGitDir(getWorkTree().getParentFile());
if (getIndexFile() == null)
setIndexFile(new File(getGitDir(), "index"));
setIndexFile(new File(getGitDir(), "index")); //$NON-NLS-1$
}
}

@@ -640,7 +640,7 @@ public class BaseRepositoryBuilder<B extends BaseRepositoryBuilder, R extends Re
*/
protected void setupInternals() throws IOException {
if (getObjectDirectory() == null && getGitDir() != null)
setObjectDirectory(safeFS().resolve(getGitDir(), "objects"));
setObjectDirectory(safeFS().resolve(getGitDir(), "objects")); //$NON-NLS-1$
}

/**

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java View File

@@ -168,7 +168,7 @@ public class BatchRefUpdate {
if (msg == null && !appendStatus)
disableRefLog();
else if (msg == null && appendStatus) {
refLogMessage = "";
refLogMessage = ""; //$NON-NLS-1$
refLogIncludeResult = true;
} else {
refLogMessage = msg;

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchingProgressMonitor.java View File

@@ -69,7 +69,7 @@ public abstract class BatchingProgressMonitor implements ProgressMonitor {

public Thread newThread(Runnable taskBody) {
Thread thr = baseFactory.newThread(taskBody);
thr.setName("JGit-AlarmQueue");
thr.setName("JGit-AlarmQueue"); //$NON-NLS-1$
thr.setDaemon(true);
return thr;
}

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/lib/BranchConfig.java View File

@@ -81,7 +81,7 @@ public class BranchConfig {
if (remote == null || mergeRef == null)
return null;

if (remote.equals("."))
if (remote.equals(".")) //$NON-NLS-1$
return mergeRef;

return findRemoteTrackingBranch(remote, mergeRef);

+ 6
- 5
org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java View File

@@ -66,15 +66,15 @@ import java.util.List;
public class CommitBuilder {
private static final ObjectId[] EMPTY_OBJECTID_LIST = new ObjectId[0];

private static final byte[] htree = Constants.encodeASCII("tree");
private static final byte[] htree = Constants.encodeASCII("tree"); //$NON-NLS-1$

private static final byte[] hparent = Constants.encodeASCII("parent");
private static final byte[] hparent = Constants.encodeASCII("parent"); //$NON-NLS-1$

private static final byte[] hauthor = Constants.encodeASCII("author");
private static final byte[] hauthor = Constants.encodeASCII("author"); //$NON-NLS-1$

private static final byte[] hcommitter = Constants.encodeASCII("committer");
private static final byte[] hcommitter = Constants.encodeASCII("committer"); //$NON-NLS-1$

private static final byte[] hencoding = Constants.encodeASCII("encoding");
private static final byte[] hencoding = Constants.encodeASCII("encoding"); //$NON-NLS-1$

private ObjectId treeId;

@@ -322,6 +322,7 @@ public class CommitBuilder {
return build();
}

@SuppressWarnings("nls")
@Override
public String toString() {
StringBuilder r = new StringBuilder();

+ 19
- 19
org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java View File

@@ -134,24 +134,24 @@ public class Config {
r.append('"');
inquote = false;
}
r.append("\\n\\\n");
r.append("\\n\\\n"); //$NON-NLS-1$
lineStart = r.length();
break;

case '\t':
r.append("\\t");
r.append("\\t"); //$NON-NLS-1$
break;

case '\b':
r.append("\\b");
r.append("\\b"); //$NON-NLS-1$
break;

case '\\':
r.append("\\\\");
r.append("\\\\"); //$NON-NLS-1$
break;

case '"':
r.append("\\\"");
r.append("\\\""); //$NON-NLS-1$
break;

case ';':
@@ -354,7 +354,7 @@ public class Config {
@SuppressWarnings("unchecked")
private static <T> T[] allValuesOf(final T value) {
try {
return (T[]) value.getClass().getMethod("values").invoke(null);
return (T[]) value.getClass().getMethod("values").invoke(null); //$NON-NLS-1$
} catch (Exception err) {
String typeName = value.getClass().getName();
String msg = MessageFormat.format(
@@ -393,9 +393,9 @@ public class Config {
for (T e : all) {
if (StringUtils.equalsIgnoreCase(e.name(), n))
return e;
else if (StringUtils.equalsIgnoreCase(e.name(), "TRUE"))
else if (StringUtils.equalsIgnoreCase(e.name(), "TRUE")) //$NON-NLS-1$
trueState = e;
else if (StringUtils.equalsIgnoreCase(e.name(), "FALSE"))
else if (StringUtils.equalsIgnoreCase(e.name(), "FALSE")) //$NON-NLS-1$
falseState = e;
}

@@ -664,11 +664,11 @@ public class Config {
final String s;

if (value >= GiB && (value % GiB) == 0)
s = String.valueOf(value / GiB) + " g";
s = String.valueOf(value / GiB) + " g"; //$NON-NLS-1$
else if (value >= MiB && (value % MiB) == 0)
s = String.valueOf(value / MiB) + " m";
s = String.valueOf(value / MiB) + " m"; //$NON-NLS-1$
else if (value >= KiB && (value % KiB) == 0)
s = String.valueOf(value / KiB) + " k";
s = String.valueOf(value / KiB) + " k"; //$NON-NLS-1$
else
s = String.valueOf(value);

@@ -695,7 +695,7 @@ public class Config {
*/
public void setBoolean(final String section, final String subsection,
final String name, final boolean value) {
setString(section, subsection, name, value ? "true" : "false");
setString(section, subsection, name, value ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
}

/**
@@ -937,8 +937,8 @@ public class Config {
out.append(' ');
String escaped = escapeValue(e.subsection);
// make sure to avoid double quotes here
boolean quoted = escaped.startsWith("\"")
&& escaped.endsWith("\"");
boolean quoted = escaped.startsWith("\"") //$NON-NLS-1$
&& escaped.endsWith("\""); //$NON-NLS-1$
if (!quoted)
out.append('"');
out.append(escaped);
@@ -947,11 +947,11 @@ public class Config {
}
out.append(']');
} else if (e.section != null && e.name != null) {
if (e.prefix == null || "".equals(e.prefix))
if (e.prefix == null || "".equals(e.prefix)) //$NON-NLS-1$
out.append('\t');
out.append(e.name);
if (MAGIC_EMPTY_VALUE != e.value) {
out.append(" =");
out.append(" ="); //$NON-NLS-1$
if (e.value != null) {
out.append(' ');
out.append(escapeValue(e.value));
@@ -1005,7 +1005,7 @@ public class Config {
} else if (e.section == null && Character.isWhitespace(c)) {
// Save the leading whitespace (if any).
if (e.prefix == null)
e.prefix = "";
e.prefix = ""; //$NON-NLS-1$
e.prefix += c;

} else if ('[' == c) {
@@ -1018,7 +1018,7 @@ public class Config {
}
if (']' != input)
throw new ConfigInvalidException(JGitText.get().badGroupHeader);
e.suffix = "";
e.suffix = ""; //$NON-NLS-1$

} else if (last != null) {
// Read a value.
@@ -1026,7 +1026,7 @@ public class Config {
e.subsection = last.subsection;
in.reset();
e.name = readKeyName(in);
if (e.name.endsWith("\n")) {
if (e.name.endsWith("\n")) { //$NON-NLS-1$
e.name = e.name.substring(0, e.name.length() - 1);
e.value = MAGIC_EMPTY_VALUE;
} else

+ 1
- 0
org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java View File

@@ -47,6 +47,7 @@ package org.eclipse.jgit.lib;
* Constants for use with the Configuration classes: section names,
* configuration keys
*/
@SuppressWarnings("nls")
public class ConfigConstants {
/** The "core" section */
public static final String CONFIG_CORE_SECTION = "core";

+ 1
- 0
org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigLine.java View File

@@ -112,6 +112,7 @@ class ConfigLine {
return a.equals(b);
}

@SuppressWarnings("nls")
@Override
public String toString() {
if (section == null)

+ 0
- 0
org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigSnapshot.java View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save