summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2015-03-09 17:30:08 -0700
committerShawn Pearce <spearce@spearce.org>2015-03-09 17:30:08 -0700
commitce3997344ecb564f2af95fd366303e2c9d70143d (patch)
tree25f8f00a623b2e984dc59303ceb0a345966a5d9c
parent8cf14cfdadd4e9886b13bcf2b0685ca6006d1d80 (diff)
downloadjgit-ce3997344ecb564f2af95fd366303e2c9d70143d.tar.gz
jgit-ce3997344ecb564f2af95fd366303e2c9d70143d.zip
PushCertificateParser: Fix check for blank line after header
Reference equality (!= or ==) cannot be used to check for String equality. String objects are not necessarily interned to the same instance. Use .isEmpty() since the function only cares about an empty string and does not need to test a specific string value. Change-Id: If530cb59666a8196d57d2348c893706a517ea541
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateParser.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateParser.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateParser.java
index d4b11a5d40..4bb3d6bf82 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateParser.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateParser.java
@@ -158,7 +158,7 @@ public class PushCertificateParser extends PushCertificate {
pushee = parseNextLine(pckIn, PUSHEE);
receivedNonce = parseNextLine(pckIn, NONCE);
// an empty line
- if (pckIn.readString() != "") { //$NON-NLS-1$
+ if (!pckIn.readString().isEmpty()) {
throw new IOException(MessageFormat.format(
JGitText.get().errorInvalidPushCert,
"expected empty line after header")); //$NON-NLS-1$