Browse Source

Silence non-externalized string warnings in org.eclipse.jgit

Change-Id: I7fa180db0c59e4a317a0c99ec48574cb0e5ac2f2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-4.1
Matthias Sohn 10 years ago
parent
commit
746cf09b33
  1. 24
      org.eclipse.jgit/src/org/eclipse/jgit/api/MergeResult.java
  2. 2
      org.eclipse.jgit/src/org/eclipse/jgit/api/RemoveNoteCommand.java
  3. 4
      org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java
  4. 8
      org.eclipse.jgit/src/org/eclipse/jgit/api/StashApplyCommand.java
  5. 6
      org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java
  6. 5
      org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java
  7. 6
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryUpdate.java
  8. 14
      org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java
  9. 8
      org.eclipse.jgit/src/org/eclipse/jgit/merge/SquashMessageFormatter.java
  10. 2
      org.eclipse.jgit/src/org/eclipse/jgit/merge/StrategyRecursive.java

24
org.eclipse.jgit/src/org/eclipse/jgit/api/MergeResult.java

@ -69,7 +69,7 @@ public class MergeResult {
FAST_FORWARD { FAST_FORWARD {
@Override @Override
public String toString() { public String toString() {
return "Fast-forward"; return "Fast-forward"; //$NON-NLS-1$
} }
@Override @Override
@ -83,7 +83,7 @@ public class MergeResult {
FAST_FORWARD_SQUASHED { FAST_FORWARD_SQUASHED {
@Override @Override
public String toString() { public String toString() {
return "Fast-forward-squashed"; return "Fast-forward-squashed"; //$NON-NLS-1$
} }
@Override @Override
@ -95,7 +95,7 @@ public class MergeResult {
ALREADY_UP_TO_DATE { ALREADY_UP_TO_DATE {
@Override @Override
public String toString() { public String toString() {
return "Already-up-to-date"; return "Already-up-to-date"; //$NON-NLS-1$
} }
@Override @Override
@ -107,7 +107,7 @@ public class MergeResult {
FAILED { FAILED {
@Override @Override
public String toString() { public String toString() {
return "Failed"; return "Failed"; //$NON-NLS-1$
} }
@Override @Override
@ -119,7 +119,7 @@ public class MergeResult {
MERGED { MERGED {
@Override @Override
public String toString() { public String toString() {
return "Merged"; return "Merged"; //$NON-NLS-1$
} }
@Override @Override
@ -133,7 +133,7 @@ public class MergeResult {
MERGED_SQUASHED { MERGED_SQUASHED {
@Override @Override
public String toString() { public String toString() {
return "Merged-squashed"; return "Merged-squashed"; //$NON-NLS-1$
} }
@Override @Override
@ -147,7 +147,7 @@ public class MergeResult {
MERGED_SQUASHED_NOT_COMMITTED { MERGED_SQUASHED_NOT_COMMITTED {
@Override @Override
public String toString() { public String toString() {
return "Merged-squashed-not-committed"; return "Merged-squashed-not-committed"; //$NON-NLS-1$
} }
@Override @Override
@ -159,7 +159,7 @@ public class MergeResult {
CONFLICTING { CONFLICTING {
@Override @Override
public String toString() { public String toString() {
return "Conflicting"; return "Conflicting"; //$NON-NLS-1$
} }
@Override @Override
@ -173,7 +173,7 @@ public class MergeResult {
ABORTED { ABORTED {
@Override @Override
public String toString() { public String toString() {
return "Aborted"; return "Aborted"; //$NON-NLS-1$
} }
@Override @Override
@ -186,7 +186,7 @@ public class MergeResult {
**/ **/
MERGED_NOT_COMMITTED { MERGED_NOT_COMMITTED {
public String toString() { public String toString() {
return "Merged-not-committed"; return "Merged-not-committed"; //$NON-NLS-1$
} }
@Override @Override
@ -198,7 +198,7 @@ public class MergeResult {
NOT_SUPPORTED { NOT_SUPPORTED {
@Override @Override
public String toString() { public String toString() {
return "Not-yet-supported"; return "Not-yet-supported"; //$NON-NLS-1$
} }
@Override @Override
@ -213,7 +213,7 @@ public class MergeResult {
*/ */
CHECKOUT_CONFLICT { CHECKOUT_CONFLICT {
public String toString() { public String toString() {
return "Checkout Conflict"; return "Checkout Conflict"; //$NON-NLS-1$
} }
@Override @Override

2
org.eclipse.jgit/src/org/eclipse/jgit/api/RemoveNoteCommand.java

@ -93,7 +93,7 @@ public class RemoveNoteCommand extends GitCommand<Note> {
} }
map.set(id, null, inserter); map.set(id, null, inserter);
commitNoteMap(walk, map, notesCommit, inserter, commitNoteMap(walk, map, notesCommit, inserter,
"Notes removed by 'git notes remove'"); "Notes removed by 'git notes remove'"); //$NON-NLS-1$
return map.getNote(id); return map.getNote(id);
} catch (IOException e) { } catch (IOException e) {
throw new JGitInternalException(e.getMessage(), e); throw new JGitInternalException(e.getMessage(), e);

4
org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java

@ -271,7 +271,7 @@ public class ResetCommand extends GitCommand<Ref> {
if (!filepaths.isEmpty()) if (!filepaths.isEmpty())
throw new JGitInternalException(MessageFormat.format( throw new JGitInternalException(MessageFormat.format(
JGitText.get().illegalCombinationOfArguments, JGitText.get().illegalCombinationOfArguments,
"[--mixed | --soft | --hard]", "<paths>...")); //$NON-NLS-1$ "[--mixed | --soft | --hard]", "<paths>...")); //$NON-NLS-1$ //$NON-NLS-2$
this.mode = mode; this.mode = mode;
return this; return this;
} }
@ -285,7 +285,7 @@ public class ResetCommand extends GitCommand<Ref> {
public ResetCommand addPath(String path) { public ResetCommand addPath(String path) {
if (mode != null) if (mode != null)
throw new JGitInternalException(MessageFormat.format( throw new JGitInternalException(MessageFormat.format(
JGitText.get().illegalCombinationOfArguments, "<paths>...", JGitText.get().illegalCombinationOfArguments, "<paths>...", //$NON-NLS-1$
"[--mixed | --soft | --hard]")); //$NON-NLS-1$ "[--mixed | --soft | --hard]")); //$NON-NLS-1$
filepaths.add(path); filepaths.add(path);
return this; return this;

8
org.eclipse.jgit/src/org/eclipse/jgit/api/StashApplyCommand.java

@ -191,8 +191,8 @@ public class StashApplyCommand extends GitCommand<ObjectId> {
untrackedCommit = revWalk.parseCommit(stashCommit.getParent(2)); untrackedCommit = revWalk.parseCommit(stashCommit.getParent(2));
ResolveMerger merger = (ResolveMerger) strategy.newMerger(repo); ResolveMerger merger = (ResolveMerger) strategy.newMerger(repo);
merger.setCommitNames(new String[] { "stashed HEAD", "HEAD", merger.setCommitNames(new String[] { "stashed HEAD", "HEAD", //$NON-NLS-1$ //$NON-NLS-2$
"stash" }); "stash" }); //$NON-NLS-1$
merger.setBase(stashHeadCommit); merger.setBase(stashHeadCommit);
merger.setWorkingTreeIterator(new FileTreeIterator(repo)); merger.setWorkingTreeIterator(new FileTreeIterator(repo));
if (merger.merge(headCommit, stashCommit)) { if (merger.merge(headCommit, stashCommit)) {
@ -204,8 +204,8 @@ public class StashApplyCommand extends GitCommand<ObjectId> {
if (applyIndex) { if (applyIndex) {
ResolveMerger ixMerger = (ResolveMerger) strategy ResolveMerger ixMerger = (ResolveMerger) strategy
.newMerger(repo, true); .newMerger(repo, true);
ixMerger.setCommitNames(new String[] { "stashed HEAD", ixMerger.setCommitNames(new String[] { "stashed HEAD", //$NON-NLS-1$
"HEAD", "stashed index" }); "HEAD", "stashed index" }); //$NON-NLS-1$//$NON-NLS-2$
ixMerger.setBase(stashHeadCommit); ixMerger.setBase(stashHeadCommit);
boolean ok = ixMerger.merge(headCommit, stashIndexCommit); boolean ok = ixMerger.merge(headCommit, stashIndexCommit);
if (ok) { if (ok) {

6
org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java

@ -94,11 +94,11 @@ import org.eclipse.jgit.util.FileUtils;
*/ */
public class StashCreateCommand extends GitCommand<RevCommit> { public class StashCreateCommand extends GitCommand<RevCommit> {
private static final String MSG_INDEX = "index on {0}: {1} {2}"; private static final String MSG_INDEX = "index on {0}: {1} {2}"; //$NON-NLS-1$
private static final String MSG_UNTRACKED = "untracked files on {0}: {1} {2}"; private static final String MSG_UNTRACKED = "untracked files on {0}: {1} {2}"; //$NON-NLS-1$
private static final String MSG_WORKING_DIR = "WIP on {0}: {1} {2}"; private static final String MSG_WORKING_DIR = "WIP on {0}: {1} {2}"; //$NON-NLS-1$
private String indexMessage = MSG_INDEX; private String indexMessage = MSG_INDEX;

5
org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java

@ -216,8 +216,9 @@ public class TagCommand extends GitCommand<Ref> {
if (tagger == null && annotated) if (tagger == null && annotated)
tagger = new PersonIdent(repo); tagger = new PersonIdent(repo);
if (name == null || !Repository.isValidRefName(Constants.R_TAGS + name)) if (name == null || !Repository.isValidRefName(Constants.R_TAGS + name))
throw new InvalidTagNameException(MessageFormat.format(JGitText throw new InvalidTagNameException(
.get().tagNameInvalid, name == null ? "<null>" : name)); MessageFormat.format(JGitText.get().tagNameInvalid,
name == null ? "<null>" : name)); //$NON-NLS-1$
if (signed) if (signed)
throw new UnsupportedOperationException( throw new UnsupportedOperationException(
JGitText.get().signingNotSupportedOnTag); JGitText.get().signingNotSupportedOnTag);

6
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectoryUpdate.java

@ -128,11 +128,11 @@ class RefDirectoryUpdate extends RefUpdate {
private String toResultString(final Result status) { private String toResultString(final Result status) {
switch (status) { switch (status) {
case FORCED: case FORCED:
return "forced-update"; return "forced-update"; //$NON-NLS-1$
case FAST_FORWARD: case FAST_FORWARD:
return "fast forward"; return "fast forward"; //$NON-NLS-1$
case NEW: case NEW:
return "created"; return "created"; //$NON-NLS-1$
default: default:
return null; return null;
} }

14
org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java

@ -97,27 +97,27 @@ public class MergeMessageFormatter {
List<String> listings = new ArrayList<String>(); List<String> listings = new ArrayList<String>();
if (!branches.isEmpty()) if (!branches.isEmpty())
listings.add(joinNames(branches, "branch", "branches")); listings.add(joinNames(branches, "branch", "branches")); //$NON-NLS-1$//$NON-NLS-2$
if (!remoteBranches.isEmpty()) if (!remoteBranches.isEmpty())
listings.add(joinNames(remoteBranches, "remote-tracking branch", listings.add(joinNames(remoteBranches, "remote-tracking branch", //$NON-NLS-1$
"remote-tracking branches")); "remote-tracking branches")); //$NON-NLS-1$
if (!tags.isEmpty()) if (!tags.isEmpty())
listings.add(joinNames(tags, "tag", "tags")); listings.add(joinNames(tags, "tag", "tags")); //$NON-NLS-1$ //$NON-NLS-2$
if (!commits.isEmpty()) if (!commits.isEmpty())
listings.add(joinNames(commits, "commit", "commits")); listings.add(joinNames(commits, "commit", "commits")); //$NON-NLS-1$ //$NON-NLS-2$
if (!others.isEmpty()) if (!others.isEmpty())
listings.add(StringUtils.join(others, ", ", " and ")); //$NON-NLS-1$ listings.add(StringUtils.join(others, ", ", " and ")); //$NON-NLS-1$ //$NON-NLS-2$
sb.append(StringUtils.join(listings, ", ")); //$NON-NLS-1$ sb.append(StringUtils.join(listings, ", ")); //$NON-NLS-1$
String targetName = target.getLeaf().getName(); String targetName = target.getLeaf().getName();
if (!targetName.equals(Constants.R_HEADS + Constants.MASTER)) { if (!targetName.equals(Constants.R_HEADS + Constants.MASTER)) {
String targetShortName = Repository.shortenRefName(targetName); String targetShortName = Repository.shortenRefName(targetName);
sb.append(" into " + targetShortName); sb.append(" into " + targetShortName); //$NON-NLS-1$
} }
return sb.toString(); return sb.toString();

8
org.eclipse.jgit/src/org/eclipse/jgit/merge/SquashMessageFormatter.java

@ -76,9 +76,9 @@ public class SquashMessageFormatter {
*/ */
public String format(List<RevCommit> squashedCommits, Ref target) { public String format(List<RevCommit> squashedCommits, Ref target) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("Squashed commit of the following:\n"); sb.append("Squashed commit of the following:\n"); //$NON-NLS-1$
for (RevCommit c : squashedCommits) { for (RevCommit c : squashedCommits) {
sb.append("\ncommit "); sb.append("\ncommit "); //$NON-NLS-1$
sb.append(c.getName()); sb.append(c.getName());
sb.append("\n"); //$NON-NLS-1$ sb.append("\n"); //$NON-NLS-1$
sb.append(toString(c.getAuthorIdent())); sb.append(toString(c.getAuthorIdent()));
@ -92,12 +92,12 @@ public class SquashMessageFormatter {
private String toString(PersonIdent author) { private String toString(PersonIdent author) {
final StringBuilder a = new StringBuilder(); final StringBuilder a = new StringBuilder();
a.append("Author: "); a.append("Author: "); //$NON-NLS-1$
a.append(author.getName()); a.append(author.getName());
a.append(" <"); //$NON-NLS-1$ a.append(" <"); //$NON-NLS-1$
a.append(author.getEmailAddress()); a.append(author.getEmailAddress());
a.append(">\n"); //$NON-NLS-1$ a.append(">\n"); //$NON-NLS-1$
a.append("Date: "); a.append("Date: "); //$NON-NLS-1$
a.append(dateFormatter.formatDate(author)); a.append(dateFormatter.formatDate(author));
a.append("\n"); //$NON-NLS-1$ a.append("\n"); //$NON-NLS-1$

2
org.eclipse.jgit/src/org/eclipse/jgit/merge/StrategyRecursive.java

@ -64,6 +64,6 @@ public class StrategyRecursive extends StrategyResolve {
@Override @Override
public String getName() { public String getName() {
return "recursive"; return "recursive"; //$NON-NLS-1$
} }
} }

Loading…
Cancel
Save