SI-4788 Respect RetentionPolicy of Java annotations

Also closes SI-5420 and SI-5948.
Argh, looks like an oversight from a different commit.
I'll put this and the other change into a separate change.

The difference is that `System.nanoTime` measures elapsed time (which is guaranteed to only increase monotonically on most platforms in a thread (thanks, Microsoft for messing this up)), while `System.currentTimeMillis` tracks time since epoch (which can easily jump forward and backward).