Buggy code:
public class Calendar extends CordovaPlugin { public static final String ACTION_OPEN_CALENDAR = "openCalendar" ; public static final String ACTION_CREATE_EVENT_WITH_OPTIONS = "createEventWithOptions" ; public static final String ACTION_CREATE_EVENT_INTERACTIVELY = "createEventInteractively" ; public static final String ACTION_DELETE_EVENT = "deleteEvent" ; public static final String ACTION_FIND_EVENT = "findEvent" ; public static final String ACTION_LIST_EVENTS_IN_RANGE = "listEventsInRange" ; public static final String ACTION_LIST_EVENT_INSTANCES = "listEventInstances" ; public static final String ACTION_LIST_CALENDARS = "listCalendars" ; public static final String ACTION_CREATE_CALENDAR = "createCalendar" ; public static final Integer RESULT_CODE_CREATE = 0 ; public static final Integer RESULT_CODE_OPENCAL = 1 ; private CallbackContext callback ; private static final String LOG_TAG = AbstractCalendarAccessor . LOG_TAG ; @ Override public boolean execute ( String action , JSONArray args , CallbackContext callbackContext ) throws JSONException { } private boolean openCalendarLegacy ( JSONArray args ) throws JSONException { } @ TargetApi ( 14 ) private boolean openCalendar ( JSONArray args ) throws JSONException { } private boolean listCalendars ( ) throws JSONException { } private boolean createCalendar ( JSONArray args ) { } private boolean createEventInteractively ( JSONArray args ) throws JSONException { } private AbstractCalendarAccessor calendarAccessor ; private AbstractCalendarAccessor getCalendarAccessor ( ) { } private boolean deleteEvent ( JSONArray args ) { } private boolean findEvents ( JSONArray args ) { } private boolean createEvent ( JSONArray args ) { } private boolean listEventsInRange ( JSONArray args ) { } private boolean listEventInstances ( JSONArray args ) { if ( ( VERSION . SDK_INT ) < 8 ) { return false ; } try { ContentResolver contentResolver = this . cordova . getActivity ( ) . getContentResolver ( ) ; JSONObject jsonFilter = args . getJSONObject ( 0 ) ; JSONArray result = new JSONArray ( ) ; long input_start_date = jsonFilter . getLong ( "startTime" ) ; long input_end_date = jsonFilter . getLong ( "endTime" ) ; JSONArray calendardIds = jsonFilter . optArray ( "calendarIds" ) ; Uri l_isntanceUri = Uri . parse ( ( ( ( "content:////com.android.calendar//instances//when//" + input_start_date ) + "//" ) + input_end_date ) ) ; String [ ] l_projection = new String [ ] { "calendar_id" , "event_id" , "title" , "begin" , "end" , "eventLocation" , "allDay" , "rrule" } ; String inCalendarAnd = "" ; if ( ( calendardIds != null ) && ( ( calendardIds . length ( ) ) > 0 ) ) { <START_BUG> inCalendarAnd += "(calendar_id<seq2seq4repair_space>IN<seq2seq4repair_space>(" + ( calId ) ; <END_BUG> for ( int i = 0 ; i < ( calendardIds . length ( ) ) ; i ++ ) { String calId = calendardIds . getString ( i ) ; if ( i > 0 ) { inCalendarAnd += ",<seq2seq4repair_space>" ; } inCalendarAnd += calId ; } inCalendarAnd += "))<seq2seq4repair_space>AND<seq2seq4repair_space>" ; } Cursor cursor = contentResolver . query ( l_isntanceUri , l_projection , ( ( "(" + inCalendarAnd ) + "deleted<seq2seq4repair_space>=<seq2seq4repair_space>0)" ) , null , "begin<seq2seq4repair_space>ASC" ) ; int i = 0 ; while ( cursor . moveToNext ( ) ) { result . put ( ( i ++ ) , new JSONObject ( ) . put ( "calendar_id" , cursor . getString ( cursor . getColumnIndex ( "calendar_id" ) ) ) . put ( "event_id" , cursor . getString ( cursor . getColumnIndex ( "event_id" ) ) ) . put ( "title" , cursor . getString ( cursor . getColumnIndex ( "title" ) ) ) . put ( "begin" , cursor . getLong ( cursor . getColumnIndex ( "begin" ) ) ) . put ( "end" , cursor . getLong ( cursor . getColumnIndex ( "end" ) ) ) . put ( "eventLocation" , cursor . getString ( cursor . getColumnIndex ( "eventLocation" ) ) ) . put ( "allDay" , cursor . getInt ( cursor . getColumnIndex ( "allDay" ) ) ) . put ( "rrule" , cursor . getString ( cursor . getColumnIndex ( "rrule" ) ) ) ) ; } PluginResult res = new PluginResult ( Status . OK , result ) ; callback . sendPluginResult ( res ) ; return true ; } catch ( Exception e ) { System . err . println ( ( "Exception:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } return false ; } public void onActivityResult ( int requestCode , int resultCode , Intent data ) { } }

Fix:
inCalendarAnd += "(calendar_id<seq2seq4repair_space>IN<seq2seq4repair_space>(" ;