Java, null, and JSpecify

  Рет қаралды 2,712

nipafx

nipafx

Күн бұрын

Пікірлер: 11
@bkoprucu
@bkoprucu 11 ай бұрын
Well thought out approach to the enduring null problem. This should succeed. I'll give it a try.
@chrispie5
@chrispie5 11 ай бұрын
Aweseome approach. Any maven/gradle examples to play with it and see how the setup is done?
@TheBigLou13
@TheBigLou13 11 ай бұрын
Integer i = 0; // nullable int i = 0; // not nullable
@creamycoffee
@creamycoffee 11 ай бұрын
Now do that with String.
@TheBigLou13
@TheBigLou13 10 ай бұрын
​@@creamycoffee ​​​int is the same as char. String is the same as char array. Arrays have dynamic length and can be null. If you work with non-primitive data types like that use Optional - its made for that purpose. If you run into Optionals being null you're using them wrong: You should never receive (nullable) Optionals - instead, when you receive (nullable) non-primitive data, you can wrap them in an Optional before using them, e.g. using Optional.of(...);
@juancarlospizarromendez3954
@juancarlospizarromendez3954 11 ай бұрын
null.equals(null) gives me true; this = equal; this.equals(null) gives me true; that's a technical joke!
@TheBigLou13
@TheBigLou13 10 ай бұрын
null.equals() returns a NullPointerException because you're literally pointing to a null and calling a method on it. You're pointing at the absence of something and ask it to do something. That doesn't make sense. You *_can_* check if ( null == null ).
@JorgetePanete
@JorgetePanete 10 ай бұрын
I would love some flag like "nonullness", that without annotations makes everything non-nullable
@TheBigLou13
@TheBigLou13 9 ай бұрын
String notNull = Optional.of(nullable).orElse("ValueIfNull");
@JorgetePanete
@JorgetePanete 9 ай бұрын
@@TheBigLou13 Yeah, without putting that everywhere
@steshaw6510
@steshaw6510 3 ай бұрын
They call it @NullMarked. You can put the annotation at the package or module level.
State of Pattern Matching with Brian Goetz
19:59
nipafx
Рет қаралды 2,5 М.
風船をキャッチしろ!🎈 Balloon catch Challenges
00:57
はじめしゃちょー(hajime)
Рет қаралды 83 МЛН
FOREVER BUNNY
00:14
Natan por Aí
Рет қаралды 16 МЛН
ЛУЧШИЙ ФОКУС + секрет! #shorts
00:12
Роман Magic
Рет қаралды 38 МЛН
ThreadLocal in Java
10:59
Defog Tech
Рет қаралды 187 М.
How Project Valhalla And JSpecify Can Kill NPEs
21:54
nipafx
Рет қаралды 3,7 М.
Java's Quirks and Wrong (?) Defaults with Brian Goetz
51:39
This Algorithm is 1,606,240% FASTER
13:31
ThePrimeagen
Рет қаралды 851 М.
Windsurf IDE Real Java Challenges
27:56
GrabDuck!
Рет қаралды 643
Microservices are Technical Debt
31:59
NeetCodeIO
Рет қаралды 632 М.
Implementing New Java Stream Operations
38:05
nipafx
Рет қаралды 4,3 М.
Modern Java in Action
50:32
Java
Рет қаралды 39 М.
風船をキャッチしろ!🎈 Balloon catch Challenges
00:57
はじめしゃちょー(hajime)
Рет қаралды 83 МЛН