spring-projects / spring-projects/spring-security

Null safety via JSpecify

Open
#16,882 0 comments 1 reaction 1 assignee View on GitHub

@rwinch is already working on this.

Since Jul 15, 2025.

type: enhancement type: theme
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

Spring Security should adopt JSpecify for Null safety as is done in Spring Framework

Related https://github.com/spring-projects/spring-framework/issues/28797

Notes on Changes

Prior to this work, passwords were sometimes treated as never null, but the reality is that they could be null (when clearCredentials was invoked). This inconsistency was also present in APIs (e.g. PasswordEncoder) that produced and consumed passwords. The semantic meaning of a null password is now clearly defined as no password for the user.

NOTE: This is done in the parent issue vs each module because things like nullability of passwords impacts more than just the core project where the API is defined.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.