BAEL-4953: Fix FindBugs annotations (#10772)

Co-authored-by: Krzysztof Woyke <krzysztof.woyke.sp@lhsystems.com>
This commit is contained in:
kwoyke 2021-05-17 14:15:19 +02:00 committed by GitHub
parent d72cdbc576
commit bdd7733443
2 changed files with 10 additions and 4 deletions

View File

@ -26,6 +26,11 @@
<version>${lombok.version}</version> <version>${lombok.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
<version>${findbugs.annotations.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
@ -41,6 +46,7 @@
<properties> <properties>
<intellij.annotations.version>16.0.2</intellij.annotations.version> <intellij.annotations.version>16.0.2</intellij.annotations.version>
<findbugs.annotations.version>3.0.1</findbugs.annotations.version>
<assertj-core.version>3.9.1</assertj-core.version> <assertj-core.version>3.9.1</assertj-core.version>
</properties> </properties>

View File

@ -1,12 +1,12 @@
package com.baeldung.nulls; package com.baeldung.nulls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
public class FindBugsAnnotations { public class FindBugsAnnotations {
public void accept(@NotNull Object param) { public void accept(@NonNull Object param) {
System.out.println(param.toString()); System.out.println(param.toString());
} }
@ -14,7 +14,7 @@ public class FindBugsAnnotations {
System.out.println("Printing " + param); System.out.println("Printing " + param);
} }
@NotNull @NonNull
public Object process() throws Exception { public Object process() throws Exception {
Object result = doSomething(); Object result = doSomething();
if (result == null) { if (result == null) {