What if Java had Kotlin-style null-safety without migrating your Spring Boot project to Kotlin? (github.com)
from justicecoder@programming.dev to programming@programming.dev on 01 Apr 15:26
https://programming.dev/post/48126071

I’ve been working on JADEx (Java Advanced Development Extension) which is a safety layer that makes Java safer by adding Null-Safety and Final-by-Default semantics without rewriting Java codes and modifying the JVM.

Quick recap of what JADEx adds to Java:

Today I’m sharing three things that just landed.


1. Lombok support

This was the most requested thing. JADEx now integrates with Lombok via a Delombok pipeline internally. The key motivation: JADEx’s nullability checker needs to see Lombok-generated code (getters, builders, constructors) to avoid blind spots. Without Delombok, nullable fields could silently pass through generated methods unchecked.

@Data
@Builder
@Entity
public class User {
    private String name;
    private String? email;      // @Nullable propagated to getter + builder param
    private Address? address;   // @Nullable propagated to getter + builder param
}

After Delombok, JADEx sees and analyzes the generated code:

// Lombok-generated — JADEx propagates @Nullable into these
@Nullable
public String getEmail() { return this.email; }

public UserBuilder email(@Nullable final String email) { ... }
public UserBuilder address(@Nullable final Address address) { ... }

2. Gradle plugin published

The JADEx Gradle plugin is now on Maven Central and the Gradle Plugin Portal.

plugins {
    id 'io.github.nieuwmijnleven.jadex' version '0.628'
}

jadex {
    sourceDir = 'src/main/jadex'
}

That’s the only change needed to an existing Spring Boot project. Everything else (compilation, Delombok pipeline, .java generation) is handled automatically.


3. JADEx Spring Boot example project


We highly welcome your feedback on JADEx.

Thank you.

#programming

threaded - newest

Zenlix@lemmy.ml on 02 Apr 09:30 collapse

I think null safety is an important step into software security. I like any approaches in that direction. But personally, I would just use kotlin. Kotlin and Java are so good with Interoperability that the transition is quite smooth and easy. Furthermore you get a better and more modern programming language without decades of technical dept.

justicecoder@programming.dev on 02 Apr 11:40 collapse

JADEx is a solution designed to enhance null-safety in Java. Its key advantage is that existing Java developers can gain null-safety and final-by-default semantics without any learning curve. As a result, compared to migrating to Kotlin, JADEx offers a much more cost-effective way to significantly improve the stability of the legacy Java codebases that many companies continue to operate.