Buggy code:
@ With ( Secure . class ) public class EventController extends Controller { static final DateTimeFormatter dateTimeInputFormatter = DateTimeFormat . forPattern ( "dd//MM//yyyy,<seq2seq4repair_space>HH:mm" ) ; static final DateTimeFormatter birthdayFormatter = DateTimeFormat . forPattern ( "dd//MM//yyyy" ) ; public static String message = null ; public static void searchEvent ( String eventName , String calendarOwner , String displayedCalendarId , String s_activeDate ) { } public static void showEvents ( long calendarId , String username , String calendarName ) { } public static void createEvent ( @ Required long calendarId , @ Required String name , @ Required String start , @ Required String end , Visibility visibility , Interval interval , String description , String s_activeDate , boolean isOpen , boolean forceCreate ) { } public static void saveEditedEvent ( @ Required long eventId , @ Required long calendarId , @ Required String name , @ Required String start , @ Required String end , Visibility visibility , Interval interval , String description , String s_activeDate , boolean isOpen , boolean forceCreate ) { } public static void addEditEvent ( long eventId , long calendarId , String name , String s_activeDate , String message ) { } public static void removeEvent ( long calendarId , long eventId , String s_activeDate ) { } public static void cancelEventRepetition ( long calendarId , long eventId , String s_activeDate ) { } public static void removeRepeatingEvents ( long calendarId , long eventId , String s_activeDate ) { } <START_BUG> public static void addUserToEvent ( String userWatchingStr , String userToAddStr , String calendarOwnerStr , long eventCalendarId , long eventId , String s_eventDate , long calendarId ) { <END_BUG> DateTime activeDate = EventController . dateTimeInputFormatter . parseDateTime ( s_eventDate ) ; Event event = null ; User me = Database . getUserByName ( Security . connected ( ) ) ; User userToAdd = Database . getUserByName ( userToAddStr ) ; User calendarOwner = Database . getUserByName ( calendarOwnerStr ) ; Calendar cal = calendarOwner . getCalendarById ( eventCalendarId ) ; if ( ! ( cal . getAllVisibleEventsOfDate ( activeDate . getDayOfMonth ( ) , activeDate . getMonthOfYear ( ) , activeDate . getYear ( ) , me ) . equals ( null ) ) ) { for ( Event e : cal . getAllVisibleEventsOfDate ( activeDate . getDayOfMonth ( ) , activeDate . getMonthOfYear ( ) , activeDate . getYear ( ) , me ) ) { if ( ( e . getId ( ) ) == eventId ) { event = e ; } } } System . out . println ( "========================================================" ) ; System . out . println ( ( "userToAddStr:" + userToAddStr ) ) ; System . out . println ( ( "userWatchingStr:" + userWatchingStr ) ) ; System . out . println ( ( "calendarOwnerStr:" + calendarOwnerStr ) ) ; System . out . println ( "========================================================" ) ; String s_activeDate = s_eventDate ; if ( event . isOpen ( ) ) { if ( userToAdd == ( event . getOwner ( ) ) ) event . addUserToAttending ( userToAdd ) ; else { if ( me == userToAdd ) event . addUserToAttending ( userToAdd ) ; else event . sendInvitationRequest ( userToAdd ) ; } } else event . sendInvitationRequest ( userToAdd ) ; String user = userWatchingStr ; CalendarController . showCalendar ( calendarId , user , s_activeDate , activeDate . getDayOfMonth ( ) , null ) ; } public static void removeUserFromEvent ( String userToRemoveStr , String eventOwnerStr , long calendarId , long eventId , String s_activeDate ) { } }

Fix:
public static void addUserToEvent ( String userWatchingStr , String userToAddStr , String calendarOwnerStr , long eventCalendarId , long calendarId , long eventId , String s_eventDate ) {