Skip to content

Commit c415768

Browse files
Update plugin spring-nullability to v0.0.5 (#412)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Enrico Martelli <[email protected]>
1 parent 6525b02 commit c415768

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ dependencies {
1919
implementation(libs.telegram.bot.api)
2020
implementation(libs.tika)
2121

22+
testCompileOnly(libs.jspecify)
2223
testImplementation(libs.hamcrest)
2324
testImplementation(libs.junit.jupiter)
2425
testImplementation(libs.mockwebserver)
@@ -53,6 +54,15 @@ def jlink = tasks.register('jlink', JlinkTask) {
5354
description = 'Generates a minimal JRE for the project.'
5455
}
5556

57+
nullability {
58+
errorProneVersion = libs.errorprone.get().version
59+
nullAwayVersion = libs.nullaway.get().version
60+
}
61+
62+
tasks.named("compileTestJava") {
63+
options.nullability.checking = "tests"
64+
}
65+
5666
test {
5767
inputs.dir(jlink.map { it.outputDirectory.get().asFile })
5868
javaLauncher = providers.provider { new JlinkJavaLauncher(jlink.get()) }

gradle/libs.versions.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22
junit = "6.0.0"
33

44
[libraries]
5+
errorprone = "com.google.errorprone:error_prone_core:2.42.0"
56
gson = "com.google.code.gson:gson:2.13.2"
67
hamcrest = "org.hamcrest:hamcrest:3.0"
78
jspecify = "org.jspecify:jspecify:1.0.0"
89
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" }
910
junit-platform = { module = "org.junit.platform:junit-platform-launcher", version.ref = "junit" }
1011
logback-classic = "ch.qos.logback:logback-classic:1.5.18"
1112
mockwebserver = "com.squareup.okhttp3:mockwebserver3-junit5:5.1.0"
13+
nullaway = "com.uber.nullaway:nullaway:0.12.10"
1214
telegram-bot-api = "com.github.pengrad:java-telegram-bot-api:9.2.0"
1315
tika = "org.apache.tika:tika-core:3.2.3"
1416

1517
[plugins]
16-
spring-nullability = "io.spring.nullability:0.0.4"
18+
spring-nullability = "io.spring.nullability:0.0.5"

src/test/java/com/github/stickerifier/stickerify/logger/LoggingEvent.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import ch.qos.logback.classic.spi.StackTraceElementProxy;
77
import ch.qos.logback.classic.spi.ThrowableProxyVO;
88
import com.github.stickerifier.stickerify.exception.TelegramApiException;
9+
import org.jspecify.annotations.Nullable;
910

1011
/**
1112
* Test double that serves as an implementation of {@link ILoggingEvent}.
@@ -15,7 +16,7 @@ class LoggingEvent extends LoggingEventVO {
1516
static final String EXCEPTION_CLASS = TelegramApiException.class.getName();
1617

1718
private final String formattedMessage;
18-
private IThrowableProxy throwableProxy;
19+
private @Nullable IThrowableProxy throwableProxy;
1920

2021
LoggingEvent(String formattedMessage) {
2122
this.formattedMessage = formattedMessage;
@@ -54,6 +55,7 @@ public String getFormattedMessage() {
5455
return formattedMessage;
5556
}
5657

58+
@Nullable
5759
@Override
5860
public IThrowableProxy getThrowableProxy() {
5961
return throwableProxy;

src/test/java/com/github/stickerifier/stickerify/media/MediaHelperTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.github.stickerifier.stickerify.junit.ClearTempFiles;
2222
import com.github.stickerifier.stickerify.junit.Tags;
2323
import com.github.stickerifier.stickerify.process.ProcessHelper;
24+
import org.jspecify.annotations.Nullable;
2425
import org.junit.jupiter.api.DisplayName;
2526
import org.junit.jupiter.api.Nested;
2627
import org.junit.jupiter.api.Tag;
@@ -45,7 +46,9 @@ void resizeRectangularImage() throws Exception {
4546
assertImageConsistency(result, 512, 341);
4647
}
4748

48-
private static void assertImageConsistency(File image, int expectedWidth, int expectedHeight) throws Exception {
49+
private static void assertImageConsistency(@Nullable File image, int expectedWidth, int expectedHeight) throws Exception {
50+
assertNotNull(image);
51+
4952
var mediaInfo = MediaHelper.retrieveMultimediaInfo(image);
5053
var imageInfo = mediaInfo.video();
5154
assertNotNull(imageInfo);
@@ -154,7 +157,9 @@ void convertLongMovVideo() throws Exception {
154157
assertVideoConsistency(result, 512, 288, 29.97003F, 2.969F);
155158
}
156159

157-
private static void assertVideoConsistency(File video, int expectedWidth, int expectedHeight, float expectedFrameRate, float expectedDuration) throws Exception {
160+
private static void assertVideoConsistency(@Nullable File video, int expectedWidth, int expectedHeight, float expectedFrameRate, float expectedDuration) throws Exception {
161+
assertNotNull(video);
162+
158163
var mediaInfo = MediaHelper.retrieveMultimediaInfo(video);
159164
var videoInfo = mediaInfo.video();
160165
assertNotNull(videoInfo);

0 commit comments

Comments
 (0)