Skip to content

Commit 382034b

Browse files
committed
Update to JDK 25
1 parent 3165450 commit 382034b

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v4
16-
- name: Set up JDK 21
16+
- name: Set up JDK 25
1717
uses: actions/setup-java@v4
1818
with:
19-
java-version: '21'
19+
java-version: '25'
2020
distribution: 'temurin'
2121
- name: Setup Gradle
2222
uses: gradle/actions/setup-gradle@v4

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ This project aims to showcase how to integrate and configure these tools in a Ja
1010
```bash
1111
git clone https://github.com/raharrison/java-jspecify-example.git
1212
cd java-jspecify-example
13-
./gradlew build
13+
./gradlew build # by default will pass, directly use nullable object to fail
1414
```
1515

1616
### Notes
1717

18-
- The `UserRepo` class is annotated using `JSpecify`
18+
- The `UserRepo` class is annotated using `JSpecify` annotations
1919
- By default, the build is set up to fail if any `NullAway` error is reported
2020
- Uncomment the line in `Main` to use a nullable object without a check beforehand. This will fail the build
2121
- `NullAway` will not run on test code
2222
- `NullAway` is configured to check all files in the specified project package. You can alternatively check only `NullMarked` code
23-
by annotating each class
24-
or through an annotated `package-info.java` file
23+
by annotating each class or through an annotated `package-info.java` file

build.gradle.kts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import net.ltgt.gradle.errorprone.errorprone
33
plugins {
44
application
55
id("java")
6-
id("com.gradleup.shadow") version "8.3.6"
6+
id("com.gradleup.shadow") version "9.2.2"
77
id("net.ltgt.errorprone") version "4.3.0"
88
}
99

@@ -15,12 +15,13 @@ repositories {
1515
}
1616

1717
dependencies {
18-
testImplementation(platform("org.junit:junit-bom:5.11.4"))
18+
testImplementation(platform("org.junit:junit-bom:6.0.0"))
1919
testImplementation("org.junit.jupiter:junit-jupiter")
20+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
2021

2122
implementation("org.jspecify:jspecify:1.0.0")
22-
errorprone("com.google.errorprone:error_prone_core:2.40.0")
23-
errorprone("com.uber.nullaway:nullaway:0.12.7")
23+
errorprone("com.google.errorprone:error_prone_core:2.43.0")
24+
errorprone("com.uber.nullaway:nullaway:0.12.11")
2425
}
2526

2627
tasks.test {
@@ -29,7 +30,7 @@ tasks.test {
2930

3031
java {
3132
toolchain {
32-
languageVersion = JavaLanguageVersion.of(21)
33+
languageVersion = JavaLanguageVersion.of(25)
3334
}
3435
}
3536

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

src/main/java/com/example/myapp/Main.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
public class Main {
44

5-
public static void main(String[] args) {
5+
static void main() {
66
var repo = new UserRepo();
77

88
User user = repo.getUserById("1");
9-
// System.out.println(user.username()); // possible NPE!
9+
// System.out.println(user.username()); // possible NPE!
10+
1011
if (user != null) {
1112
System.out.println("Found user: " + user.username());
1213
} else {

0 commit comments

Comments
 (0)