]> source.dussan.org Git - jgit.git/commitdiff
[spotbugs] Silence NP_BOOLEAN_RETURN_NULL in IgnoreNode#checkIgnored 74/173374/7
authorMatthias Sohn <matthias.sohn@sap.com>
Fri, 4 Dec 2020 10:01:06 +0000 (11:01 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 22 Dec 2020 09:52:59 +0000 (10:52 +0100)
Also mark the return value @Nullable to enable null analysis in Eclipse.

Change-Id: I5b286d657d432f4b32afd4dd370f76892b115422
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit/findBugs/FindBugsExcludeFilter.xml
org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreNode.java

index 686843f3024c0b89582d36f585e13a54f32bc59d..73a6685564813d4dd46783adada5d9944143bb7b 100644 (file)
        <Bug pattern="NP_BOOLEAN_RETURN_NULL" />
      </Match>
 
+     <Match>
+       <Class name="org.eclipse.jgit.ignore.IgnoreNode" />
+       <Method name="checkIgnored" />
+       <Bug pattern="NP_BOOLEAN_RETURN_NULL" />
+     </Match>
+
      <!-- Transport initialization works like this -->
      <Match>
        <Class name="org.eclipse.jgit.transport.Transport" />
index 0bc6124912fcc094bf7c8b543fa591a0b73fb1e1..1a1b2d302fae657f210d961b620a60014a2d68fc 100644 (file)
@@ -19,6 +19,8 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
+import org.eclipse.jgit.annotations.Nullable;
+
 /**
  * Represents a bundle of ignore rules inherited from a base directory.
  *
@@ -135,7 +137,8 @@ public class IgnoreNode {
         *         undetermined
         * @since 4.11
         */
-       public Boolean checkIgnored(String entryPath, boolean isDirectory) {
+       public @Nullable Boolean checkIgnored(String entryPath,
+                       boolean isDirectory) {
                // Parse rules in the reverse order that they were read because later
                // rules have higher priority
                for (int i = rules.size() - 1; i > -1; i--) {