summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Pearce <sop@google.com>2015-12-24 15:46:19 -0800
committerShawn Pearce <sop@google.com>2015-12-28 11:43:31 -0800
commitef757a7e126e059bd0afe64949440813df791de3 (patch)
treed94d315c19819721c2b0c7afa56f0eac6e68733b
parent110d3ca5952978e1b95ad05cdd3307092ee0c8b8 (diff)
downloadjgit-ef757a7e126e059bd0afe64949440813df791de3.tar.gz
jgit-ef757a7e126e059bd0afe64949440813df791de3.zip
DirCacheEditor: Cleanup DeleteTree constructor
Neaten up formatting and avoid strings, which prevents the need for NLS comment tags. Instead check the last character using char literal, and append a char literal instead of a string. Change-Id: Ib68e017769a1f5c03200354a805769d585a48c8b
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java
index aa26160443..932ef94db0 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java
@@ -274,10 +274,11 @@ public class DirCacheEditor extends BaseDirCacheEditor {
* only the subtree's contents are matched by the command.
* The special case "" (not "/"!) deletes all entries.
*/
- public DeleteTree(final String entryPath) {
- super(
- (entryPath.endsWith("/") || entryPath.length() == 0) ? entryPath //$NON-NLS-1$
- : entryPath + "/"); //$NON-NLS-1$
+ public DeleteTree(String entryPath) {
+ super(entryPath.isEmpty()
+ || entryPath.charAt(entryPath.length() - 1) == '/'
+ ? entryPath
+ : entryPath + '/');
}
public void apply(final DirCacheEntry ent) {