Program: 32509
Project: 32509
Buggy source:
@Override protected JSONObject getExpectedParameters(int sdlVersion){
  JSONObject result=new JSONObject(), audioPass=new JSONObject(), softButton=new JSONObject(), button=new JSONObject(), display=new JSONObject(), image=new JSONObject(), resolution=new JSONObject(), screen=new JSONObject(), touch=new JSONObject(), field=new JSONObject();
  JSONArray fields=new JSONArray(), images=new JSONArray(), buttons=new JSONArray(), softButtons=new JSONArray(), audioPasses=new JSONArray();
  try {
    audioPass.put(AudioPassThruCapabilities.KEY_AUDIO_TYPE,AudioType.PCM);
    audioPass.put(AudioPassThruCapabilities.KEY_SAMPLING_RATE,SamplingRate._8KHZ);
    audioPass.put(AudioPassThruCapabilities.KEY_BITS_PER_SAMPLE,BitsPerSample._8_BIT);
    audioPasses.put(audioPass);
    audioPass=new JSONObject();
    audioPass.put(AudioPassThruCapabilities.KEY_AUDIO_TYPE,AudioType.PCM);
    audioPass.put(AudioPassThruCapabilities.KEY_SAMPLING_RATE,SamplingRate._16KHZ);
    audioPass.put(AudioPassThruCapabilities.KEY_BITS_PER_SAMPLE,BitsPerSample._8_BIT);
    audioPasses.put(audioPass);
    softButton.put(SoftButtonCapabilities.KEY_IMAGE_SUPPORTED,false);
    softButton.put(SoftButtonCapabilities.KEY_UP_DOWN_AVAILABLE,true);
    softButton.put(SoftButtonCapabilities.KEY_LONG_PRESS_AVAILABLE,true);
    softButton.put(SoftButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE,true);
    softButtons.put(softButton);
    softButton=new JSONObject();
    softButton.put(SoftButtonCapabilities.KEY_IMAGE_SUPPORTED,true);
    softButton.put(SoftButtonCapabilities.KEY_UP_DOWN_AVAILABLE,false);
    softButton.put(SoftButtonCapabilities.KEY_LONG_PRESS_AVAILABLE,false);
    softButton.put(SoftButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE,false);
    softButtons.put(softButton);
    button.put(ButtonCapabilities.KEY_NAME,ButtonName.OK);
    button.put(ButtonCapabilities.KEY_UP_DOWN_AVAILABLE,false);
    button.put(ButtonCapabilities.KEY_LONG_PRESS_AVAILABLE,true);
    button.put(ButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE,true);
    buttons.put(button);
    button=new JSONObject();
    button.put(ButtonCapabilities.KEY_NAME,ButtonName.CUSTOM_BUTTON);
    button.put(ButtonCapabilities.KEY_UP_DOWN_AVAILABLE,true);
    button.put(ButtonCapabilities.KEY_LONG_PRESS_AVAILABLE,false);
    button.put(ButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE,false);
    resolution.put(ImageResolution.KEY_RESOLUTION_HEIGHT,10);
    resolution.put(ImageResolution.KEY_RESOLUTION_WIDTH,10);
    image.put(ImageField.KEY_NAME,ImageFieldName.appIcon.name());
    image.put(ImageField.KEY_IMAGE_RESOLUTION,resolution);
    image.put(ImageField.KEY_IMAGE_TYPE_SUPPORTED,FileType.BINARY);
    images.put(image);
    resolution=new JSONObject();
    resolution.put(ImageResolution.KEY_RESOLUTION_HEIGHT,50);
    resolution.put(ImageResolution.KEY_RESOLUTION_WIDTH,50);
    image=new JSONObject();
    image.put(ImageField.KEY_NAME,ImageFieldName.graphic.name());
    image.put(ImageField.KEY_IMAGE_RESOLUTION,resolution);
    image.put(ImageField.KEY_IMAGE_TYPE_SUPPORTED,FileType.GRAPHIC_JPEG);
    images.put(image);
    touch.put(TouchEventCapabilities.KEY_PRESS_AVAILABLE,true);
    touch.put(TouchEventCapabilities.KEY_MULTI_TOUCH_AVAILABLE,false);
    touch.put(TouchEventCapabilities.KEY_DOUBLE_PRESS_AVAILABLE,true);
    screen.put(ScreenParams.KEY_RESOLUTION,resolution);
    screen.put(ScreenParams.KEY_TOUCH_EVENT_AVAILABLE,touch);
    field.put(TextField.KEY_NAME,TextFieldName.ETA);
    field.put(TextField.KEY_WIDTH,5);
    field.put(TextField.KEY_ROWS,5);
    field.put(TextField.KEY_CHARACTER_SET,CharacterSet.TYPE5SET);
    fields.put(field);
    field=new JSONObject();
    field.put(TextField.KEY_NAME,TextFieldName.ETA);
    field.put(TextField.KEY_WIDTH,10);
    field.put(TextField.KEY_ROWS,10);
    field.put(TextField.KEY_CHARACTER_SET,CharacterSet.TYPE2SET);
    fields.put(field);
    display.put(DisplayCapabilities.KEY_DISPLAY_TYPE,DisplayType.CID);
    display.put(DisplayCapabilities.KEY_GRAPHIC_SUPPORTED,true);
    display.put(DisplayCapabilities.KEY_IMAGE_FIELDS,images);
    display.put(DisplayCapabilities.KEY_MEDIA_CLOCK_FORMATS,JsonUtils.createJsonArrayOfJsonNames(mediaClockFormatList,SDL_VERSION_UNDER_TEST));
    display.put(DisplayCapabilities.KEY_NUM_CUSTOM_PRESETS_AVAILABLE,1);
    display.put(DisplayCapabilities.KEY_SCREEN_PARAMS,screen);
    display.put(DisplayCapabilities.KEY_TEMPLATES_AVAILABLE,JsonUtils.createJsonArray(temps));
    display.put(DisplayCapabilities.KEY_TEXT_FIELDS,fields);
    result.put(RegisterAppInterfaceResponse.KEY_LANGUAGE,LANGUAGE);
    result.put(RegisterAppInterfaceResponse.KEY_HMI_DISPLAY_LANGUAGE,HMI_LANGUAGE);
    result.put(RegisterAppInterfaceResponse.KEY_SUPPORTED_DIAG_MODES,JsonUtils.createJsonArray(SUPPORTED_DIAG_MODES));
    result.put(RegisterAppInterfaceResponse.KEY_SDL_MSG_VERSION,SDL_MSG_VERSION.serializeJSON());
    result.put(RegisterAppInterfaceResponse.KEY_VEHICLE_TYPE,VEHICLE_TYPE.serializeJSON());
    result.put(RegisterAppInterfaceResponse.KEY_PRESET_BANK_CAPABILITIES,PRESET_BANK_CAPABILITIES.serializeJSON());
    result.put(RegisterAppInterfaceResponse.KEY_DISPLAY_CAPABILITIES,display);
    result.put(RegisterAppInterfaceResponse.KEY_BUTTON_CAPABILITIES,buttons);
    result.put(RegisterAppInterfaceResponse.KEY_SOFT_BUTTON_CAPABILITIES,softButtons);
    result.put(RegisterAppInterfaceResponse.KEY_AUDIO_PASS_THRU_CAPABILITIES,audioPasses);
    result.put(RegisterAppInterfaceResponse.KEY_SPEECH_CAPABILITIES,JsonUtils.createJsonArrayOfJsonNames(SPEECH_CAPABILITIES,SDL_VERSION_UNDER_TEST));
    result.put(RegisterAppInterfaceResponse.KEY_VR_CAPABILITIES,JsonUtils.createJsonArrayOfJsonNames(VR_CAPABILITIES,SDL_VERSION_UNDER_TEST));
    result.put(RegisterAppInterfaceResponse.KEY_HMI_ZONE_CAPABILITIES,JsonUtils.createJsonArrayOfJsonNames(HMI_ZONE_CAPABILITIES,SDL_VERSION_UNDER_TEST));
    result.put(RegisterAppInterfaceResponse.KEY_PRERECORDED_SPEECH,JsonUtils.createJsonArrayOfJsonNames(PRERECORDED_SPEECH,SDL_VERSION_UNDER_TEST));
  }
 catch (  JSONException e) {
  }
  return result;
}

Fixed version (ground truth):
@Override protected JSONObject getExpectedParameters(int sdlVersion){
  JSONObject result=new JSONObject(), audioPass=new JSONObject(), softButton=new JSONObject(), button=new JSONObject(), display=new JSONObject(), image=new JSONObject(), resolution=new JSONObject(), screen=new JSONObject(), touch=new JSONObject(), field=new JSONObject();
  JSONArray fields=new JSONArray(), images=new JSONArray(), buttons=new JSONArray(), softButtons=new JSONArray(), audioPasses=new JSONArray();
  try {
    audioPass.put(AudioPassThruCapabilities.KEY_AUDIO_TYPE,AudioType.PCM);
    audioPass.put(AudioPassThruCapabilities.KEY_SAMPLING_RATE,SamplingRate._8KHZ);
    audioPass.put(AudioPassThruCapabilities.KEY_BITS_PER_SAMPLE,BitsPerSample._8_BIT);
    audioPasses.put(audioPass);
    audioPass=new JSONObject();
    audioPass.put(AudioPassThruCapabilities.KEY_AUDIO_TYPE,AudioType.PCM);
    audioPass.put(AudioPassThruCapabilities.KEY_SAMPLING_RATE,SamplingRate._16KHZ);
    audioPass.put(AudioPassThruCapabilities.KEY_BITS_PER_SAMPLE,BitsPerSample._16_BIT);
    audioPasses.put(audioPass);
    softButton.put(SoftButtonCapabilities.KEY_IMAGE_SUPPORTED,false);
    softButton.put(SoftButtonCapabilities.KEY_UP_DOWN_AVAILABLE,true);
    softButton.put(SoftButtonCapabilities.KEY_LONG_PRESS_AVAILABLE,true);
    softButton.put(SoftButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE,true);
    softButtons.put(softButton);
    softButton=new JSONObject();
    softButton.put(SoftButtonCapabilities.KEY_IMAGE_SUPPORTED,true);
    softButton.put(SoftButtonCapabilities.KEY_UP_DOWN_AVAILABLE,false);
    softButton.put(SoftButtonCapabilities.KEY_LONG_PRESS_AVAILABLE,false);
    softButton.put(SoftButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE,false);
    softButtons.put(softButton);
    button.put(ButtonCapabilities.KEY_NAME,ButtonName.OK);
    button.put(ButtonCapabilities.KEY_UP_DOWN_AVAILABLE,false);
    button.put(ButtonCapabilities.KEY_LONG_PRESS_AVAILABLE,true);
    button.put(ButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE,true);
    buttons.put(button);
    button=new JSONObject();
    button.put(ButtonCapabilities.KEY_NAME,ButtonName.CUSTOM_BUTTON);
    button.put(ButtonCapabilities.KEY_UP_DOWN_AVAILABLE,false);
    button.put(ButtonCapabilities.KEY_LONG_PRESS_AVAILABLE,false);
    button.put(ButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE,false);
    buttons.put(button);
    button=new JSONObject();
    button.put(ButtonCapabilities.KEY_NAME,ButtonName.CUSTOM_BUTTON);
    button.put(ButtonCapabilities.KEY_UP_DOWN_AVAILABLE,true);
    button.put(ButtonCapabilities.KEY_LONG_PRESS_AVAILABLE,false);
    button.put(ButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE,false);
    resolution.put(ImageResolution.KEY_RESOLUTION_HEIGHT,10);
    resolution.put(ImageResolution.KEY_RESOLUTION_WIDTH,10);
    image.put(ImageField.KEY_NAME,ImageFieldName.appIcon);
    image.put(ImageField.KEY_IMAGE_RESOLUTION,resolution);
    JSONArray imageTypes=new JSONArray();
    imageTypes.put(FileType.BINARY);
    image.put(ImageField.KEY_IMAGE_TYPE_SUPPORTED,imageTypes);
    images.put(image);
    resolution=new JSONObject();
    resolution.put(ImageResolution.KEY_RESOLUTION_HEIGHT,50);
    resolution.put(ImageResolution.KEY_RESOLUTION_WIDTH,50);
    image=new JSONObject();
    image.put(ImageField.KEY_NAME,ImageFieldName.graphic);
    image.put(ImageField.KEY_IMAGE_RESOLUTION,resolution);
    imageTypes=new JSONArray();
    imageTypes.put(FileType.GRAPHIC_JPEG);
    image.put(ImageField.KEY_IMAGE_TYPE_SUPPORTED,imageTypes);
    images.put(image);
    touch.put(TouchEventCapabilities.KEY_PRESS_AVAILABLE,true);
    touch.put(TouchEventCapabilities.KEY_MULTI_TOUCH_AVAILABLE,false);
    touch.put(TouchEventCapabilities.KEY_DOUBLE_PRESS_AVAILABLE,true);
    screen.put(ScreenParams.KEY_RESOLUTION,resolution);
    screen.put(ScreenParams.KEY_TOUCH_EVENT_AVAILABLE,touch);
    field.put(TextField.KEY_NAME,TextFieldName.ETA);
    field.put(TextField.KEY_WIDTH,5);
    field.put(TextField.KEY_ROWS,5);
    field.put(TextField.KEY_CHARACTER_SET,CharacterSet.TYPE5SET);
    fields.put(field);
    field=new JSONObject();
    field.put(TextField.KEY_NAME,TextFieldName.ETA);
    field.put(TextField.KEY_WIDTH,10);
    field.put(TextField.KEY_ROWS,10);
    field.put(TextField.KEY_CHARACTER_SET,CharacterSet.TYPE2SET);
    fields.put(field);
    display.put(DisplayCapabilities.KEY_DISPLAY_TYPE,DisplayType.CID);
    display.put(DisplayCapabilities.KEY_GRAPHIC_SUPPORTED,true);
    display.put(DisplayCapabilities.KEY_IMAGE_FIELDS,images);
    display.put(DisplayCapabilities.KEY_MEDIA_CLOCK_FORMATS,JsonUtils.createJsonArrayOfJsonNames(mediaClockFormatList,SDL_VERSION_UNDER_TEST));
    display.put(DisplayCapabilities.KEY_NUM_CUSTOM_PRESETS_AVAILABLE,1);
    display.put(DisplayCapabilities.KEY_SCREEN_PARAMS,screen);
    display.put(DisplayCapabilities.KEY_TEMPLATES_AVAILABLE,JsonUtils.createJsonArray(temps));
    display.put(DisplayCapabilities.KEY_TEXT_FIELDS,fields);
    result.put(RegisterAppInterfaceResponse.KEY_LANGUAGE,LANGUAGE);
    result.put(RegisterAppInterfaceResponse.KEY_HMI_DISPLAY_LANGUAGE,HMI_LANGUAGE);
    result.put(RegisterAppInterfaceResponse.KEY_SUPPORTED_DIAG_MODES,JsonUtils.createJsonArray(SUPPORTED_DIAG_MODES));
    result.put(RegisterAppInterfaceResponse.KEY_SDL_MSG_VERSION,SDL_MSG_VERSION.serializeJSON());
    result.put(RegisterAppInterfaceResponse.KEY_VEHICLE_TYPE,VEHICLE_TYPE.serializeJSON());
    result.put(RegisterAppInterfaceResponse.KEY_PRESET_BANK_CAPABILITIES,PRESET_BANK_CAPABILITIES.serializeJSON());
    result.put(RegisterAppInterfaceResponse.KEY_DISPLAY_CAPABILITIES,display);
    result.put(RegisterAppInterfaceResponse.KEY_BUTTON_CAPABILITIES,buttons);
    result.put(RegisterAppInterfaceResponse.KEY_SOFT_BUTTON_CAPABILITIES,softButtons);
    result.put(RegisterAppInterfaceResponse.KEY_AUDIO_PASS_THRU_CAPABILITIES,audioPasses);
    result.put(RegisterAppInterfaceResponse.KEY_SPEECH_CAPABILITIES,JsonUtils.createJsonArrayOfJsonNames(SPEECH_CAPABILITIES,SDL_VERSION_UNDER_TEST));
    result.put(RegisterAppInterfaceResponse.KEY_VR_CAPABILITIES,JsonUtils.createJsonArrayOfJsonNames(VR_CAPABILITIES,SDL_VERSION_UNDER_TEST));
    result.put(RegisterAppInterfaceResponse.KEY_HMI_ZONE_CAPABILITIES,JsonUtils.createJsonArrayOfJsonNames(HMI_ZONE_CAPABILITIES,SDL_VERSION_UNDER_TEST));
    result.put(RegisterAppInterfaceResponse.KEY_PRERECORDED_SPEECH,JsonUtils.createJsonArrayOfJsonNames(PRERECORDED_SPEECH,SDL_VERSION_UNDER_TEST));
  }
 catch (  JSONException e) {
  }
  return result;
}