SI-4788/SI-5948 Respect RetentionPolicy of Java annotations

Looks like you could do `.flatten. getOrElse(AnnotationRetentionPolicyClassValue)` instead of putting the default twice