> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# java-shared-date-format

> A shared Java SimpleDateFormat is used without visible synchronization.

## What it flags

An unsynchronized call to a static `java.text.SimpleDateFormat` field. If the method runs concurrently, each call can mutate the formatter while another call uses it. [Java API documentation](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/text/SimpleDateFormat.html)

The check recognizes a dedicated lock when a top-level class creates a private formatter in its field declaration and keeps every use under the same lock without sharing the instance. It also skips direct class initialization and calls on enhanced-for variables that shadow the field. Calls inside callbacks declared by an initializer are still checked.

## How to review or fix

Check how the formatter is shared. Synchronize access or give each thread its own instance. Before moving to `DateTimeFormatter`, verify that the pattern and time zone semantics match.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.