Skip to content

Commit

Permalink
chore: jspecify 0.3 annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
sureshg committed Dec 14, 2022
1 parent ebefea2 commit 50a7048
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
5 changes: 3 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion script.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
28 changes: 17 additions & 11 deletions src/main/java/dev/suresh/adt/DOP.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 50a7048

Please sign in to comment.