nus-yam/ex-repair huggingface dataset:
Program: 32463
Project: 32463
Buggy source:
public void onTransportDisconnected(TransportType type){
  if (altTransportMessager != null) {
    return;
  }
  Log.e(TAG,"String_Node_Str");
  if (registeredApps == null || registeredApps.isEmpty()) {
    Log.w(TAG,"String_Node_Str");
    Intent unregisterIntent=new Intent();
    unregisterIntent.putExtra(HARDWARE_DISCONNECTED,type.name());
    unregisterIntent.putExtra(TransportConstants.ENABLE_LEGACY_MODE_EXTRA,legacyModeEnabled);
    unregisterIntent.setAction(TransportConstants.START_ROUTER_SERVICE_ACTION_SUFFIX);
    sendBroadcast(unregisterIntent);
    return;
  }
  Message message=Message.obtain();
  message.what=TransportConstants.HARDWARE_CONNECTION_EVENT;
  Bundle bundle=new Bundle();
  bundle.putString(HARDWARE_DISCONNECTED,type.name());
  bundle.putBoolean(TransportConstants.ENABLE_LEGACY_MODE_EXTRA,legacyModeEnabled);
  message.setData(bundle);
  notifyClients(message);
synchronized (SESSION_LOCK) {
    sessionMap.clear();
    if (registeredApps == null) {
      return;
    }
    registeredApps.clear();
  }
  Toast.makeText(getBaseContext(),"String_Node_Str" + type.name() + "String_Node_Str",Toast.LENGTH_SHORT).show();
}

Fixed version (ground truth):
public void onTransportDisconnected(TransportType type){
  if (altTransportMessager != null) {
    return;
  }
  Log.e(TAG,"String_Node_Str");
  if (registeredApps == null || registeredApps.isEmpty()) {
    Log.w(TAG,"String_Node_Str");
    Intent unregisterIntent=new Intent();
    unregisterIntent.putExtra(HARDWARE_DISCONNECTED,type.name());
    unregisterIntent.putExtra(TransportConstants.ENABLE_LEGACY_MODE_EXTRA,legacyModeEnabled);
    unregisterIntent.setAction(TransportConstants.START_ROUTER_SERVICE_ACTION_SUFFIX);
    sendBroadcast(unregisterIntent);
  }
 else {
    Message message=Message.obtain();
    message.what=TransportConstants.HARDWARE_CONNECTION_EVENT;
    Bundle bundle=new Bundle();
    bundle.putString(HARDWARE_DISCONNECTED,type.name());
    bundle.putBoolean(TransportConstants.ENABLE_LEGACY_MODE_EXTRA,legacyModeEnabled);
    message.setData(bundle);
    notifyClients(message);
  }
synchronized (SESSION_LOCK) {
    this.sessionMap.clear();
  }
synchronized (REGISTERED_APPS_LOCK) {
    if (registeredApps == null) {
      return;
    }
    registeredApps.clear();
  }
  Toast.makeText(getBaseContext(),"String_Node_Str" + type.name() + "String_Node_Str",Toast.LENGTH_SHORT).show();
}
Program: 32464
Project: 32464
Buggy source:
@Override public void onCreate(){
  super.onCreate();
  registeredApps=new HashMap<Long,RegisteredApp>();
  closing=false;
  currentContext=getBaseContext();
  registerReceiver(registerAnInstanceOfSerialServer,new IntentFilter(REGISTER_NEWER_SERVER_INSTANCE_ACTION));
  Log.i(TAG,"String_Node_Str");
  newestServiceCheck(currentContext);
  SESSION_LOCK=new Object();
synchronized (SESSION_LOCK) {
    sessionMap=new SparseArray<Long>();
  }
  packetExecuter=Executors.newSingleThreadExecutor();
}

Fixed version (ground truth):
@Override public void onCreate(){
  super.onCreate();
  registeredApps=new HashMap<Long,RegisteredApp>();
  closing=false;
  currentContext=getBaseContext();
  registerReceiver(registerAnInstanceOfSerialServer,new IntentFilter(REGISTER_NEWER_SERVER_INSTANCE_ACTION));
  Log.i(TAG,"String_Node_Str");
  newestServiceCheck(currentContext);
synchronized (SESSION_LOCK) {
    this.sessionMap=new SparseArray<Long>();
  }
  packetExecuter=Executors.newSingleThreadExecutor();
}
Program: 32465
Project: 32465
Buggy source:
@Override public void onDestroy(){
  if (versionCheckTimeOutHandler != null) {
    versionCheckTimeOutHandler.removeCallbacks(versionCheckRunable);
  }
  Log.v(TAG,"String_Node_Str");
  closing=true;
  currentContext=null;
  unregisterAllReceivers();
  closeBluetoothSerialServer();
  registeredApps=null;
  startSequenceComplete=false;
  packetExecuter.shutdownNow();
  packetExecuter=null;
  super.onDestroy();
  try {
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
@Override public void onDestroy(){
  if (versionCheckTimeOutHandler != null) {
    versionCheckTimeOutHandler.removeCallbacks(versionCheckRunable);
  }
  Log.w(TAG,"String_Node_Str");
  closing=true;
  currentContext=null;
  unregisterAllReceivers();
  closeBluetoothSerialServer();
  if (registeredApps != null) {
    registeredApps.clear();
    registeredApps=null;
  }
synchronized (SESSION_LOCK) {
    if (this.sessionMap != null) {
      this.sessionMap.clear();
      this.sessionMap=null;
    }
  }
  startSequenceComplete=false;
  packetExecuter.shutdownNow();
  packetExecuter=null;
  super.onDestroy();
  try {
  }
 catch (  Exception e) {
  }
}
Program: 32466
Project: 32466
Buggy source:
private boolean sendPacketMessageToClient(RegisteredApp app,Message message,byte version){
  int result=app.sendMessage(message);
  if (result == RegisteredApp.SEND_MESSAGE_ERROR_MESSENGER_DEAD_OBJECT) {
    Log.d(TAG,"String_Node_Str");
    Vector<Long> sessions=app.getSessionIds();
    byte[] unregister, stopService;
    int size=sessions.size(), sessionId;
    for (int i=0; i < size; i++) {
      sessionId=sessions.get(i).intValue();
      unregister=createForceUnregisterApp((byte)sessionId,version);
      manuallyWriteBytes(unregister,0,unregister.length);
      stopService=(SdlPacketFactory.createEndSession(SessionType.RPC,(byte)sessionId,0,version)).constructPacket();
      manuallyWriteBytes(stopService,0,stopService.length);
      sessionMap.remove(sessionId);
    }
    registeredApps.remove(app.appId);
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean sendPacketMessageToClient(RegisteredApp app,Message message,byte version){
  int result=app.sendMessage(message);
  if (result == RegisteredApp.SEND_MESSAGE_ERROR_MESSENGER_DEAD_OBJECT) {
    Log.d(TAG,"String_Node_Str");
    Vector<Long> sessions=app.getSessionIds();
    byte[] unregister, stopService;
    int size=sessions.size(), sessionId;
    for (int i=0; i < size; i++) {
      sessionId=sessions.get(i).intValue();
      unregister=createForceUnregisterApp((byte)sessionId,version);
      manuallyWriteBytes(unregister,0,unregister.length);
      stopService=(SdlPacketFactory.createEndSession(SessionType.RPC,(byte)sessionId,0,version)).constructPacket();
      manuallyWriteBytes(stopService,0,stopService.length);
      this.sessionMap.remove(sessionId);
    }
    registeredApps.remove(app.appId);
    return false;
  }
  return true;
}
Program: 32468
Project: 32468
Buggy source:
void registerSession(SdlSession registerListener) throws SdlException {
  listenerList.addIfAbsent(registerListener);
  if (!this.getIsConnected()) {
    this.startTransport();
  }
 else {
    this.startHandShake();
  }
}

Fixed version (ground truth):
void registerSession(SdlSession registerListener) throws SdlException {
  boolean didAdd=listenerList.addIfAbsent(registerListener);
  if (didAdd && listenerList.size() > 1 && _transport != null && _transport.getTransportType() == TransportType.MULTIPLEX) {
    ((MultiplexTransport)_transport).requestExtraSession();
  }
  if (!this.getIsConnected()) {
    this.startTransport();
  }
 else {
    this.startHandShake();
  }
}
Program: 32469
Project: 32469
Buggy source:
public void downloadLockScreenIcon(final String url,final OnLockScreenIconDownloadedListener l){
  new Thread(new Runnable(){
    @Override public void run(){
      try {
        lockScreenIcon=HttpUtils.downloadImage(url);
        if (l != null) {
          l.onLockScreenIconDownloaded(lockScreenIcon);
        }
      }
 catch (      IOException e) {
        if (l != null) {
          l.onLockScreenIconDonwloadError(e);
        }
      }
    }
  }
).start();
}

Fixed version (ground truth):
public void downloadLockScreenIcon(final String url,final OnLockScreenIconDownloadedListener l){
  new Thread(new Runnable(){
    @Override public void run(){
      try {
        lockScreenIcon=HttpUtils.downloadImage(url);
        if (l != null) {
          l.onLockScreenIconDownloaded(lockScreenIcon);
        }
      }
 catch (      IOException e) {
        if (l != null) {
          l.onLockScreenIconDownloadError(e);
        }
      }
    }
  }
).start();
}
Program: 32470
Project: 32470
Buggy source:
@Override public void run(){
  try {
    lockScreenIcon=HttpUtils.downloadImage(url);
    if (l != null) {
      l.onLockScreenIconDownloaded(lockScreenIcon);
    }
  }
 catch (  IOException e) {
    if (l != null) {
      l.onLockScreenIconDonwloadError(e);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    lockScreenIcon=HttpUtils.downloadImage(url);
    if (l != null) {
      l.onLockScreenIconDownloaded(lockScreenIcon);
    }
  }
 catch (  IOException e) {
    if (l != null) {
      l.onLockScreenIconDownloadError(e);
    }
  }
}
Program: 32471
Project: 32471
Buggy source:
public void forceHardwareConnectEvent(TransportType type){
  if (_transport != null && _transport.getTransportType() == TransportType.MULTIPLEX) {
    ((MultiplexTransport)_transport).forceHardwareConnectEvent(TransportType.BLUETOOTH);
  }
}

Fixed version (ground truth):
public void forceHardwareConnectEvent(TransportType type){
  if (_transport != null && _transport.getTransportType() == TransportType.MULTIPLEX) {
    ((MultiplexTransport)_transport).forceHardwareConnectEvent(TransportType.BLUETOOTH);
    for (int i=1; i < listenerList.size(); i++) {
      ((MultiplexTransport)_transport).requestExtraSession();
    }
  }
}
Program: 32472
Project: 32472
Buggy source:
/** 
 * Entry function that is called when the task is started. It attempts to connect to the accessory, then starts a read loop until interrupted.
 */
@Override public void run(){
  logD("String_Node_Str");
  psm.reset();
  if (connect()) {
    readFromTransport();
  }
  logD("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Entry function that is called when the task is started. It attempts to connect to the accessory, then starts a read loop until interrupted.
 */
@Override public void run(){
  logD("String_Node_Str");
  psm=new SdlPsm();
  psm.reset();
  if (connect()) {
    readFromTransport();
  }
  logD("String_Node_Str");
}
Program: 32473
Project: 32473
Buggy source:
/** 
 * Continuously reads data from the transport's input stream, blocking when no data is available.
 */
private void readFromTransport(){
  final int READ_BUFFER_SIZE=4096;
  byte[] buffer=new byte[READ_BUFFER_SIZE];
  int bytes=0;
  byte input;
  boolean stateProgress=false;
  while (!isInterrupted()) {
    try {
      input=(byte)mInputStream.read();
      if (input == -1) {
        if (isInterrupted()) {
          logI("String_Node_Str");
        }
 else {
          logI("String_Node_Str");
          disconnect("String_Node_Str",null);
        }
        return;
      }
    }
 catch (    IOException e) {
      if (isInterrupted()) {
        logW("String_Node_Str",e);
      }
 else {
        logW("String_Node_Str",e);
        disconnect("String_Node_Str",e);
      }
      return;
    }
    logD("String_Node_Str" + input + "String_Node_Str");
    if (isInterrupted()) {
      logI("String_Node_Str");
      return;
    }
synchronized (USBTransport.this) {
      stateProgress=psm.handleByte(input);
      if (stateProgress) {
        buffer[bytes]=input;
        bytes++;
      }
 else       if (!stateProgress) {
        psm.reset();
        bytes=0;
        buffer=new byte[READ_BUFFER_SIZE];
      }
      if (psm.getState() == SdlPsm.FINISHED_STATE) {
        handleReceivedPacket((SdlPacket)psm.getFormedPacket());
        psm.reset();
        bytes=0;
        buffer=new byte[READ_BUFFER_SIZE];
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Continuously reads data from the transport's input stream, blocking when no data is available.
 */
private void readFromTransport(){
  final int READ_BUFFER_SIZE=4096;
  byte[] buffer=new byte[READ_BUFFER_SIZE], tempBuffer=new byte[READ_BUFFER_SIZE];
  int bytes=0, bytesRead;
  boolean stateProgress=false;
  while (!isInterrupted()) {
    try {
      bytesRead=mInputStream.read(tempBuffer);
      if (bytesRead == -1) {
        if (isInterrupted()) {
          logI("String_Node_Str");
        }
 else {
          logI("String_Node_Str");
          disconnect("String_Node_Str",null);
        }
        return;
      }
    }
 catch (    IOException e) {
      if (isInterrupted()) {
        logW("String_Node_Str",e);
      }
 else {
        logW("String_Node_Str",e);
        disconnect("String_Node_Str",e);
      }
      return;
    }
    logD("String_Node_Str" + bytesRead + "String_Node_Str");
    if (isInterrupted()) {
      logI("String_Node_Str");
      return;
    }
    byte input;
    for (int i=0; i < bytesRead; i++) {
      input=tempBuffer[i];
      stateProgress=psm.handleByte(input);
      if (stateProgress) {
        buffer[bytes]=input;
        bytes++;
      }
 else       if (!stateProgress) {
        psm.reset();
        bytes=0;
        buffer=new byte[READ_BUFFER_SIZE];
      }
      if (psm.getState() == SdlPsm.FINISHED_STATE) {
synchronized (USBTransport.this) {
          handleReceivedPacket((SdlPacket)psm.getFormedPacket());
        }
        psm.reset();
        bytes=0;
        buffer=new byte[READ_BUFFER_SIZE];
      }
    }
  }
}
Program: 32475
Project: 32475
Buggy source:
/** 
 * Constructor.
 * @param listener Sdl connection listener.
 * @param transportConfig Transport configuration for this connection.
 */
public SdlConnection(BaseTransportConfig transportConfig){
  _connectionListener=new InternalMsgDispatcher();
synchronized (TRANSPORT_REFERENCE_LOCK) {
    if (_transport != null) {
      if (_transport.getIsConnected()) {
        _transport.disconnect();
      }
      _transport=null;
    }
    if (legacyTransportRequest == null && (transportConfig.getTransportType() == TransportType.MULTIPLEX || transportConfig.getTransportType() == TransportType.BLUETOOTH)) {
      _transport=new MultiplexTransport((MultiplexTransportConfig)transportConfig,this);
    }
 else     if ((legacyTransportRequest != null && legacyTransportRequest == TransportType.BLUETOOTH) || transportConfig.getTransportType() == TransportType.BLUETOOTH) {
      _transport=new BTTransport(this);
    }
 else     if (transportConfig.getTransportType() == TransportType.TCP) {
      _transport=new TCPTransport((TCPTransportConfig)transportConfig,this);
    }
 else     if (transportConfig.getTransportType() == TransportType.USB) {
      _transport=new USBTransport((USBTransportConfig)transportConfig,this);
    }
  }
synchronized (PROTOCOL_REFERENCE_LOCK) {
    if (_protocol != null) {
      _protocol=null;
    }
    _protocol=new WiProProtocol(this);
  }
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param listener Sdl connection listener.
 * @param transportConfig Transport configuration for this connection.
 */
public SdlConnection(BaseTransportConfig transportConfig){
  _connectionListener=new InternalMsgDispatcher();
synchronized (TRANSPORT_REFERENCE_LOCK) {
    if (_transport != null) {
      if (_transport.getIsConnected()) {
        _transport.disconnect();
      }
      _transport=null;
    }
    if (legacyTransportRequest == null && (transportConfig.getTransportType() == TransportType.MULTIPLEX)) {
      _transport=new MultiplexTransport((MultiplexTransportConfig)transportConfig,this);
    }
 else     if ((legacyTransportRequest != null && legacyTransportRequest == TransportType.BLUETOOTH) || transportConfig.getTransportType() == TransportType.BLUETOOTH) {
      _transport=new BTTransport(this);
    }
 else     if (transportConfig.getTransportType() == TransportType.BLUETOOTH) {
      _transport=new BTTransport(this,((BTTransportConfig)transportConfig).getKeepSocketActive());
    }
 else     if (transportConfig.getTransportType() == TransportType.TCP) {
      _transport=new TCPTransport((TCPTransportConfig)transportConfig,this);
    }
 else     if (transportConfig.getTransportType() == TransportType.USB) {
      _transport=new USBTransport((USBTransportConfig)transportConfig,this);
    }
  }
synchronized (PROTOCOL_REFERENCE_LOCK) {
    if (_protocol != null) {
      _protocol=null;
    }
    _protocol=new WiProProtocol(this);
  }
}
Program: 32476
Project: 32476
Buggy source:
private void unBindFromRouterService(){
  try {
    getContext().unbindService(routerConnection);
  }
 catch (  IllegalArgumentException e) {
  }
}

Fixed version (ground truth):
private void unBindFromRouterService(){
  try {
    if (getContext() != null) {
      getContext().unbindService(routerConnection);
    }
 else {
      Log.w(TAG,"String_Node_Str");
    }
  }
 catch (  IllegalArgumentException e) {
  }
}
Program: 32477
Project: 32477
Buggy source:
public MultiplexTransport(MultiplexTransportConfig transportConfig,final ITransportListener transportListener){
  super(transportListener);
  broker=new TransportBroker(transportConfig.context,transportConfig.appId){
    @Override public boolean onHardwareConnected(    TransportType type){
      if (super.onHardwareConnected(type)) {
        Log.d(TAG,"String_Node_Str");
        if (!connected) {
          connected=true;
          Log.d(TAG,"String_Node_Str");
          handleTransportConnected();
        }
 else {
          Log.d(TAG,"String_Node_Str");
        }
        return true;
      }
 else {
        this.start();
      }
      return false;
    }
    @Override public void onHardwareDisconnected(    TransportType type){
      super.onHardwareDisconnected(type);
      if (connected) {
        Log.d(TAG,"String_Node_Str");
        connected=false;
        SdlConnection.enableLegacyMode(isLegacyModeEnabled(),TransportType.BLUETOOTH);
        if (isLegacyModeEnabled()) {
          this.stop();
          handleTransportDisconnected("String_Node_Str");
        }
 else {
          handleTransportError("String_Node_Str",null);
        }
      }
    }
    @Override public void onPacketReceived(    Parcelable packet){
      if (packet != null) {
        SdlPacket sdlPacket=(SdlPacket)packet;
        handleReceivedPacket(sdlPacket);
      }
    }
  }
;
}

Fixed version (ground truth):
public MultiplexTransport(MultiplexTransportConfig transportConfig,final ITransportListener transportListener){
  super(transportListener);
  broker=new TransportBroker(transportConfig.context,transportConfig.appId){
    @Override public boolean onHardwareConnected(    TransportType type){
      if (super.onHardwareConnected(type)) {
        Log.d(TAG,"String_Node_Str");
        if (!connected) {
          connected=true;
          Log.d(TAG,"String_Node_Str");
          handleTransportConnected();
        }
 else {
          Log.d(TAG,"String_Node_Str");
        }
        return true;
      }
 else {
        this.start();
      }
      return false;
    }
    @Override public void onHardwareDisconnected(    TransportType type){
      super.onHardwareDisconnected(type);
      if (connected) {
        Log.d(TAG,"String_Node_Str");
        connected=false;
        SdlConnection.enableLegacyMode(isLegacyModeEnabled(),TransportType.BLUETOOTH);
        if (isLegacyModeEnabled()) {
          Log.d(TAG,"String_Node_Str");
          this.stop();
          handleTransportDisconnected("String_Node_Str");
        }
 else {
          Log.d(TAG,"String_Node_Str");
          handleTransportError("String_Node_Str",null);
        }
      }
    }
    @Override public void onPacketReceived(    Parcelable packet){
      if (packet != null) {
        SdlPacket sdlPacket=(SdlPacket)packet;
        handleReceivedPacket(sdlPacket);
      }
    }
  }
;
}
Program: 32478
Project: 32478
Buggy source:
@Override public void onHardwareDisconnected(TransportType type){
  super.onHardwareDisconnected(type);
  if (connected) {
    Log.d(TAG,"String_Node_Str");
    connected=false;
    SdlConnection.enableLegacyMode(isLegacyModeEnabled(),TransportType.BLUETOOTH);
    if (isLegacyModeEnabled()) {
      this.stop();
      handleTransportDisconnected("String_Node_Str");
    }
 else {
      handleTransportError("String_Node_Str",null);
    }
  }
}

Fixed version (ground truth):
@Override public void onHardwareDisconnected(TransportType type){
  super.onHardwareDisconnected(type);
  if (connected) {
    Log.d(TAG,"String_Node_Str");
    connected=false;
    SdlConnection.enableLegacyMode(isLegacyModeEnabled(),TransportType.BLUETOOTH);
    if (isLegacyModeEnabled()) {
      Log.d(TAG,"String_Node_Str");
      this.stop();
      handleTransportDisconnected("String_Node_Str");
    }
 else {
      Log.d(TAG,"String_Node_Str");
      handleTransportError("String_Node_Str",null);
    }
  }
}
Program: 32479
Project: 32479
Buggy source:
public void onServiceDisconnected(ComponentName className){
  Log.d(TAG,"String_Node_Str");
  routerService=null;
  registeredWithRouterService=false;
  isBound=false;
}

Fixed version (ground truth):
public void onServiceDisconnected(ComponentName className){
  Log.d(TAG,"String_Node_Str");
  routerService=null;
  registeredWithRouterService=false;
  isBound=false;
  onHardwareDisconnected(null);
}
Program: 32481
Project: 32481
Buggy source:
private boolean sendBindingIntent(){
  if (this.routerPackage != null && this.routerClassName != null) {
    Log.d(TAG,"String_Node_Str" + this.routerPackage + "String_Node_Str"+ this.routerClassName);
    Intent bindingIntent=new Intent();
    bindingIntent.setClassName(this.routerPackage,this.routerClassName);
    bindingIntent.putExtra(TransportConstants.ROUTER_BIND_REQUEST_TYPE_EXTRA,TransportConstants.BIND_REQUEST_TYPE_CLIENT);
    return getContext().bindService(bindingIntent,routerConnection,Context.BIND_AUTO_CREATE);
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
private boolean sendBindingIntent(){
  if (this.routerPackage != null && this.routerClassName != null) {
    Log.d(TAG,"String_Node_Str" + this.routerPackage + "String_Node_Str"+ this.routerClassName);
    Intent bindingIntent=new Intent();
    bindingIntent.setClassName(this.routerPackage,this.routerClassName);
    bindingIntent.putExtra(TransportConstants.ROUTER_BIND_REQUEST_TYPE_EXTRA,TransportConstants.BIND_REQUEST_TYPE_CLIENT);
    return getContext().bindService(bindingIntent,routerConnection,Context.BIND_ABOVE_CLIENT);
  }
 else {
    return false;
  }
}
Program: 32482
Project: 32482
Buggy source:
private void unregisterWithRouterService(){
  Log.i(TAG,"String_Node_Str");
  Message msg=Message.obtain();
  msg.what=TransportConstants.ROUTER_UNREGISTER_CLIENT;
  msg.replyTo=this.clientMessenger;
  Bundle bundle=new Bundle();
  bundle.putLong(TransportConstants.APP_ID_EXTRA,Long.valueOf(appId));
  msg.setData(bundle);
  this.sendMessageToRouterService(msg);
}

Fixed version (ground truth):
private void unregisterWithRouterService(){
  Log.i(TAG,"String_Node_Str");
  if (isBound) {
    Message msg=Message.obtain();
    msg.what=TransportConstants.ROUTER_UNREGISTER_CLIENT;
    msg.replyTo=this.clientMessenger;
    Bundle bundle=new Bundle();
    bundle.putLong(TransportConstants.APP_ID_EXTRA,Long.valueOf(appId));
    msg.setData(bundle);
    this.sendMessageToRouterService(msg);
  }
  routerService=null;
}
Program: 32483
Project: 32483
Buggy source:
public void onHardwareDisconnected(TransportType type){
synchronized (INIT_LOCK) {
    queuedOnTransportConnect=null;
  }
}

Fixed version (ground truth):
public void onHardwareDisconnected(TransportType type){
  if (isBound) {
    getContext().unbindService(routerConnection);
  }
synchronized (INIT_LOCK) {
    routerService=null;
    routerConnection=null;
    queuedOnTransportConnect=null;
  }
}
Program: 32484
Project: 32484
Buggy source:
/** 
 * Getter for longitude of the location to send.
 * @return The longitude of the location
 */
public Float getLongitudeDegrees(){
  return (Float)parameters.get(KEY_LON_DEGREES);
}

Fixed version (ground truth):
/** 
 * Getter for longitude of the location to send.
 * @return The longitude of the location
 */
public Float getLongitudeDegrees(){
  Object value=parameters.get(KEY_LON_DEGREES);
  if (value instanceof Integer) {
    return ((Integer)value).floatValue();
  }
 else   if (value instanceof Double) {
    return ((Double)value).floatValue();
  }
 else {
    return (Float)value;
  }
}
Program: 32485
Project: 32485
Buggy source:
/** 
 * Getter for latitude of the location to send.
 * @return The latitude of the location
 */
public Float getLatitudeDegrees(){
  return (Float)parameters.get(KEY_LAT_DEGREES);
}

Fixed version (ground truth):
/** 
 * Getter for latitude of the location to send.
 * @return The latitude of the location
 */
public Float getLatitudeDegrees(){
  Object value=parameters.get(KEY_LAT_DEGREES);
  if (value instanceof Integer) {
    return ((Integer)value).floatValue();
  }
 else   if (value instanceof Double) {
    return ((Double)value).floatValue();
  }
 else {
    return (Float)value;
  }
}
Program: 32486
Project: 32486
Buggy source:
public void testLongitudeDegrees(){
  Float longitude=((SendLocation)msg).getLatitudeDegrees();
  assertEquals("String_Node_Str",KEY_LON_DEGREES,longitude);
}

Fixed version (ground truth):
public void testLongitudeDegrees(){
  Float longitude=((SendLocation)msg).getLongitudeDegrees();
  assertEquals("String_Node_Str",KEY_LON_DEGREES,longitude);
}
Program: 32487
Project: 32487
Buggy source:
@Override public void onProtocolSessionStarted(SessionType sessionType,byte sessionID,byte version,String correlationID){
  for (  SdlSession session : listenerList) {
    if (session.getSessionId() == 0 || sessionType == SessionType.NAV || sessionType == SessionType.PCM) {
      session.onProtocolSessionStarted(sessionType,sessionID,version,correlationID);
      break;
    }
  }
}

Fixed version (ground truth):
@Override public void onProtocolSessionStarted(SessionType sessionType,byte sessionID,byte version,String correlationID){
  for (  SdlSession session : listenerList) {
    if (session.getSessionId() == 0) {
      session.onProtocolSessionStarted(sessionType,sessionID,version,correlationID);
      break;
    }
  }
  if (sessionType.equals(SessionType.NAV) || sessionType.equals(SessionType.PCM)) {
    SdlSession session=findSessionById(sessionID);
    if (session != null) {
      session.onProtocolSessionStarted(sessionType,sessionID,version,correlationID);
    }
  }
}
Program: 32488
Project: 32488
Buggy source:
@Override public void onTransportError(String info,Exception e){
  SdlSession mySession=null;
  for (int z=0; z < listenerList.size(); z++) {
    mySession=listenerList.get(0);
    if (mySession == null)     continue;
    mySession.onTransportError(info,e);
  }
}

Fixed version (ground truth):
@Override public void onTransportError(String info,Exception e){
  for (  SdlSession session : listenerList) {
    session.onTransportError(info,e);
  }
}
Program: 32489
Project: 32489
Buggy source:
private void testJsonArray(JSONArray reference,JSONArray underTest,String key) throws JSONException {
  assertEquals("String_Node_Str",reference.length(),underTest.length());
  int len=reference.length();
  for (int i=0; i < len; i++) {
    Object array1Obj=reference.get(i), array2Obj=underTest.get(i);
    if (array1Obj instanceof JSONObject) {
      testJsonParameters((JSONObject)array1Obj,(JSONObject)array2Obj);
    }
 else     if (array1Obj instanceof JSONArray) {
      testJsonArray((JSONArray)array1Obj,(JSONArray)array2Obj,key);
    }
 else {
      assertTrue("String_Node_Str" + key + "String_Node_Str",array1Obj.equals(array2Obj));
    }
  }
}

Fixed version (ground truth):
private void testJsonArray(JSONArray reference,JSONArray underTest,String key) throws JSONException {
  System.out.println("String_Node_Str" + key);
  assertEquals("String_Node_Str",reference.length(),underTest.length());
  int len=reference.length();
  for (int i=0; i < len; i++) {
    Object array1Obj=reference.get(i), array2Obj=underTest.get(i);
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + key);
    System.out.println("String_Node_Str" + array1Obj + "String_Node_Str"+ array1Obj.getClass());
    System.out.println("String_Node_Str" + array2Obj + "String_Node_Str"+ array2Obj.getClass());
    if (array1Obj instanceof JSONObject) {
      testJsonParameters((JSONObject)array1Obj,(JSONObject)array2Obj);
    }
 else     if (array1Obj instanceof JSONArray) {
      testJsonArray((JSONArray)array1Obj,(JSONArray)array2Obj,key);
    }
 else {
      assertTrue("String_Node_Str" + key + "String_Node_Str",array1Obj.equals(array2Obj));
    }
  }
}
Program: 32490
Project: 32490
Buggy source:
public void testJson(){
  try {
    JSONObject reference=buildJsonStore();
    JSONObject underTest=msg.serializeJSON();
    assertEquals("String_Node_Str",reference.length(),underTest.length());
    Iterator<?> iterator=reference.keys();
    while (iterator.hasNext()) {
      String key=(String)iterator.next();
      Object referenceValue=JsonUtils.readObjectFromJsonObject(reference,key);
      testJsonParameters((JSONObject)referenceValue,(JSONObject)JsonUtils.readObjectFromJsonObject(underTest,key));
    }
  }
 catch (  JSONException e) {
  }
}

Fixed version (ground truth):
public void testJson(){
  try {
    JSONObject reference=buildJsonStore();
    JSONObject underTest=msg.serializeJSON();
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + reference.toString(2));
    System.out.println("String_Node_Str" + underTest.toString(2));
    assertEquals("String_Node_Str",reference.length(),underTest.length());
    Iterator<?> iterator=reference.keys();
    while (iterator.hasNext()) {
      String key=(String)iterator.next();
      Object referenceValue=JsonUtils.readObjectFromJsonObject(reference,key);
      testJsonParameters((JSONObject)referenceValue,(JSONObject)JsonUtils.readObjectFromJsonObject(underTest,key));
    }
  }
 catch (  JSONException e) {
  }
}
Program: 32491
Project: 32491
Buggy source:
public void createCustomObjects(){
  TTSChunk ttsChunk=new TTSChunk();
  ttsChunk.setText(TTS_CHUNK_TEXT_1);
  ttsChunk.setType(TTS_CHUNK_SPEECH_1);
  TTS_CHUNK_LIST.add(ttsChunk);
  ttsChunk=new TTSChunk();
  ttsChunk.setText(TTS_CHUNK_TEXT_2);
  ttsChunk.setType(TTS_CHUNK_SPEECH_2);
  TTS_CHUNK_LIST.add(ttsChunk);
  SOFT_BUTTON_IMAGE.setValue(SOFT_BUTTON_VALUE);
  SOFT_BUTTON_IMAGE.setImageType(SOFT_BUTTON_IMAGE_TYPE);
  SoftButton softButton=new SoftButton();
  softButton.setIsHighlighted(SOFT_BUTTON_HIGHLIGHTED);
  softButton.setSoftButtonID(SOFT_BUTTON_ID);
  softButton.setSystemAction(SOFT_BUTTON_SYSTEM_ACTION);
  softButton.setText(SOFT_BUTTON_TEXT);
  softButton.setType(SOFT_BUTTON_KEY_TYPE);
  softButton.setImage(SOFT_BUTTON_IMAGE);
  SOFT_BUTTON_LIST.add(softButton);
}

Fixed version (ground truth):
private void createCustomObjects(){
  TTSChunk ttsChunk=new TTSChunk();
  ttsChunk.setText(TTS_CHUNK_TEXT_1);
  ttsChunk.setType(TTS_CHUNK_SPEECH_1);
  TTS_CHUNK_LIST.add(ttsChunk);
  ttsChunk=new TTSChunk();
  ttsChunk.setText(TTS_CHUNK_TEXT_2);
  ttsChunk.setType(TTS_CHUNK_SPEECH_2);
  TTS_CHUNK_LIST.add(ttsChunk);
  SOFT_BUTTON_IMAGE.setValue(SOFT_BUTTON_VALUE);
  SOFT_BUTTON_IMAGE.setImageType(SOFT_BUTTON_IMAGE_TYPE);
  SoftButton softButton=new SoftButton();
  softButton.setIsHighlighted(SOFT_BUTTON_HIGHLIGHTED);
  softButton.setSoftButtonID(SOFT_BUTTON_ID);
  softButton.setSystemAction(SOFT_BUTTON_SYSTEM_ACTION);
  softButton.setText(SOFT_BUTTON_TEXT);
  softButton.setType(SOFT_BUTTON_KEY_TYPE);
  softButton.setImage(SOFT_BUTTON_IMAGE);
  SOFT_BUTTON_LIST.add(softButton);
}
Program: 32492
Project: 32492
Buggy source:
@Override protected JSONObject getExpectedParameters(int sdlVersion){
  JSONObject result=new JSONObject();
  JSONArray ttsChunks=new JSONArray();
  JSONArray softButtons=new JSONArray();
  try {
    JSONObject ttsChunk=new JSONObject();
    ttsChunk.put(TTSChunk.KEY_TEXT,TTS_CHUNK_TEXT_1);
    ttsChunk.put(TTSChunk.KEY_TYPE,TTS_CHUNK_SPEECH_1);
    ttsChunks.put(ttsChunk);
    ttsChunk=new JSONObject();
    ttsChunk.put(TTSChunk.KEY_TEXT,TTS_CHUNK_TEXT_2);
    ttsChunk.put(TTSChunk.KEY_TYPE,TTS_CHUNK_SPEECH_2);
    ttsChunks.put(ttsChunk);
    JSONObject softButton=new JSONObject();
    softButton.put(SoftButton.KEY_IS_HIGHLIGHTED,SOFT_BUTTON_HIGHLIGHTED);
    softButton.put(SoftButton.KEY_SOFT_BUTTON_ID,SOFT_BUTTON_ID);
    softButton.put(SoftButton.KEY_SYSTEM_ACTION,SOFT_BUTTON_SYSTEM_ACTION);
    softButton.put(SoftButton.KEY_TEXT,SOFT_BUTTON_TEXT);
    softButton.put(SoftButton.KEY_TYPE,SOFT_BUTTON_KEY_TYPE);
    softButton.put(SoftButton.KEY_IMAGE,SOFT_BUTTON_IMAGE);
    softButtons.put(softButton);
    result.put(Alert.KEY_DURATION,DURATION);
    result.put(Alert.KEY_ALERT_TEXT_1,ALERT_TEXT_1);
    result.put(Alert.KEY_ALERT_TEXT_2,ALERT_TEXT_2);
    result.put(Alert.KEY_ALERT_TEXT_3,ALERT_TEXT_3);
    result.put(Alert.KEY_PLAY_TONE,PLAY_TONE);
    result.put(Alert.KEY_PROGRESS_INDICATOR,PROGRESS_INDICATOR);
    result.put(Alert.KEY_TTS_CHUNKS,ttsChunks);
    result.put(Alert.KEY_SOFT_BUTTONS,softButtons);
  }
 catch (  JSONException e) {
  }
  return result;
}

Fixed version (ground truth):
@Override protected JSONObject getExpectedParameters(int sdlVersion){
  JSONObject result=new JSONObject();
  JSONArray ttsChunks=new JSONArray();
  JSONArray softButtons=new JSONArray();
  try {
    JSONObject ttsChunk=new JSONObject();
    ttsChunk.put(TTSChunk.KEY_TEXT,TTS_CHUNK_TEXT_1);
    ttsChunk.put(TTSChunk.KEY_TYPE,TTS_CHUNK_SPEECH_1);
    ttsChunks.put(ttsChunk);
    ttsChunk=new JSONObject();
    ttsChunk.put(TTSChunk.KEY_TEXT,TTS_CHUNK_TEXT_2);
    ttsChunk.put(TTSChunk.KEY_TYPE,TTS_CHUNK_SPEECH_2);
    ttsChunks.put(ttsChunk);
    JSONObject softButton=new JSONObject();
    softButton.put(SoftButton.KEY_IS_HIGHLIGHTED,SOFT_BUTTON_HIGHLIGHTED);
    softButton.put(SoftButton.KEY_SOFT_BUTTON_ID,SOFT_BUTTON_ID);
    softButton.put(SoftButton.KEY_SYSTEM_ACTION,SOFT_BUTTON_SYSTEM_ACTION);
    softButton.put(SoftButton.KEY_TEXT,SOFT_BUTTON_TEXT);
    softButton.put(SoftButton.KEY_TYPE,SOFT_BUTTON_KEY_TYPE);
    softButton.put(SoftButton.KEY_IMAGE,SOFT_BUTTON_IMAGE.serializeJSON());
    softButtons.put(softButton);
    result.put(Alert.KEY_DURATION,DURATION);
    result.put(Alert.KEY_ALERT_TEXT_1,ALERT_TEXT_1);
    result.put(Alert.KEY_ALERT_TEXT_2,ALERT_TEXT_2);
    result.put(Alert.KEY_ALERT_TEXT_3,ALERT_TEXT_3);
    result.put(Alert.KEY_PLAY_TONE,PLAY_TONE);
    result.put(Alert.KEY_PROGRESS_INDICATOR,PROGRESS_INDICATOR);
    result.put(Alert.KEY_TTS_CHUNKS,ttsChunks);
    result.put(Alert.KEY_SOFT_BUTTONS,softButtons);
  }
 catch (  JSONException e) {
  }
  return result;
}
Program: 32493
Project: 32493
Buggy source:
public void createCustomObjects(){
  ttsChunk=new TTSChunk();
  ttsChunk.setType(TEST_SPEECH);
  ttsChunk.setText(HELLO_STRING);
  INITIAL_PROMPT.add(ttsChunk);
}

Fixed version (ground truth):
private void createCustomObjects(){
  ttsChunk=new TTSChunk();
  ttsChunk.setType(TEST_SPEECH);
  ttsChunk.setText(HELLO_STRING);
  INITIAL_PROMPT.add(ttsChunk);
}
Program: 32494
Project: 32494
Buggy source:
@Override protected JSONObject getExpectedParameters(int sdlVersion){
  JSONObject result=new JSONObject();
  try {
    result.put(PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1,TEXT_1);
    result.put(PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2,TEXT_2);
    result.put(PerformAudioPassThru.KEY_MUTE_AUDIO,MUTE_AUDIO);
    result.put(PerformAudioPassThru.KEY_MAX_DURATION,MAX_DURATION);
    result.put(PerformAudioPassThru.KEY_AUDIO_TYPE,AUDIO_TYPE);
    result.put(PerformAudioPassThru.KEY_SAMPLING_RATE,SAMPLING_RATE);
    result.put(PerformAudioPassThru.KEY_BITS_PER_SAMPLE,BITS_PER_SAMPLE);
    JSONObject initialPromptObj=new JSONObject();
    initialPromptObj.put(TTSChunk.KEY_TYPE,TEST_SPEECH);
    initialPromptObj.put(TTSChunk.KEY_TEXT,HELLO_STRING);
    JSONArray initialPromptArray=new JSONArray();
    initialPromptArray.put(initialPromptObj);
    result.put(PerformAudioPassThru.KEY_INITIAL_PROMPT,JsonUtils.createJsonArray(INITIAL_PROMPT));
  }
 catch (  JSONException e) {
  }
  return result;
}

Fixed version (ground truth):
@Override protected JSONObject getExpectedParameters(int sdlVersion){
  JSONObject result=new JSONObject();
  try {
    result.put(PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1,TEXT_1);
    result.put(PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2,TEXT_2);
    result.put(PerformAudioPassThru.KEY_MUTE_AUDIO,MUTE_AUDIO);
    result.put(PerformAudioPassThru.KEY_MAX_DURATION,MAX_DURATION);
    result.put(PerformAudioPassThru.KEY_AUDIO_TYPE,AUDIO_TYPE);
    result.put(PerformAudioPassThru.KEY_SAMPLING_RATE,SAMPLING_RATE);
    result.put(PerformAudioPassThru.KEY_BITS_PER_SAMPLE,BITS_PER_SAMPLE);
    JSONObject initialPromptObj=new JSONObject();
    initialPromptObj.put(TTSChunk.KEY_TYPE,TEST_SPEECH);
    initialPromptObj.put(TTSChunk.KEY_TEXT,HELLO_STRING);
    JSONArray initialPromptArray=new JSONArray();
    initialPromptArray.put(initialPromptObj);
    result.put(PerformAudioPassThru.KEY_INITIAL_PROMPT,initialPromptArray);
  }
 catch (  JSONException e) {
  }
  return result;
}
Program: 32495
Project: 32495
Buggy source:
public void createCustomObjects(){
  SoftButton softButton=new SoftButton();
  softButton.setText(SOFT_BUTTON_TEXT);
  softButton.setIsHighlighted(SOFT_BUTTON_HIGHLIGHTED);
  SOFT_BUTTON_LIST.add(softButton);
}

Fixed version (ground truth):
private void createCustomObjects(){
  SoftButton softButton=new SoftButton();
  softButton.setText(SOFT_BUTTON_TEXT);
  softButton.setIsHighlighted(SOFT_BUTTON_HIGHLIGHTED);
  SOFT_BUTTON_LIST.add(softButton);
}
Program: 32496
Project: 32496
Buggy source:
@Override protected RPCMessage createMessage(){
  CUSTOM_PRESETS.add(CUSTOM_PRESET_SAMPLE);
  Show msg=new Show();
  createCustomObjects();
  msg.setMainField1(TEXT_1);
  msg.setMainField2(TEXT_2);
  msg.setMainField3(TEXT_3);
  msg.setMainField4(TEXT_4);
  msg.setStatusBar(STATUS_BAR);
  msg.setMediaClock(MEDIA_CLOCK);
  msg.setMediaTrack(MEDIA_TRACK);
  msg.setAlignment(TEXT_ALIGNMENT);
  msg.setGraphic(IMAGE_1);
  msg.setSecondaryGraphic(IMAGE_2);
  msg.setCustomPresets(CUSTOM_PRESETS);
  msg.setSoftButtons(softButtons);
  return msg;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override protected RPCMessage createMessage(){
  CUSTOM_PRESETS.add(CUSTOM_PRESET_SAMPLE);
  Show msg=new Show();
  createCustomObjects();
  msg.setMainField1(TEXT_1);
  msg.setMainField2(TEXT_2);
  msg.setMainField3(TEXT_3);
  msg.setMainField4(TEXT_4);
  msg.setStatusBar(STATUS_BAR);
  msg.setMediaClock(MEDIA_CLOCK);
  msg.setMediaTrack(MEDIA_TRACK);
  msg.setAlignment(TEXT_ALIGNMENT);
  msg.setGraphic(IMAGE_1);
  msg.setSecondaryGraphic(IMAGE_2);
  msg.setCustomPresets(CUSTOM_PRESETS);
  msg.setSoftButtons(softButtons);
  return msg;
}
Program: 32498
Project: 32498
Buggy source:
public void testNull(){
  Show msg=new Show();
  assertNotNull("String_Node_Str",msg);
  testNullBase(msg);
  assertNull("String_Node_Str",msg.getMainField1());
  assertNull("String_Node_Str",msg.getMainField2());
  assertNull("String_Node_Str",msg.getMainField3());
  assertNull("String_Node_Str",msg.getMainField4());
  assertNull("String_Node_Str",msg.getStatusBar());
  assertNull("String_Node_Str",msg.getMediaClock());
  assertNull("String_Node_Str",msg.getAlignment());
  assertNull("String_Node_Str",msg.getGraphic());
  assertNull("String_Node_Str",msg.getSecondaryGraphic());
  assertNull("String_Node_Str",msg.getCustomPresets());
  assertNull("String_Node_Str",msg.getMediaTrack());
  assertNull("String_Node_Str",msg.getSoftButtons());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void testNull(){
  Show msg=new Show();
  assertNotNull("String_Node_Str",msg);
  testNullBase(msg);
  assertNull("String_Node_Str",msg.getMainField1());
  assertNull("String_Node_Str",msg.getMainField2());
  assertNull("String_Node_Str",msg.getMainField3());
  assertNull("String_Node_Str",msg.getMainField4());
  assertNull("String_Node_Str",msg.getStatusBar());
  assertNull("String_Node_Str",msg.getMediaClock());
  assertNull("String_Node_Str",msg.getAlignment());
  assertNull("String_Node_Str",msg.getGraphic());
  assertNull("String_Node_Str",msg.getSecondaryGraphic());
  assertNull("String_Node_Str",msg.getCustomPresets());
  assertNull("String_Node_Str",msg.getMediaTrack());
  assertNull("String_Node_Str",msg.getSoftButtons());
}
Program: 32499
Project: 32499
Buggy source:
public void testMediaClock(){
  String copy=((Show)msg).getMediaClock();
  assertEquals("String_Node_Str",MEDIA_CLOCK,copy);
}

Fixed version (ground truth):
public void testMediaClock(){
  @SuppressWarnings("String_Node_Str") String copy=((Show)msg).getMediaClock();
  assertEquals("String_Node_Str",MEDIA_CLOCK,copy);
}
Program: 32500
Project: 32500
Buggy source:
@Override public void setUp(){
  IMAGE_RESOLUTIONS[0].setResolutionWidth(20);
  IMAGE_RESOLUTIONS[0].setResolutionHeight(20);
  IMAGE_RESOLUTIONS[1].setResolutionWidth(30);
  IMAGE_RESOLUTIONS[1].setResolutionHeight(30);
  IMAGE_RESOLUTIONS[2].setResolutionWidth(10);
  IMAGE_RESOLUTIONS[3].setResolutionHeight(10);
  msg=new DisplayCapabilities();
  createCustomObjects();
  msg.setGraphicSupported(GRAPHIC_SUPPORTED);
  msg.setNumCustomPresetsAvailable(CUSTOM_PRESETS_AVAILABLE);
  msg.setDisplayType(DISPLAY_TYPE);
  msg.setImageFields(imageFields);
  msg.setTextFields(textFields);
  msg.setMediaClockFormats(MEDIA_CLOCK_FORMATS);
  msg.setScreenParams(screenParams);
  msg.setTemplatesAvailable(TEMPLATES_AVAILABLE);
}

Fixed version (ground truth):
@Override public void setUp(){
  IMAGE_RESOLUTIONS[0]=new ImageResolution();
  IMAGE_RESOLUTIONS[0].setResolutionWidth(20);
  IMAGE_RESOLUTIONS[0].setResolutionHeight(20);
  IMAGE_RESOLUTIONS[1]=new ImageResolution();
  IMAGE_RESOLUTIONS[1].setResolutionWidth(30);
  IMAGE_RESOLUTIONS[1].setResolutionHeight(30);
  IMAGE_RESOLUTIONS[2]=new ImageResolution();
  IMAGE_RESOLUTIONS[2].setResolutionWidth(10);
  IMAGE_RESOLUTIONS[2].setResolutionHeight(10);
  msg=new DisplayCapabilities();
  createCustomObjects();
  msg.setGraphicSupported(GRAPHIC_SUPPORTED);
  msg.setNumCustomPresetsAvailable(CUSTOM_PRESETS_AVAILABLE);
  msg.setDisplayType(DISPLAY_TYPE);
  msg.setImageFields(imageFields);
  msg.setTextFields(textFields);
  msg.setMediaClockFormats(MEDIA_CLOCK_FORMATS);
  msg.setScreenParams(screenParams);
  msg.setTemplatesAvailable(TEMPLATES_AVAILABLE);
}
Program: 32501
Project: 32501
Buggy source:
@Override protected JSONObject getExpectedParameters(int sdlVersion){
  JSONObject result=new JSONObject();
  try {
    result.put(OnLockScreenStatus.KEY_DRIVER_DISTRACTION,Boolean.valueOf(DRIVER_DISTRACTED).toString());
    result.put(OnHMIStatus.KEY_HMI_LEVEL,HMI_LEVEL);
    result.put(OnLockScreenStatus.KEY_SHOW_LOCK_SCREEN,SHOW_LOCK_SCREEN);
    result.put(OnLockScreenStatus.KEY_USER_SELECTED,USER_SELECTED);
  }
 catch (  JSONException e) {
  }
  return result;
}

Fixed version (ground truth):
@Override protected JSONObject getExpectedParameters(int sdlVersion){
  JSONObject result=new JSONObject();
  try {
    result.put(OnLockScreenStatus.KEY_DRIVER_DISTRACTION,DRIVER_DISTRACTED);
    result.put(OnHMIStatus.KEY_HMI_LEVEL,HMI_LEVEL);
    result.put(OnLockScreenStatus.KEY_SHOW_LOCK_SCREEN,SHOW_LOCK_SCREEN);
    result.put(OnLockScreenStatus.KEY_USER_SELECTED,USER_SELECTED);
  }
 catch (  JSONException e) {
  }
  return result;
}
Program: 32502
Project: 32502
Buggy source:
@Override protected JSONObject getExpectedParameters(int sdlVersion){
  JSONObject result=new JSONObject();
  JSONObject coordJsonObject, eventJsonObject;
  JSONArray eventJsonArray=new JSONArray();
  try {
    coordJsonObject=new JSONObject();
    eventJsonObject=new JSONObject();
    coordJsonObject.put(TouchCoord.KEY_X,X_1);
    coordJsonObject.put(TouchCoord.KEY_Y,Y_1);
    eventJsonObject.put(TouchEvent.KEY_C,coordJsonObject);
    eventJsonObject.put(TouchEvent.KEY_ID,ID_1);
    eventJsonObject.put(TouchEvent.KEY_TS,TIMESTAMP_1);
    eventJsonArray.put(eventJsonObject);
    coordJsonObject=new JSONObject();
    eventJsonObject=new JSONObject();
    coordJsonObject.put(TouchCoord.KEY_X,X_2);
    coordJsonObject.put(TouchCoord.KEY_Y,Y_2);
    eventJsonObject.put(TouchEvent.KEY_C,coordJsonObject);
    eventJsonObject.put(TouchEvent.KEY_ID,ID_2);
    eventJsonObject.put(TouchEvent.KEY_TS,TIMESTAMP_2);
    eventJsonArray.put(eventJsonObject);
    result.put(OnTouchEvent.KEY_TYPE,TOUCH_TYPE);
    result.put(OnTouchEvent.KEY_EVENT,eventJsonArray);
  }
 catch (  JSONException e) {
  }
  return result;
}

Fixed version (ground truth):
@Override protected JSONObject getExpectedParameters(int sdlVersion){
  JSONObject result=new JSONObject();
  JSONObject coordJsonObject, eventJsonObject;
  JSONArray eventJsonArray=new JSONArray(), tsArray=new JSONArray();
  try {
    coordJsonObject=new JSONObject();
    eventJsonObject=new JSONObject();
    JSONArray coordArray=new JSONArray();
    coordJsonObject.put(TouchCoord.KEY_X,X_1);
    coordJsonObject.put(TouchCoord.KEY_Y,Y_1);
    coordArray.put(coordJsonObject);
    eventJsonObject.put(TouchEvent.KEY_C,coordArray);
    eventJsonObject.put(TouchEvent.KEY_ID,ID_1);
    tsArray.put(TIMESTAMP_1);
    eventJsonObject.put(TouchEvent.KEY_TS,tsArray);
    eventJsonArray.put(eventJsonObject);
    coordJsonObject=new JSONObject();
    eventJsonObject=new JSONObject();
    coordArray=new JSONArray();
    coordJsonObject.put(TouchCoord.KEY_X,X_2);
    coordJsonObject.put(TouchCoord.KEY_Y,Y_2);
    coordArray.put(coordJsonObject);
    eventJsonObject.put(TouchEvent.KEY_C,coordArray);
    eventJsonObject.put(TouchEvent.KEY_ID,ID_2);
    tsArray=new JSONArray();
    tsArray.put(TIMESTAMP_2);
    eventJsonObject.put(TouchEvent.KEY_TS,tsArray);
    eventJsonArray.put(eventJsonObject);
    result.put(OnTouchEvent.KEY_TYPE,TOUCH_TYPE);
    result.put(OnTouchEvent.KEY_EVENT,eventJsonArray);
  }
 catch (  JSONException e) {
  }
  return result;
}
Program: 32503
Project: 32503
Buggy source:
@Override protected JSONObject getExpectedParameters(int sdlVersion){
  JSONObject result=new JSONObject();
  try {
    result.put(PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1,TEXT_1);
    result.put(PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2,TEXT_2);
    result.put(PerformAudioPassThru.KEY_MUTE_AUDIO,MUTE_AUDIO);
    result.put(PerformAudioPassThru.KEY_MAX_DURATION,MAX_DURATION);
    result.put(PerformAudioPassThru.KEY_AUDIO_TYPE,AUDIO_TYPE);
    result.put(PerformAudioPassThru.KEY_SAMPLING_RATE,SAMPLING_RATE);
    result.put(PerformAudioPassThru.KEY_BITS_PER_SAMPLE,BITS_PER_SAMPLE);
    result.put(PerformAudioPassThru.KEY_INITIAL_PROMPT,JsonUtils.createJsonArray(INITIAL_PROMPT));
  }
 catch (  JSONException e) {
  }
  return result;
}

Fixed version (ground truth):
@Override protected JSONObject getExpectedParameters(int sdlVersion){
  JSONObject result=new JSONObject();
  try {
    result.put(PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1,TEXT_1);
    result.put(PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2,TEXT_2);
    result.put(PerformAudioPassThru.KEY_MUTE_AUDIO,MUTE_AUDIO);
    result.put(PerformAudioPassThru.KEY_MAX_DURATION,MAX_DURATION);
    result.put(PerformAudioPassThru.KEY_AUDIO_TYPE,AUDIO_TYPE);
    result.put(PerformAudioPassThru.KEY_SAMPLING_RATE,SAMPLING_RATE);
    result.put(PerformAudioPassThru.KEY_BITS_PER_SAMPLE,BITS_PER_SAMPLE);
    JSONObject initialPromptObj=new JSONObject();
    initialPromptObj.put(TTSChunk.KEY_TYPE,TEST_SPEECH);
    initialPromptObj.put(TTSChunk.KEY_TEXT,HELLO_STRING);
    JSONArray initialPromptArray=new JSONArray();
    initialPromptArray.put(initialPromptObj);
    result.put(PerformAudioPassThru.KEY_INITIAL_PROMPT,JsonUtils.createJsonArray(INITIAL_PROMPT));
  }
 catch (  JSONException e) {
  }
  return result;
}
Program: 32504
Project: 32504
Buggy source:
@Override protected JSONObject getExpectedParameters(int sdlVersion){
  JSONObject result=new JSONObject();
  try {
    result.put(ScrollableMessage.KEY_SCROLLABLE_MESSAGE_BODY,MESSAGE);
    result.put(ScrollableMessage.KEY_TIMEOUT,TIMEOUT);
    result.put(ScrollableMessage.KEY_SOFT_BUTTONS,JsonUtils.createJsonArray(SOFT_BUTTON_LIST));
  }
 catch (  JSONException e) {
  }
  return result;
}

Fixed version (ground truth):
@Override protected JSONObject getExpectedParameters(int sdlVersion){
  JSONObject result=new JSONObject();
  try {
    result.put(ScrollableMessage.KEY_SCROLLABLE_MESSAGE_BODY,MESSAGE);
    result.put(ScrollableMessage.KEY_TIMEOUT,TIMEOUT);
    JSONObject softButtonObj=new JSONObject();
    softButtonObj.put(SoftButton.KEY_TEXT,SOFT_BUTTON_TEXT);
    softButtonObj.put(SoftButton.KEY_IS_HIGHLIGHTED,SOFT_BUTTON_HIGHLIGHTED);
    JSONArray softButtonArray=new JSONArray();
    softButtonArray.put(softButtonObj);
    result.put(ScrollableMessage.KEY_SOFT_BUTTONS,softButtonArray);
  }
 catch (  JSONException e) {
  }
  return result;
}