Several small Java code cleanups
Unify flat parsing and validation code

We only need one function with some additional args to take care of
this.
Fix license text years string