Proposed Rule Name: UseJavaTimePackage
Proposed Category: Error Prone
Description:
Please create a rule that flags the usage of the following classes in the java.util
package.
These classes are difficult to use and get right. They are also mutable and cannot easily be shared among threads. The classes in java.time
are much easier to use and immutable.
Code Sample:
The following code uses GregorianCalendar
and assumes the default time zone and locale.
new GregorianCalendar(2020, 10, 22);
This code uses Instant
and is always in UTC. The java.time
package provides other date objects that handle non-UTC time zones.
Possible Properties:
Can you think of some properties?
linusjf, Springvar and UncleOwen
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4