Buggy code:
public class MyPageController implements Controller { private static final int GO_BACK_MONTHS = 12 ; private UserService userService ; private ClubService clubService ; private InvoiceService invoiceService ; public MyPageController ( UserService userService , ClubService clubService , InvoiceService invoiceService ) { } @ Override public void handleGet ( User user , Request request , VelocityContext context ) { } @ Override public String handlePost ( User user , Request request , Map < String , String > errorMap , List < String > infoList ) { } private void saveNoCombinedMembership ( User user , Request request , Map < String , String > errorMap , List < String > infoList ) { } private void addPrincipalToEvent ( User user , Request request , Map < String , String > errorMap , List < String > infoList ) { } private void addPrincipalToTeam ( User user , Request request , Map < String , String > errorMap , List < String > infoList ) { } private void removePrincipalFromTeam ( User user , Request request , Map < String , String > errorMap , List < String > infoList ) { } private void removePrincipalFromEvent ( User user , Request request , Map < String , String > errorMap , List < String > infoList ) { } private void makePrimaryContact ( User user , Request request , Map < String , String > errorMap , List < String > infoList ) { } private void inviteFamilyMember ( User user , Request request , Map < String , String > errorMap , List < String > infoList ) { } private void deletePrincipal ( User user , Request request , Map < String , String > errorMap , List < String > infoList ) { } private Principal getPrincipalFromUsersFamilyByIdStr ( User user , String principalIdStr ) { } private void updateClubMembership ( User user , Request request , Map < String , String > errorMap , List < String > infoList , boolean wantToEnroll ) { } private void addFamilyMember ( User user , Request request , Map < String , String > errorMap , List < String > infoList ) { } private void saveMobile ( User user , Request request , Map < String , String > errorMap , List < String > infoList ) { } private void saveEmail ( User user , Request request , Map < String , String > errorMap , List < String > infoList ) { } private void saveAddress ( User user , Request request , Map < String , String > errorMap , List < String > infoList ) { } private void saveProfile ( User user , Request request , Map < String , String > errorMap , List < String > infoList ) { String name = request . queryParams ( "name" ) ; String birthDateStr = request . queryParams ( "birthdate" ) ; String gender = request . queryParams ( "gender" ) ; if ( ( name == null ) || ( name . isEmpty ( ) ) ) { errorMap . put ( "name" , "Du<seq2seq4repair_space>må<seq2seq4repair_space>oppgi<seq2seq4repair_space>navnet<seq2seq4repair_space>ditt.<seq2seq4repair_space>Vi<seq2seq4repair_space>trenger<seq2seq4repair_space>det<seq2seq4repair_space>for<seq2seq4repair_space>å<seq2seq4repair_space>holde<seq2seq4repair_space>medlemsregistret<seq2seq4repair_space>oppdatert." ) ; } if ( ( name . split ( "<seq2seq4repair_space>" ) . length ) <= 1 ) { errorMap . put ( "name" , "Du<seq2seq4repair_space>må<seq2seq4repair_space>oppgi<seq2seq4repair_space>både<seq2seq4repair_space>fornavn<seq2seq4repair_space>og<seq2seq4repair_space>etternavn." ) ; } if ( ( birthDateStr == null ) || ( birthDateStr . isEmpty ( ) ) ) { errorMap . put ( "birthdate" , "Vi<seq2seq4repair_space>trenger<seq2seq4repair_space>fødselsdatoen<seq2seq4repair_space>din<seq2seq4repair_space>for<seq2seq4repair_space>å<seq2seq4repair_space>kunne<seq2seq4repair_space>beregne<seq2seq4repair_space>riktig<seq2seq4repair_space>treningsavgift." ) ; } Date birthDate = null ; try { <START_BUG> birthDate = new SimpleDateFormat ( "yyyy-MM-dd" ) . parse ( birthDateStr ) ; <END_BUG> } catch ( ParseException e ) { errorMap . put ( "birthdate" , "Vi<seq2seq4repair_space>trenger<seq2seq4repair_space>fødselsdatoen<seq2seq4repair_space>din<seq2seq4repair_space>for<seq2seq4repair_space>å<seq2seq4repair_space>kunne<seq2seq4repair_space>beregne<seq2seq4repair_space>riktig<seq2seq4repair_space>treningsavgift." ) ; } if ( ( gender == null ) || ( gender . isEmpty ( ) ) ) { errorMap . put ( "gender" , "Vi<seq2seq4repair_space>trenger<seq2seq4repair_space>å<seq2seq4repair_space>vite<seq2seq4repair_space>ditt<seq2seq4repair_space>kjønn<seq2seq4repair_space>for<seq2seq4repair_space>å<seq2seq4repair_space>vise<seq2seq4repair_space>de<seq2seq4repair_space>mest<seq2seq4repair_space>relevante<seq2seq4repair_space>treningstilbudene<seq2seq4repair_space>først." ) ; } if ( errorMap . isEmpty ( ) ) { popuplateResponse ( errorMap , infoList , userService . updateProfile ( user , name , birthDate , gender ) ) ; } } private void popuplateResponse ( Map < String , String > errorMap , List < String > infoList , ServiceResponse response ) { } }

Fix:
birthDate = new SimpleDateFormat ( "dd.MM.yyyy" ) . parse ( birthDateStr ) ;