google / google/error-prone

Suggested bug criterion: subtracting from currentTimeMillis()

Open
#704 0 comments 1 reaction 0 assignees View on GitHub
Type-NewCheck
Dominant language
Java
Stars
7.2k
Forks
820
Avg merge
5h 9m
Merged PRs (30d)
50

Description

If a programmer stores System.currentTimeMillis() in a local variable, then later subtracts that variable from currentTimeMillis(), it is almost certainly incorrect (they should probably be using nanoTime()). This seems like it might match the https://github.com/google/error-prone/wiki/Criteria-for-new-checks .

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.