Browse Source

PacketLineIn: Suppress comparison warnings for END and DELIM

Reference comparison is intentional. The END and DELIM string
constants are used as sentinels and will always be the same
instances.

Suppress both ReferenceEquality and StringEquality warnings.

Change-Id: I4ce0495702c56b3911f42f26c2f81d28073cbe19
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
tags/v5.4.1.201908211225-r
David Pursehouse 5 years ago
parent
commit
9e499dad6d
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java

+ 2
- 0
org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java View File

@@ -259,6 +259,7 @@ public class PacketLineIn {
* @return true if the given string is {@link #DELIM}, otherwise false.
* @since 5.4
*/
@SuppressWarnings({ "ReferenceEquality", "StringEquality" })
public static boolean isDelimiter(String s) {
return s == DELIM;
}
@@ -293,6 +294,7 @@ public class PacketLineIn {
* @return true if the given string is {@link #END}, otherwise false.
* @since 5.4
*/
@SuppressWarnings({ "ReferenceEquality", "StringEquality" })
public static boolean isEnd(String s) {
return s == END;
}

Loading…
Cancel
Save