Browse Source

Config: Handle reference-equality warning (and empty javadoc)

Reported by downstream analyzers. Suppress the warning on reference
equality for isMissing and fill an empty javadoc field.

Change-Id: I3494423daf2a53ca10e0a9c66553f00204c35396
Signed-off-by: Ivan Frade <ifrade@google.com>
stable-5.4
Ivan Frade 6 years ago committed by Matthias Sohn
parent
commit
96bd5ad8a3
  1. 5
      org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java

5
org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java

@ -131,10 +131,11 @@ public class Config {
/**
* Check if a given string is the "missing" value.
*
* @param value
* @param value string to be checked.
* @return true if the given string is the "missing" value.
* @since 5.4
*/
@SuppressWarnings({ "ReferenceEquality", "StringEquality" })
public static boolean isMissing(String value) {
return value == MISSING_ENTRY;
}
@ -1052,7 +1053,7 @@ public class Config {
if (e.prefix == null || "".equals(e.prefix)) //$NON-NLS-1$
out.append('\t');
out.append(e.name);
if (MISSING_ENTRY != e.value) {
if (!isMissing(e.value)) {
out.append(" ="); //$NON-NLS-1$
if (e.value != null) {
out.append(' ');

Loading…
Cancel
Save