From 50a7048c9cbf1bc716a71b7445499f6393365584 Mon Sep 17 00:00:00 2001 From: Suresh G Date: Tue, 13 Dec 2022 20:43:08 -0800 Subject: [PATCH] chore: jspecify 0.3 annotations --- gradle/libs.versions.toml | 5 +++-- script.main.kts | 2 +- src/main/java/dev/suresh/adt/DOP.java | 28 ++++++++++++++++----------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5487de7b..ccf22dcb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -53,7 +53,7 @@ jgit = "6.2.0.202206071550-r" jgitver = "0.10.0-rc03" jmdns = "3.5.8" jreleaser = "0.9.1" -jspecify = "0.3.0-alpha-2" +jspecify = "0.3.0" jte = "2.2.4" junit = "5.9.1" junit-pioneer = "1.9.1" @@ -98,7 +98,7 @@ reflect-typetools = "0.6.3" rsocket = "0.15.4" semver = "1.0.0" shapeshift = "0.5.0" -slf4j = "2.0.5" +slf4j = "2.0.6" testcontainers = "1.16.3" togglz = "3.1.1" versioncompare = "1.5.0" @@ -350,6 +350,7 @@ build-bestpractices-plugin = { module = "com.autonomousapps:plugin-best-pra build-openrewrite-plugin = { module = "org.openrewrite:plugin" , version.ref = "openrewrite" } build-maven-plugindev = { module = "de.benediktritter:plugin" , version.ref = "maven-plugindev" } build-cp-collisiondetector = { module = "io.fuchs.gradle.classpath-collision-detector:classpath-collision-detector" , version.ref = "classpath-collisiondetector" } +build-includegit-plugin = { module = "me.champeau.gradle.includegit:plugin" , version.ref = "champeau-includegit" } # Gradle Plugins [plugins] diff --git a/script.main.kts b/script.main.kts index b96bc648..55330601 100755 --- a/script.main.kts +++ b/script.main.kts @@ -8,7 +8,7 @@ @file:DependsOn("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") @file:DependsOn("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1") @file:DependsOn("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0") -@file:DependsOn("org.slf4j:slf4j-simple:2.0.5") +@file:DependsOn("org.slf4j:slf4j-simple:2.0.6") @file:DependsOn("com.microsoft.playwright:playwright:1.28.1") // @file:Import("common.main.kts") diff --git a/src/main/java/dev/suresh/adt/DOP.java b/src/main/java/dev/suresh/adt/DOP.java index 20c8c511..41e2a1b1 100644 --- a/src/main/java/dev/suresh/adt/DOP.java +++ b/src/main/java/dev/suresh/adt/DOP.java @@ -3,28 +3,34 @@ import static java.lang.System.out; import java.util.concurrent.CompletableFuture; +import org.jspecify.annotations.NullMarked; /** Data Oriented Programming (DOP) in Java */ public class DOP { public static void main(String[] args) throws Exception { + + @NullMarked + record Person(String name, int age) {} + var future = new CompletableFuture<>(); future.complete("hello"); out.println(future.get()); var textBlock = """ - This is text block - This will join \ - with the line - "quote" = "added" - Escape Start \n \t \r \b \f end - Space Escape-\s\s\s\s\s\s\s\s\s\s-end - Regex \\S \\d \\D \\w \\W - \\d+ - Escape char: \u0020 \u00A0 \u2000 \u3000 \uFEFF \u200B \u200C \u200D \u2028 \u2029 - END - """; + This is text block + This will join \ + with the line : %s + "quote" = "added" + Escape Start \n \t \r \b \f end + Space Escape-\s\s\s\s\s\s\s\s\s\s-end + Regex \\S \\d \\D \\w \\W + \\d+ + Escape char: \u0020 \u00A0 \u2000 \u3000 \uFEFF \u200B \u200C \u200D \u2028 \u2029 + END + """ + .formatted(new Person("Foo", 20)); out.println(textBlock); } }