Improve null-safety of module/spring-boot-devtools
See gh-47263
This commit is contained in:
parent
1023ed65a6
commit
58e2f9c872
|
@ -16,6 +16,8 @@
|
|||
|
||||
package org.springframework.boot.devtools.classpath;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.boot.devtools.filewatch.ChangedFile;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
@ -37,7 +39,7 @@ public class PatternClassPathRestartStrategy implements ClassPathRestartStrategy
|
|||
this.excludePatterns = excludePatterns;
|
||||
}
|
||||
|
||||
public PatternClassPathRestartStrategy(String excludePatterns) {
|
||||
public PatternClassPathRestartStrategy(@Nullable String excludePatterns) {
|
||||
this(StringUtils.commaDelimitedListToStringArray(excludePatterns));
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ public class ClassLoaderFile implements Serializable {
|
|||
* @param kind the kind of file
|
||||
* @param contents the file contents
|
||||
*/
|
||||
public ClassLoaderFile(Kind kind, byte[] contents) {
|
||||
public ClassLoaderFile(Kind kind, byte @Nullable [] contents) {
|
||||
this(kind, System.currentTimeMillis(), contents);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,6 @@ public interface ClassLoaderFileRepository {
|
|||
* @param name the name of the file
|
||||
* @return a {@link ClassLoaderFile} or {@code null}
|
||||
*/
|
||||
@Nullable ClassLoaderFile getFile(String name);
|
||||
@Nullable ClassLoaderFile getFile(@Nullable String name);
|
||||
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ public class ClassLoaderFiles implements ClassLoaderFileRepository, Serializable
|
|||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ClassLoaderFile getFile(String name) {
|
||||
public @Nullable ClassLoaderFile getFile(@Nullable String name) {
|
||||
return this.filesByName.get(name);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue