Buggy code:
@ Path ( "//studios" ) public class StudiosResource { private static final int SPACE_TO_INDENTS_EACH_LEVEL = 2 ; private static final String STUDIO_ID_WAS_NOT_FOUND_ERROR_JSON = "{\"error\":\"Studio<seq2seq4repair_space>with<seq2seq4repair_space>id<seq2seq4repair_space>\'%d\'<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>found\"}" ; private static final String STUDIO_ID_ROOM_ID_WAS_NOT_FOUND_ERROR_JSON = "{\"error\":\"Room<seq2seq4repair_space>with<seq2seq4repair_space>id<seq2seq4repair_space>%d<seq2seq4repair_space>in<seq2seq4repair_space>studio<seq2seq4repair_space>with<seq2seq4repair_space>id<seq2seq4repair_space>\'%d\'<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>found\"}" ; private static final String APPIONTMENT_UNAVAILABLE_ERROR_JSON = "{\"error\":\"Room<seq2seq4repair_space>with<seq2seq4repair_space>id<seq2seq4repair_space>%d<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>available<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>wanted<seq2seq4repair_space>time\"}" ; @ GET @ Path ( "//{id}" ) @ Produces ( MediaType . APPLICATION_JSON ) public Response getStudioByID ( @ PathParam ( "id" ) int id ) { } @ GET @ RequireLoggedStudio @ Path ( "//schedule//{roomId}" ) @ Produces ( MediaType . APPLICATION_JSON ) public Response getAppointment ( @ PathParam ( "roomId" ) int roomId , @ Context HttpServletRequest request ) throws Exception , JSONException { } @ POST @ Path ( "//schedule" ) @ RequireLoggedBand @ Produces ( MediaType . APPLICATION_JSON ) @ Consumes ( MediaType . APPLICATION_JSON ) public Response setAppointment ( String dataStr , @ Context HttpServletRequest request ) { try { <START_BUG> SimpleDateFormat format = new SimpleDateFormat ( "yyyy-MM-dd<seq2seq4repair_space>HH:mm" ) ; <END_BUG> JSONObject data = new JSONObject ( dataStr ) ; int roomId = data . getInt ( "roomId" ) ; Date start = format . parse ( data . getString ( "start" ) ) ; Date end = format . parse ( data . getString ( "end" ) ) ; JSONArray queryRes = MainDBHandler . select ( ( ( ( ( ( ( ( "select<seq2seq4repair_space>count(*)<seq2seq4repair_space>as<seq2seq4repair_space>count<seq2seq4repair_space>from<seq2seq4repair_space>ROOM_SCHEDULE<seq2seq4repair_space>" + "where<seq2seq4repair_space>ROOM_ID<seq2seq4repair_space>=<seq2seq4repair_space>" ) + roomId ) + "<seq2seq4repair_space>and<seq2seq4repair_space>START_TIME<seq2seq4repair_space><<seq2seq4repair_space>'" ) + ( format . format ( end ) ) ) + "'<seq2seq4repair_space>and<seq2seq4repair_space>END_TIME<seq2seq4repair_space>><seq2seq4repair_space>'" ) + ( format . format ( start ) ) ) + "'" ) ) ; if ( ( queryRes . getJSONObject ( 0 ) . getInt ( "count" ) ) > 0 ) { String errorJson = String . format ( StudiosResource . APPIONTMENT_UNAVAILABLE_ERROR_JSON , roomId ) ; return Response . status ( SC_CONFLICT ) . entity ( errorJson ) . build ( ) ; } else { JSONObject user = SessionManager . getLoggedInUser ( request ) ; queryRes = MainDBHandler . selectWithParameters ( "select<seq2seq4repair_space>ID<seq2seq4repair_space>from<seq2seq4repair_space>BANDS<seq2seq4repair_space>where<seq2seq4repair_space>USER_ID<seq2seq4repair_space>=<seq2seq4repair_space>?" , user . getInt ( "id" ) ) ; int bandId = queryRes . getJSONObject ( 0 ) . getInt ( "id" ) ; MainDBHandler . insertWithAutoKey ( ( ( ( ( ( ( ( ( ( "insert<seq2seq4repair_space>into<seq2seq4repair_space>ROOM_SCHEDULE<seq2seq4repair_space>(ROOM_ID,<seq2seq4repair_space>BAND_ID,<seq2seq4repair_space>START_TIME,<seq2seq4repair_space>END_TIME)<seq2seq4repair_space>" + "values(" ) + roomId ) + "," ) + bandId ) + ",'" ) + ( format . format ( start ) ) ) + "','" ) + ( format . format ( end ) ) ) + "')" ) , PreparedStatement . NO_GENERATED_KEYS ) ; return Response . ok ( "{\"message\":<seq2seq4repair_space>\"success\"}" ) . build ( ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; return Response . serverError ( ) . build ( ) ; } } @ POST @ Produces ( MediaType . APPLICATION_JSON ) @ Consumes ( MediaType . APPLICATION_JSON ) public Response addStudio ( String dataStr , @ Context HttpServletRequest Request ) { } @ GET @ Path ( "//{studioID}//{roomID}" ) @ Produces ( MediaType . APPLICATION_JSON ) public Response getStudioRoomByID ( @ PathParam ( "studioID" ) int studioID , @ PathParam ( "roomID" ) int roomID ) { } @ GET @ Produces ( MediaType . APPLICATION_JSON ) public Response search ( @ Context UriInfo info ) { } @ GET @ Path ( "//mostviewed" ) @ Produces ( MediaType . APPLICATION_JSON ) public Response getMostViewed ( ) { } @ GET @ Path ( "//recent" ) @ Produces ( MediaType . APPLICATION_JSON ) public Response getMostRecent ( ) { } private String getRedisQueryKey ( MultivaluedMap < String , String > queryMap ) { } }

Fix:
SimpleDateFormat format = new SimpleDateFormat ( "yyyy-MM-dd<seq2seq4repair_space>HH:mm:ss" ) ;