diff options
author | Carsten Hammer <carsten.hammer@t-online.de> | 2019-04-06 19:38:27 +0200 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2019-04-11 11:48:31 +0900 |
commit | 0db509f7e750336923fcee858a7152129dc1a321 (patch) | |
tree | b7535623ebdaff962b347e47fb8eda211d865196 /org.eclipse.jgit.pgm | |
parent | e876a70ede47559f927fa285169f267aa445f2dd (diff) | |
download | jgit-0db509f7e750336923fcee858a7152129dc1a321.tar.gz jgit-0db509f7e750336923fcee858a7152129dc1a321.zip |
Use String.isEmpty() instead of comparing to ""
Use of String.equals("") can be replaced with with String.length() == 0
(for JDK5 and lower) or String.isEmpty() (for JDK6 and higher)
Change-Id: Id1462d22c5d249485d87993263a9239809e73c55
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.pgm')
3 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java index 3858b3dd0e..8794ca6cbe 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java @@ -295,14 +295,14 @@ class Blame extends TextBuiltin { } } - if (beginStr.equals("")) //$NON-NLS-1$ + if (beginStr.isEmpty()) begin = 0; else if (beginStr.startsWith("/")) //$NON-NLS-1$ begin = findLine(0, beginStr); else begin = Math.max(0, Integer.parseInt(beginStr) - 1); - if (endStr.equals("")) //$NON-NLS-1$ + if (endStr.isEmpty()) end = blame.getResultContents().size(); else if (endStr.startsWith("/")) //$NON-NLS-1$ end = findLine(begin, endStr); diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java index c7e4bad94e..0373aeff58 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java @@ -390,7 +390,7 @@ public class Main { if (s == null && protocol.equals("https")) { //$NON-NLS-1$ s = System.getenv("HTTPS_PROXY"); //$NON-NLS-1$ } - if (s == null || s.equals("")) { //$NON-NLS-1$ + if (s == null || s.isEmpty()) { continue; } diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java index dfc8a9436f..8b187587bc 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Status.java @@ -282,7 +282,7 @@ class Status extends TextBuiltin { if (!porcelain) { outw.println(CLIText.formatLine(MessageFormat.format(pattern, arguments))); - if (!pattern.equals("")) //$NON-NLS-1$ + if (!pattern.isEmpty()) outw.println(CLIText.formatLine("")); //$NON-NLS-1$ outw.flush(); } |