openrewrite / openrewrite/rewrite-migrate-java

Convert java.text.SimpleDateFormat to java.time.format.DateTimeFormatter

Open
#108 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

recipe
Dominant language
Java
Stars
156
Forks
130
Avg merge
20h 57m
Merged PRs (30d)
21

Description

It would be nice if there was a recipe that converts java.text.SimpleDateFormat to java.time.format.DateTimeFormatter as DateTimeFormatter is the more modern way.

Also, for applications that incorrectly have SimpleDateFormat it will make them more thread safe.

For those applications that construct SimpleDateFormat inline it would a bonus if it created the DateTimeFormatter as an instance variable as DateTimeFormatter is thread safe.

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.

Research direction

No source files, tests, or entry points are named. Start by locating existing Java migration recipes for similar API changes and determine how inline SimpleDateFormat construction is handled; done means covering the requested conversion and, where applicable, creating a reusable instance variable for the thread-safe formatter.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.