aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2020-12-04 11:01:06 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2020-12-22 10:52:59 +0100
commit1fd0a49ce05c158e9754a5d9ac0cfbe56f6b65bb (patch)
treeba480ccb7fc7d6fc047b25a453577252fb8f6ec3
parent5eabd6995a85e95fd554161c6ddb6a5a25d595b1 (diff)
downloadjgit-1fd0a49ce05c158e9754a5d9ac0cfbe56f6b65bb.tar.gz
jgit-1fd0a49ce05c158e9754a5d9ac0cfbe56f6b65bb.zip
[spotbugs] Silence NP_BOOLEAN_RETURN_NULL in IgnoreNode#checkIgnored
Also mark the return value @Nullable to enable null analysis in Eclipse. Change-Id: I5b286d657d432f4b32afd4dd370f76892b115422 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.jgit/findBugs/FindBugsExcludeFilter.xml6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreNode.java5
2 files changed, 10 insertions, 1 deletions
diff --git a/org.eclipse.jgit/findBugs/FindBugsExcludeFilter.xml b/org.eclipse.jgit/findBugs/FindBugsExcludeFilter.xml
index 686843f302..73a6685564 100644
--- a/org.eclipse.jgit/findBugs/FindBugsExcludeFilter.xml
+++ b/org.eclipse.jgit/findBugs/FindBugsExcludeFilter.xml
@@ -77,6 +77,12 @@
<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" />
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreNode.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreNode.java
index 0bc6124912..1a1b2d302f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreNode.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/IgnoreNode.java
@@ -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--) {
color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/********************************************************************
 * Copyright (c) 2006 Contributors. All rights reserved.
 * This program and the accompanying materials are made available
 * under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution and is available at
 * http://eclipse.org/legal/epl-v10.html
 *
 * Contributors: IBM Corporation - initial API and implementation
 * 				 Helen Hawkins   - iniital version
 *******************************************************************/
package org.aspectj.weaver;

public interface IEclipseSourceContext extends ISourceContext {
	void removeUnnecessaryProblems(Member method, int problemLineNumber);
}