java: Method uses the same code for two switch clauses

Change-Id: Ied82b0a39ff9dc9c7cc9539dec2b963059f3d4a5
Reviewed-on: https://gerrit.libreoffice.org/12139
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>