Java

Java

Made by DeepSource

Detected use of the Date API JAVA-W1072

Anti-pattern
Major

java.util.Date API should be avoided.

Use of the old Date API has been the source of many bugs in various Java programs. The design of this API is heavily criticised by the Java community. Some notable oddities include: 1. Mutability of Date instances. 2. Months being zero indexed. 3. No support for timezones.

Therefore, it is highly recommended to use an alternative API to work with date and time.

Recommended

Replace all usage of Date with Clock if you are on Java version greater than 8. For earlier Java versions, consider using Joda-Time.

References

Exception

If you would like to keep using the Date API, consider adding an ignore rule for this project. See here for more information on that.