Check that nullable annotations are from org.springframework.lang

Fix a few incorrect nullable annotation imports and add a checkstyle
rule to ensure they don't return.

Closes gh-28410
This commit is contained in:
Phillip Webb
2022-05-03 11:09:14 -07:00
parent 68bb4023eb
commit 63b129a3f7
12 changed files with 31 additions and 26 deletions

View File

@@ -23,7 +23,8 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.stream.Stream;
import javax.annotation.Nullable;
import org.springframework.lang.Nullable;
/**
* Internal class used by {@link SourceFiles} and {@link ResourceFiles} to

View File

@@ -19,7 +19,8 @@ package org.springframework.aot.test.generator.file;
import java.util.Iterator;
import java.util.stream.Stream;
import javax.annotation.Nullable;
import org.springframework.lang.Nullable;
/**
* An immutable collection of {@link ResourceFile} instances.

View File

@@ -18,8 +18,6 @@ package org.springframework.aot.test.generator.file;
import java.io.StringReader;
import javax.annotation.Nullable;
import com.thoughtworks.qdox.JavaProjectBuilder;
import com.thoughtworks.qdox.model.JavaClass;
import com.thoughtworks.qdox.model.JavaPackage;
@@ -27,6 +25,8 @@ import com.thoughtworks.qdox.model.JavaSource;
import org.assertj.core.api.AssertProvider;
import org.assertj.core.util.Strings;
import org.springframework.lang.Nullable;
/**
* {@link DynamicFile} that holds Java source code and provides
* {@link SourceFileAssert} support. Usually created from an AOT generated type,

View File

@@ -19,7 +19,7 @@ package org.springframework.aot.test.generator.file;
import java.util.Iterator;
import java.util.stream.Stream;
import javax.annotation.Nullable;
import org.springframework.lang.Nullable;
/**
* An immutable collection of {@link SourceFile} instances.