nus-yam/ex-repair huggingface dataset:
Program: 62507
Project: 62507
Buggy source:
@Override public void coverArtChangeEvent(String mac,String coverArtUrl){
  updateChannel(mac,CHANNEL_COVERART_DATA,createImage(downloadImage(coverArtUrl)));
}

Fixed version (ground truth):
@Override public void coverArtChangeEvent(String mac,String coverArtUrl){
  updateChannel(mac,CHANNEL_COVERART_DATA,createImage(downloadImage(mac,coverArtUrl)));
}
Program: 62509
Project: 62509
Buggy source:
public boolean matchesId(String searchedId){
  return searchedId != null ? searchedId.equalsIgnoreCase(getId()) : false;
}

Fixed version (ground truth):
public boolean matchesId(String searchedId){
  return searchedId != null && searchedId.equalsIgnoreCase(getId());
}
Program: 62510
Project: 62510
Buggy source:
private String getApiScope(){
  List<String> scopes=new ArrayList<>();
  if (configuration.readStation) {
    scopes.add("String_Node_Str");
  }
  if (configuration.readThermostat) {
    scopes.add("String_Node_Str");
    scopes.add("String_Node_Str");
  }
  if (configuration.readHealthyHomeCoach) {
    scopes.add("String_Node_Str");
  }
  if (configuration.readWelcome) {
    scopes.add("String_Node_Str");
    scopes.add("String_Node_Str");
    scopes.add("String_Node_Str");
  }
  String result=String.join("String_Node_Str",scopes);
  return result;
}

Fixed version (ground truth):
private String getApiScope(){
  List<String> scopes=new ArrayList<>();
  if (configuration.readStation) {
    scopes.add("String_Node_Str");
  }
  if (configuration.readThermostat) {
    scopes.add("String_Node_Str");
    scopes.add("String_Node_Str");
  }
  if (configuration.readHealthyHomeCoach) {
    scopes.add("String_Node_Str");
  }
  if (configuration.readWelcome) {
    scopes.add("String_Node_Str");
    scopes.add("String_Node_Str");
    scopes.add("String_Node_Str");
  }
  return String.join("String_Node_Str",scopes);
}
Program: 62511
Project: 62511
Buggy source:
/** 
 * Returns the Url of the picture
 * @return Url of the picture or UnDefType.UNDEF
 */
public String getPictureUrl(String id,String key){
  StringBuffer ret=new StringBuffer();
  if (id != null && key != null) {
    ret.append(WELCOME_PICTURE_URL).append("String_Node_Str").append(WELCOME_PICTURE_IMAGEID).append("String_Node_Str").append(id).append("String_Node_Str").append(WELCOME_PICTURE_KEY).append("String_Node_Str").append(key);
  }
  return ret.toString();
}

Fixed version (ground truth):
/** 
 * Returns the Url of the picture
 * @return Url of the picture or UnDefType.UNDEF
 */
public String getPictureUrl(String id,String key){
  StringBuilder ret=new StringBuilder();
  if (id != null && key != null) {
    ret.append(WELCOME_PICTURE_URL).append("String_Node_Str").append(WELCOME_PICTURE_IMAGEID).append("String_Node_Str").append(id).append("String_Node_Str").append(WELCOME_PICTURE_KEY).append("String_Node_Str").append(key);
  }
  return ret.toString();
}
Program: 62512
Project: 62512
Buggy source:
public void webHookEvent(NAWebhookCameraEvent event){
  if (event.getAppType() == NAWebhookCameraEvent.AppTypeEnum.CAMERA) {
    Set<AbstractNetatmoThingHandler> modules=new HashSet<>();
    if (WELCOME_EVENTS.contains(event.getEventType()) || PRESENCE_EVENTS.contains(event.getEventType())) {
      String cameraId=event.getCameraId();
      if (cameraId != null) {
        Optional<AbstractNetatmoThingHandler> camera=findNAThing(cameraId);
        camera.ifPresent(aCamera -> modules.add(aCamera));
      }
    }
    if (HOME_EVENTS.contains(event.getEventType())) {
      String homeId=event.getHomeId();
      if (homeId != null) {
        Optional<AbstractNetatmoThingHandler> home=findNAThing(homeId);
        home.ifPresent(aHome -> modules.add(aHome));
      }
    }
    if (PERSON_EVENTS.contains(event.getEventType())) {
      List<NAWebhookCameraEventPerson> persons=event.getPersons();
      persons.forEach(person -> {
        String personId=person.getId();
        if (personId != null) {
          Optional<AbstractNetatmoThingHandler> personHandler=findNAThing(personId);
          personHandler.ifPresent(aPerson -> modules.add(aPerson));
        }
      }
);
    }
    modules.forEach(module -> {
      Channel channel=module.getThing().getChannel(CHANNEL_WELCOME_HOME_EVENT);
      if (channel != null) {
        triggerChannel(channel.getUID(),event.getEventType().toString());
      }
    }
);
  }
}

Fixed version (ground truth):
public void webHookEvent(NAWebhookCameraEvent event){
  if (event.getAppType() == NAWebhookCameraEvent.AppTypeEnum.CAMERA) {
    Set<AbstractNetatmoThingHandler> modules=new HashSet<>();
    if (WELCOME_EVENTS.contains(event.getEventType()) || PRESENCE_EVENTS.contains(event.getEventType())) {
      String cameraId=event.getCameraId();
      if (cameraId != null) {
        Optional<AbstractNetatmoThingHandler> camera=findNAThing(cameraId);
        camera.ifPresent(modules::add);
      }
    }
    if (HOME_EVENTS.contains(event.getEventType())) {
      String homeId=event.getHomeId();
      if (homeId != null) {
        Optional<AbstractNetatmoThingHandler> home=findNAThing(homeId);
        home.ifPresent(modules::add);
      }
    }
    if (PERSON_EVENTS.contains(event.getEventType())) {
      List<NAWebhookCameraEventPerson> persons=event.getPersons();
      persons.forEach(person -> {
        String personId=person.getId();
        if (personId != null) {
          Optional<AbstractNetatmoThingHandler> personHandler=findNAThing(personId);
          personHandler.ifPresent(modules::add);
        }
      }
);
    }
    modules.forEach(module -> {
      Channel channel=module.getThing().getChannel(CHANNEL_WELCOME_HOME_EVENT);
      if (channel != null) {
        triggerChannel(channel.getUID(),event.getEventType().toString());
      }
    }
);
  }
}
Program: 62513
Project: 62513
Buggy source:
@Override protected State getNAThingProperty(String channelId){
  try {
switch (channelId) {
case CHANNEL_LAST_STATUS_STORE:
      if (device != null) {
        Method getLastStatusStore=device.getClass().getMethod("String_Node_Str");
        Integer lastStatusStore=(Integer)getLastStatusStore.invoke(device);
        return ChannelTypeUtils.toDateTimeType(lastStatusStore);
      }
 else {
        return UnDefType.UNDEF;
      }
case CHANNEL_LOCATION:
    if (device != null) {
      Method getPlace=device.getClass().getMethod("String_Node_Str");
      NAPlace place=(NAPlace)getPlace.invoke(device);
      PointType point=new PointType(new DecimalType(place.getLocation().get(1)),new DecimalType(place.getLocation().get(0)));
      if (place.getAltitude() != null) {
        point.setAltitude(new DecimalType(place.getAltitude()));
      }
      return point;
    }
 else {
      return UnDefType.UNDEF;
    }
case CHANNEL_UNIT:
  return new DecimalType(userAdministrative.getUnit());
}
}
 catch (NoSuchMethodException|IllegalAccessException|InvocationTargetException e) {
logger.error("String_Node_Str",channelId.toString());
return UnDefType.NULL;
}
return super.getNAThingProperty(channelId);
}

Fixed version (ground truth):
@Override protected State getNAThingProperty(String channelId){
  try {
switch (channelId) {
case CHANNEL_LAST_STATUS_STORE:
      if (device != null) {
        Method getLastStatusStore=device.getClass().getMethod("String_Node_Str");
        Integer lastStatusStore=(Integer)getLastStatusStore.invoke(device);
        return ChannelTypeUtils.toDateTimeType(lastStatusStore);
      }
 else {
        return UnDefType.UNDEF;
      }
case CHANNEL_LOCATION:
    if (device != null) {
      Method getPlace=device.getClass().getMethod("String_Node_Str");
      NAPlace place=(NAPlace)getPlace.invoke(device);
      PointType point=new PointType(new DecimalType(place.getLocation().get(1)),new DecimalType(place.getLocation().get(0)));
      if (place.getAltitude() != null) {
        point.setAltitude(new DecimalType(place.getAltitude()));
      }
      return point;
    }
 else {
      return UnDefType.UNDEF;
    }
case CHANNEL_UNIT:
  return new DecimalType(userAdministrative.getUnit());
}
}
 catch (NoSuchMethodException|IllegalAccessException|InvocationTargetException e) {
logger.error("String_Node_Str",channelId);
return UnDefType.NULL;
}
return super.getNAThingProperty(channelId);
}
Program: 62514
Project: 62514
Buggy source:
@Override protected State getNAThingProperty(String channelId){
  try {
    if (channelId.equalsIgnoreCase(CHANNEL_LAST_MESSAGE) && module != null) {
      Method getLastMessage=module.getClass().getMethod("String_Node_Str");
      Integer lastMessage=(Integer)getLastMessage.invoke(module);
      return ChannelTypeUtils.toDateTimeType(lastMessage);
    }
  }
 catch (  NoSuchMethodException|SecurityException|IllegalAccessException|IllegalArgumentException|InvocationTargetException e) {
    logger.error("String_Node_Str",channelId.toString());
    return UnDefType.NULL;
  }
  return super.getNAThingProperty(channelId);
}

Fixed version (ground truth):
@Override protected State getNAThingProperty(String channelId){
  try {
    if (channelId.equalsIgnoreCase(CHANNEL_LAST_MESSAGE) && module != null) {
      Method getLastMessage=module.getClass().getMethod("String_Node_Str");
      Integer lastMessage=(Integer)getLastMessage.invoke(module);
      return ChannelTypeUtils.toDateTimeType(lastMessage);
    }
  }
 catch (  NoSuchMethodException|SecurityException|IllegalAccessException|IllegalArgumentException|InvocationTargetException e) {
    logger.error("String_Node_Str",channelId);
    return UnDefType.NULL;
  }
  return super.getNAThingProperty(channelId);
}
Program: 62515
Project: 62515
Buggy source:
protected void requestParentRefresh(){
  Optional<AbstractNetatmoThingHandler> parent=getBridgeHandler().findNAThing(getParentId());
  parent.ifPresent(p -> p.updateChannels());
}

Fixed version (ground truth):
protected void requestParentRefresh(){
  Optional<AbstractNetatmoThingHandler> parent=getBridgeHandler().findNAThing(getParentId());
  parent.ifPresent(AbstractNetatmoThingHandler::updateChannels);
}
Program: 62516
Project: 62516
Buggy source:
@Override public void checkClientTrusted(final X509Certificate[] chain,final String authType) throws CertificateException {
}

Fixed version (ground truth):
@Override public void checkClientTrusted(final X509Certificate[] chain,final String authType){
}
Program: 62517
Project: 62517
Buggy source:
public TrustingOkHttpClient(){
  SSLContext ctx=null;
  try {
    ctx=SSLContext.getInstance("String_Node_Str");
    ctx.init(null,certs,new SecureRandom());
    final HostnameVerifier hostnameVerifier=new HostnameVerifier(){
      @Override public boolean verify(      final String hostname,      final SSLSession session){
        return true;
      }
    }
;
    this.setHostnameVerifier(hostnameVerifier);
    this.setSslSocketFactory(ctx.getSocketFactory());
  }
 catch (  final java.security.GeneralSecurityException ex) {
  }
}

Fixed version (ground truth):
public TrustingOkHttpClient(){
  try {
    SSLContext ctx=SSLContext.getInstance("String_Node_Str");
    ctx.init(null,certs,new SecureRandom());
    this.setHostnameVerifier((hostname,session) -> true);
    this.setSslSocketFactory(ctx.getSocketFactory());
  }
 catch (  GeneralSecurityException ex) {
    logger.trace("String_Node_Str",ex);
  }
}
Program: 62518
Project: 62518
Buggy source:
@Override public void checkServerTrusted(final X509Certificate[] chain,final String authType) throws CertificateException {
}

Fixed version (ground truth):
@Override public void checkServerTrusted(final X509Certificate[] chain,final String authType){
}
Program: 62519
Project: 62519
Buggy source:
private void registerDeviceDiscoveryService(@NonNull NetatmoBridgeHandler netatmoBridgeHandler){
  NetatmoModuleDiscoveryService discoveryService=new NetatmoModuleDiscoveryService(netatmoBridgeHandler);
  if (bundleContext != null) {
    discoveryServiceReg=bundleContext.registerService(DiscoveryService.class.getName(),discoveryService,new Hashtable<String,Object>());
  }
}

Fixed version (ground truth):
private void registerDeviceDiscoveryService(@NonNull NetatmoBridgeHandler netatmoBridgeHandler){
  NetatmoModuleDiscoveryService discoveryService=new NetatmoModuleDiscoveryService(netatmoBridgeHandler);
  if (bundleContext != null) {
    discoveryServiceReg=bundleContext.registerService(DiscoveryService.class.getName(),discoveryService,new Hashtable<>());
  }
}
Program: 62520
Project: 62520
Buggy source:
/** 
 * Compute the Dewpoint temperature given temperature and hygrometry valid up to 60 degrees, from http://en.wikipedia.org/wiki/Dew_point#Calculating_the_dew_point
 * @param temperature in (°C)
 * @param hygro relative level (%)
 * @return dewpoint temperature
 */
public static double getDewPoint(double temperature,double humidity){
  double a=17.271, b=237.2;
  double gamma=((a * temperature) / (b + temperature)) + Math.log(humidity / 100.0);
  return b * gamma / (a - gamma);
}

Fixed version (ground truth):
/** 
 * Compute the Dewpoint temperature given temperature and hygrometry valid up to 60 degrees, from http://en.wikipedia.org/wiki/Dew_point#Calculating_the_dew_point
 * @param temperature in (°C)
 * @param humidity relative level (%)
 * @return dewpoint temperature
 */
public static double getDewPoint(double temperature,double humidity){
  double a=17.271, b=237.2;
  double gamma=((a * temperature) / (b + temperature)) + Math.log(humidity / 100.0);
  return b * gamma / (a - gamma);
}
Program: 62521
Project: 62521
Buggy source:
private String inputStreamToString(HttpServletRequest req) throws IOException {
  Scanner scanner=new Scanner(req.getInputStream()).useDelimiter("String_Node_Str");
  String result=scanner.hasNext() ? scanner.next() : "String_Node_Str";
  return result;
}

Fixed version (ground truth):
private String inputStreamToString(HttpServletRequest req) throws IOException {
  Scanner scanner=new Scanner(req.getInputStream()).useDelimiter("String_Node_Str");
  return scanner.hasNext() ? scanner.next() : "String_Node_Str";
}
Program: 62522
Project: 62522
Buggy source:
public Optional<State> getNAThingProperty(String channelId){
  if (module != null) {
    try {
      if (CHANNEL_BATTERY_LEVEL.equalsIgnoreCase(channelId) || CHANNEL_LOW_BATTERY.equalsIgnoreCase(channelId)) {
        Method getBatteryVp=module.getClass().getMethod("String_Node_Str");
        Integer value=(Integer)getBatteryVp.invoke(module);
switch (channelId) {
case CHANNEL_BATTERY_LEVEL:
          int correctedVp=Math.min(value.intValue(),batteryMax);
        int batteryPercent=(100 * (correctedVp - batteryMin) / (batteryMax - batteryMin));
      return Optional.of(ChannelTypeUtils.toDecimalType(batteryPercent));
case CHANNEL_LOW_BATTERY:
    return Optional.of(value.intValue() < batteryLow ? OnOffType.ON : OnOffType.OFF);
}
}
}
 catch (NoSuchMethodException|SecurityException|IllegalAccessException|IllegalArgumentException|InvocationTargetException e) {
logger.warn("String_Node_Str",channelId,e.getMessage());
return Optional.of(UnDefType.NULL);
}
}
return Optional.empty();
}

Fixed version (ground truth):
public Optional<State> getNAThingProperty(String channelId){
  if (module != null) {
    try {
      if (CHANNEL_BATTERY_LEVEL.equalsIgnoreCase(channelId) || CHANNEL_LOW_BATTERY.equalsIgnoreCase(channelId)) {
        Method getBatteryVp=module.getClass().getMethod("String_Node_Str");
        Integer value=(Integer)getBatteryVp.invoke(module);
switch (channelId) {
case CHANNEL_BATTERY_LEVEL:
          int correctedVp=Math.min(value,batteryMax);
        int batteryPercent=(100 * (correctedVp - batteryMin) / (batteryMax - batteryMin));
      return Optional.of(ChannelTypeUtils.toDecimalType(batteryPercent));
case CHANNEL_LOW_BATTERY:
    return Optional.of(value < batteryLow ? OnOffType.ON : OnOffType.OFF);
}
}
}
 catch (NoSuchMethodException|SecurityException|IllegalAccessException|IllegalArgumentException|InvocationTargetException e) {
logger.warn("String_Node_Str",channelId,e.getMessage());
return Optional.of(UnDefType.NULL);
}
}
return Optional.empty();
}
Program: 62523
Project: 62523
Buggy source:
@Override protected NAMain updateReadings(){
  NAMain result=null;
  NAStationDataBody stationDataBody=getBridgeHandler().getStationsDataBody(getId());
  if (stationDataBody != null) {
    userAdministrative=stationDataBody.getUser().getAdministrative();
    result=stationDataBody.getDevices().stream().filter(device -> device.getId().equalsIgnoreCase(getId())).findFirst().get();
    if (result != null) {
      result.getModules().forEach(child -> childs.put(child.getId(),child));
    }
  }
  return result;
}

Fixed version (ground truth):
@Override protected NAMain updateReadings(){
  NAMain result=null;
  NAStationDataBody stationDataBody=getBridgeHandler().getStationsDataBody(getId());
  if (stationDataBody != null) {
    userAdministrative=stationDataBody.getUser().getAdministrative();
    result=stationDataBody.getDevices().stream().filter(device -> device.getId().equalsIgnoreCase(getId())).findFirst().orElse(null);
    if (result != null) {
      result.getModules().forEach(child -> childs.put(child.getId(),child));
    }
  }
  return result;
}
Program: 62525
Project: 62525
Buggy source:
@Override protected NAPlug updateReadings(){
  NAPlug result=null;
  NAThermostatDataBody thermostatDataBody=getBridgeHandler().getThermostatsDataBody(getId());
  if (thermostatDataBody != null) {
    userAdministrative=thermostatDataBody.getUser().getAdministrative();
    result=thermostatDataBody.getDevices().stream().filter(device -> device.getId().equalsIgnoreCase(getId())).findFirst().get();
    if (result != null) {
      result.getModules().forEach(child -> childs.put(child.getId(),child));
    }
  }
  return result;
}

Fixed version (ground truth):
@Override protected NAPlug updateReadings(){
  NAPlug result=null;
  NAThermostatDataBody thermostatDataBody=getBridgeHandler().getThermostatsDataBody(getId());
  if (thermostatDataBody != null) {
    userAdministrative=thermostatDataBody.getUser().getAdministrative();
    result=thermostatDataBody.getDevices().stream().filter(device -> device.getId().equalsIgnoreCase(getId())).findFirst().orElse(null);
    if (result != null) {
      result.getModules().forEach(child -> childs.put(child.getId(),child));
    }
  }
  return result;
}
Program: 62526
Project: 62526
Buggy source:
@Override public void handleCommand(ChannelUID channelUID,Command command){
  super.handleCommand(channelUID,command);
  if (!(command instanceof RefreshType)) {
    try {
switch (channelUID.getId()) {
case CHANNEL_SETPOINT_MODE:
{
          getBridgeHandler().getThermostatApi().setthermpoint(getParentId(),getId(),command.toString(),null,null);
          updateState(channelUID,new StringType(command.toString()));
          requestParentRefresh();
          break;
        }
case CHANNEL_SETPOINT_TEMP:
{
        Calendar cal=Calendar.getInstance();
        cal.add(Calendar.MINUTE,getSetpointDefaultDuration());
        getBridgeHandler().getThermostatApi().setthermpoint(getParentId(),getId(),"String_Node_Str",(int)(cal.getTimeInMillis() / 1000),Float.parseFloat(command.toString()));
        updateState(channelUID,new DecimalType(command.toString()));
        requestParentRefresh();
        break;
      }
  }
}
 catch (Exception e) {
  updateStatus(ThingStatus.OFFLINE,ThingStatusDetail.NONE,e.getMessage());
}
}
}

Fixed version (ground truth):
@Override public void handleCommand(ChannelUID channelUID,Command command){
  super.handleCommand(channelUID,command);
  if (!(command instanceof RefreshType)) {
    try {
switch (channelUID.getId()) {
case CHANNEL_SETPOINT_MODE:
{
          getBridgeHandler().getThermostatApi().setthermpoint(getParentId(),getId(),command.toString(),null,null);
          updateState(channelUID,new StringType(command.toString()));
          requestParentRefresh();
          break;
        }
case CHANNEL_SETPOINT_TEMP:
{
        Calendar cal=Calendar.getInstance();
        cal.add(Calendar.MINUTE,getSetPointDefaultDuration());
        getBridgeHandler().getThermostatApi().setthermpoint(getParentId(),getId(),"String_Node_Str",(int)(cal.getTimeInMillis() / 1000),Float.parseFloat(command.toString()));
        updateState(channelUID,new DecimalType(command.toString()));
        requestParentRefresh();
        break;
      }
  }
}
 catch (Exception e) {
  updateStatus(ThingStatus.OFFLINE,ThingStatusDetail.NONE,e.getMessage());
}
}
}
Program: 62527
Project: 62527
Buggy source:
private int getNextSchedule(List<NAThermProgram> thermProgramList){
  Calendar mondayZero=Calendar.getInstance();
  mondayZero.set(Calendar.DAY_OF_WEEK,Calendar.MONDAY);
  mondayZero.set(Calendar.HOUR_OF_DAY,0);
  mondayZero.set(Calendar.MINUTE,0);
  mondayZero.set(Calendar.SECOND,0);
  Calendar now=Calendar.getInstance();
  long diff=(now.getTimeInMillis() - mondayZero.getTimeInMillis()) / 1000 / 60;
  int result=-1;
  for (  NAThermProgram thermProgram : thermProgramList) {
    if (thermProgram.getSelected() != null && thermProgram.getSelected().booleanValue()) {
      int next=thermProgram.getTimetable().get(0).getMOffset() + (7 * 24 * 60);
      for (      NATimeTableItem timeTable : thermProgram.getTimetable()) {
        if (timeTable.getMOffset() > diff) {
          next=timeTable.getMOffset();
          break;
        }
      }
      result=(int)(next * 60 + (mondayZero.getTimeInMillis() / 1000));
    }
  }
  return result;
}

Fixed version (ground truth):
private int getNextSchedule(List<NAThermProgram> thermProgramList){
  Calendar mondayZero=Calendar.getInstance();
  mondayZero.set(Calendar.DAY_OF_WEEK,Calendar.MONDAY);
  mondayZero.set(Calendar.HOUR_OF_DAY,0);
  mondayZero.set(Calendar.MINUTE,0);
  mondayZero.set(Calendar.SECOND,0);
  Calendar now=Calendar.getInstance();
  long diff=(now.getTimeInMillis() - mondayZero.getTimeInMillis()) / 1000 / 60;
  int result=-1;
  for (  NAThermProgram thermProgram : thermProgramList) {
    if (thermProgram.getSelected() != null && thermProgram.getSelected()) {
      int next=thermProgram.getTimetable().get(0).getMOffset() + (7 * 24 * 60);
      for (      NATimeTableItem timeTable : thermProgram.getTimetable()) {
        if (timeTable.getMOffset() > diff) {
          next=timeTable.getMOffset();
          break;
        }
      }
      result=(int)(next * 60 + (mondayZero.getTimeInMillis() / 1000));
    }
  }
  return result;
}
Program: 62528
Project: 62528
Buggy source:
@Override protected NAWelcomeHome updateReadings(){
  NAWelcomeHome result=null;
  NAWelcomeHomeData homeDataBody=getBridgeHandler().getWelcomeDataBody(getId());
  if (homeDataBody != null) {
    dataTimeStamp=(int)Calendar.getInstance().getTimeInMillis() / 1000;
    result=homeDataBody.getHomes().stream().filter(device -> device.getId().equalsIgnoreCase(getId())).findFirst().get();
    if (result != null) {
      result.getCameras().forEach(camera -> childs.put(camera.getId(),camera));
      iPersons=0;
      iUnknowns=0;
      logger.debug("String_Node_Str",getId());
      result.getPersons().forEach(person -> {
        iPersons+=person.getOutOfSight() ? 0 : 1;
        if (person.getPseudo() != null) {
          childs.put(person.getId(),person);
        }
 else {
          iUnknowns+=person.getOutOfSight() ? 0 : 1;
        }
      }
);
      result.getEvents().forEach(event -> {
        if (lastEvent == null || lastEvent.getTime() < event.getTime()) {
          lastEvent=event;
        }
      }
);
    }
  }
  return result;
}

Fixed version (ground truth):
@Override protected NAWelcomeHome updateReadings(){
  NAWelcomeHome result=null;
  NAWelcomeHomeData homeDataBody=getBridgeHandler().getWelcomeDataBody(getId());
  if (homeDataBody != null) {
    dataTimeStamp=(int)Calendar.getInstance().getTimeInMillis() / 1000;
    result=homeDataBody.getHomes().stream().filter(device -> device.getId().equalsIgnoreCase(getId())).findFirst().orElse(null);
    if (result != null) {
      result.getCameras().forEach(camera -> childs.put(camera.getId(),camera));
      iPersons=0;
      iUnknowns=0;
      logger.debug("String_Node_Str",getId());
      result.getPersons().forEach(person -> {
        iPersons+=person.getOutOfSight() ? 0 : 1;
        if (person.getPseudo() != null) {
          childs.put(person.getId(),person);
        }
 else {
          iUnknowns+=person.getOutOfSight() ? 0 : 1;
        }
      }
);
      result.getEvents().forEach(event -> {
        if (lastEvent == null || lastEvent.getTime() < event.getTime()) {
          lastEvent=event;
        }
      }
);
    }
  }
  return result;
}
Program: 62529
Project: 62529
Buggy source:
/** 
 * Converts the value of the datapoint to a State, updates the channel and also sets the thing status if necessary.
 */
private void updateChannelState(final HmDatapoint dp,Channel channel) throws IOException, BridgeHandlerNotAvailableException, ConverterException {
  if (dp.isTrigger()) {
    triggerChannel(channel.getUID(),ObjectUtils.toString(dp.getValue()));
  }
 else   if (isLinked(channel)) {
    loadHomematicChannelValues(dp.getChannel());
    TypeConverter<?> converter=ConverterFactory.createConverter(channel.getAcceptedItemType());
    State state=converter.convertFromBinding(dp);
    updateState(channel.getUID(),state);
  }
}

Fixed version (ground truth):
/** 
 * Converts the value of the datapoint to a State, updates the channel and also sets the thing status if necessary.
 */
private void updateChannelState(final HmDatapoint dp,Channel channel) throws IOException, BridgeHandlerNotAvailableException, ConverterException {
  if (dp.isTrigger()) {
    triggerChannel(channel.getUID(),ObjectUtils.toString(dp.getValue()));
  }
 else   if (isLinked(channel)) {
    loadHomematicChannelValues(dp.getChannel());
    TypeConverter<?> converter=ConverterFactory.createConverter(channel.getAcceptedItemType());
    State state=converter.convertFromBinding(dp);
    if (state != null) {
      updateState(channel.getUID(),state);
    }
 else {
      logger.debug("String_Node_Str",dp.getName());
    }
  }
}
Program: 62530
Project: 62530
Buggy source:
@Override public Collection<ThingUID> removeOlderResults(DiscoveryService source,long timestamp,Collection<ThingTypeUID> thingTypeUIDs){
  return null;
}

Fixed version (ground truth):
@Override public Collection<ThingUID> removeOlderResults(DiscoveryService source,long timestamp,Collection<ThingTypeUID> thingTypeUIDs){
  return Collections.emptyList();
}
Program: 62532
Project: 62532
Buggy source:
/** 
 * We use the   {@see MilightV6SessionManager} to establish a full session to the bridge. If we reachthe SESSION_VALID state within 1.3s, we can safely assume it is a V6 Milight bridge.
 * @param addressOfBridge IP Address of the bridge
 * @return
 * @throws InterruptedException If waiting for the session is interrupted we throw this exception
 */
private boolean checkForV6Bridge(InetAddress addressOfBridge,String bridgeID) throws InterruptedException {
  QueuedSend queuedSend;
  try {
    queuedSend=new QueuedSend();
    Semaphore s=new Semaphore(0);
    MilightV6SessionManager session=new MilightV6SessionManager(queuedSend,bridgeID,scheduler,(    SessionState state) -> {
      if (state == SessionState.SESSION_VALID) {
        s.release();
      }
    }
);
    boolean success=s.tryAcquire(1,1300,TimeUnit.MILLISECONDS);
    session.dispose();
    queuedSend.dispose();
    return success;
  }
 catch (  SocketException e) {
    logger.debug("String_Node_Str",e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * We use the   {@see MilightV6SessionManager} to establish a full session to the bridge. If we reachthe SESSION_VALID state within 1.3s, we can safely assume it is a V6 Milight bridge.
 * @param addressOfBridge IP Address of the bridge
 * @return
 * @throws InterruptedException If waiting for the session is interrupted we throw this exception
 */
private boolean checkForV6Bridge(InetAddress addressOfBridge,String bridgeID) throws InterruptedException {
  QueuedSend queuedSend;
  try {
    queuedSend=new QueuedSend();
    Semaphore s=new Semaphore(0);
    MilightV6SessionManager session=new MilightV6SessionManager(queuedSend,bridgeID,scheduler,(    SessionState state) -> {
      if (state == SessionState.SESSION_VALID) {
        s.release();
      }
    }
,null);
    boolean success=s.tryAcquire(1,1300,TimeUnit.MILLISECONDS);
    session.dispose();
    queuedSend.dispose();
    return success;
  }
 catch (  SocketException e) {
    logger.debug("String_Node_Str",e);
  }
  return false;
}
Program: 62533
Project: 62533
Buggy source:
/** 
 * converts the volume value given by the pulseaudio server to a percentage value. The pulseaudio server sends 2 values for left and right channel volume e.g. 0: 80% 1: 80% which would be converted to 80
 * @param vol
 * @return
 */
private static int parseVolume(String vol){
  Matcher matcher=volumePattern.matcher(vol);
  if (matcher.find()) {
    return Math.round((Integer.valueOf(matcher.group(3)) + Integer.valueOf(matcher.group(7))) / 2);
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * converts the volume value given by the pulseaudio server to a percentage value. The pulseaudio server sends 2 values for left and right channel volume e.g. 0: 80% 1: 80% which would be converted to 80
 * @param vol
 * @return
 */
private static int parseVolume(String vol){
  int volumeTotal=0;
  int nChannels=0;
  for (  String channel : vol.split("String_Node_Str")) {
    Matcher matcher=volumePattern.matcher(channel.trim());
    if (matcher.find()) {
      volumeTotal+=Integer.valueOf(matcher.group(3));
      nChannels++;
    }
 else {
      logger.debug("String_Node_Str",channel);
    }
  }
  if (nChannels > 0) {
    return Math.round(volumeTotal / nChannels);
  }
  return 0;
}
Program: 62535
Project: 62535
Buggy source:
@Override public void dispose(){
  listeners.clear();
  buttonExecutor.shutdownNow();
  disconnectFromHub();
  factory.removeChannelTypesForThing(getThing().getUID());
}

Fixed version (ground truth):
@Override public void dispose(){
  listeners.clear();
  buttonExecutor.shutdownNow();
  cancelRetry();
  disconnectFromHub();
  factory.removeChannelTypesForThing(getThing().getUID());
}
Program: 62536
Project: 62536
Buggy source:
@Override public void initialize(){
  connect();
}

Fixed version (ground truth):
@Override public void initialize(){
  cancelRetry();
  connect();
}
Program: 62537
Project: 62537
Buggy source:
private void disconnectFromHub(){
  if (retryJob != null && !retryJob.isDone()) {
    retryJob.cancel(true);
  }
  if (heartBeatJob != null && !heartBeatJob.isDone()) {
    heartBeatJob.cancel(true);
  }
  if (client != null) {
    client.removeListener(this);
    client.disconnect();
    client=null;
  }
}

Fixed version (ground truth):
private void disconnectFromHub(){
  if (heartBeatJob != null && !heartBeatJob.isDone()) {
    heartBeatJob.cancel(false);
  }
  if (client != null) {
    client.removeListener(this);
    client.disconnect();
  }
}
Program: 62538
Project: 62538
Buggy source:
private PcapNetworkInterfaceWrapper(PcapNetworkInterface pcapNetworkInterface){
  if (pcapNetworkInterface == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.pcapNetworkInterface=pcapNetworkInterface;
}

Fixed version (ground truth):
private PcapNetworkInterfaceWrapper(PcapNetworkInterface pcapNetworkInterface){
  if (pcapNetworkInterface == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.pcapNetworkInterface=pcapNetworkInterface;
}
Program: 62539
Project: 62539
Buggy source:
/** 
 * Create the callback from the other   {@link AtlonaHandlerCallback}
 * @param wrappedCallback a non-null {@link AtlonaHandlerCallback}
 * @throws NullPointerException if wrappedCallback is null
 */
public StatefulHandlerCallback(AtlonaHandlerCallback wrappedCallback){
  if (wrappedCallback == null) {
    throw new NullPointerException("String_Node_Str");
  }
  _wrappedCallback=wrappedCallback;
}

Fixed version (ground truth):
/** 
 * Create the callback from the other   {@link AtlonaHandlerCallback}
 * @param wrappedCallback a non-null {@link AtlonaHandlerCallback}
 * @throws IllegalArgumentException if wrappedCallback is null
 */
public StatefulHandlerCallback(AtlonaHandlerCallback wrappedCallback){
  if (wrappedCallback == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  _wrappedCallback=wrappedCallback;
}
Program: 62540
Project: 62540
Buggy source:
public boolean unregisterDeviceStatusListener(DeviceStatusListener deviceStatusListener){
  if (deviceStatusListener == null) {
    throw new NullPointerException("String_Node_Str");
  }
  boolean result=deviceStatusListeners.remove(deviceStatusListener);
  if (result) {
    clearDeviceList();
  }
  return result;
}

Fixed version (ground truth):
public boolean unregisterDeviceStatusListener(DeviceStatusListener deviceStatusListener){
  if (deviceStatusListener == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  boolean result=deviceStatusListeners.remove(deviceStatusListener);
  if (result) {
    clearDeviceList();
  }
  return result;
}
Program: 62541
Project: 62541
Buggy source:
public boolean registerDeviceStatusListener(DeviceStatusListener deviceStatusListener){
  if (deviceStatusListener == null) {
    throw new NullPointerException("String_Node_Str");
  }
  boolean result=deviceStatusListeners.add(deviceStatusListener);
  if (result) {
  }
  return result;
}

Fixed version (ground truth):
public boolean registerDeviceStatusListener(DeviceStatusListener deviceStatusListener){
  if (deviceStatusListener == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  boolean result=deviceStatusListeners.add(deviceStatusListener);
  if (result) {
  }
  return result;
}
Program: 62542
Project: 62542
Buggy source:
public boolean registerApplianceStatusListener(ApplianceStatusListener applianceStatusListener){
  if (applianceStatusListener == null) {
    throw new NullPointerException("String_Node_Str");
  }
  boolean result=applianceStatusListeners.add(applianceStatusListener);
  if (result && isInitialized()) {
    onUpdate();
    for (    HomeDevice hd : getHomeDevices()) {
      applianceStatusListener.onApplianceAdded(hd);
    }
  }
  return result;
}

Fixed version (ground truth):
public boolean registerApplianceStatusListener(ApplianceStatusListener applianceStatusListener){
  if (applianceStatusListener == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  boolean result=applianceStatusListeners.add(applianceStatusListener);
  if (result && isInitialized()) {
    onUpdate();
    for (    HomeDevice hd : getHomeDevices()) {
      applianceStatusListener.onApplianceAdded(hd);
    }
  }
  return result;
}
Program: 62543
Project: 62543
Buggy source:
/** 
 * Create the callback from the other   {@link RioHandlerCallback}
 * @param wrappedCallback a non-null {@link RioHandlerCallback}
 * @throws NullPointerException if wrappedCallback is null
 */
public StatefulHandlerCallback(RioHandlerCallback wrappedCallback){
  if (wrappedCallback == null) {
    throw new NullPointerException("String_Node_Str");
  }
  _wrappedCallback=wrappedCallback;
}

Fixed version (ground truth):
/** 
 * Create the callback from the other   {@link RioHandlerCallback}
 * @param wrappedCallback a non-null {@link RioHandlerCallback}
 * @throws IllegalArgumentException if wrappedCallback is null
 */
public StatefulHandlerCallback(RioHandlerCallback wrappedCallback){
  if (wrappedCallback == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  _wrappedCallback=wrappedCallback;
}
Program: 62544
Project: 62544
Buggy source:
public void setUserName(String userName){
  this.user=user;
}

Fixed version (ground truth):
public void setUserName(String userName){
  this.user=userName;
}
Program: 62545
Project: 62545
Buggy source:
@Override public void run(){
  if (connected) {
    logger.debug("String_Node_Str",ip,port);
    sendCommand(new EiscpMessage.MessageBuilder().command(EiscpCommand.POWER_QUERY.getCommand()).value(EiscpCommand.POWER_QUERY.getValue()).build());
  }
}

Fixed version (ground truth):
@Override public void run(){
  logger.debug("String_Node_Str",ip,port);
  sendCommand(new EiscpMessage.MessageBuilder().command(EiscpCommand.POWER_QUERY.getCommand()).value(EiscpCommand.POWER_QUERY.getValue()).build());
}
Program: 62547
Project: 62547
Buggy source:
public static State toState(Device device,Channel channel){
  String level=device.getMetrics().getLevel();
  if (device instanceof Battery) {
    return getMultilevelState(level);
  }
 else   if (device instanceof Doorlock) {
    return getBinaryState(level.toLowerCase());
  }
 else   if (device instanceof SensorBinary) {
    if (channel.getAcceptedItemType().equals("String_Node_Str")) {
      return getDoorlockState(level.toLowerCase());
    }
 else {
      return getBinaryState(level.toLowerCase());
    }
  }
 else   if (device instanceof SensorMultilevel) {
    return getMultilevelState(level);
  }
 else   if (device instanceof SwitchBinary) {
    return getBinaryState(level.toLowerCase());
  }
 else   if (device instanceof SwitchMultilevel) {
    return getMultilevelState(level);
  }
 else   if (device instanceof SwitchRGBW) {
    return getColorState(device.getMetrics().getColor());
  }
 else   if (device instanceof SwitchToggle) {
  }
 else   if (device instanceof Thermostat) {
    return getMultilevelState(level);
  }
 else   if (device instanceof SwitchControl) {
    return getBinaryState(level.toLowerCase());
  }
 else   if (device instanceof ToggleButton) {
  }
  return UnDefType.UNDEF;
}

Fixed version (ground truth):
public static State toState(Device device,Channel channel){
  String level=device.getMetrics().getLevel();
  if (device instanceof Battery) {
    return getMultilevelState(level);
  }
 else   if (device instanceof Doorlock) {
    return getBinaryState(level.toLowerCase());
  }
 else   if (device instanceof SensorBinary) {
    if (channel.getAcceptedItemType().equals("String_Node_Str")) {
      return getDoorlockState(level.toLowerCase());
    }
 else {
      return getBinaryState(level.toLowerCase());
    }
  }
 else   if (device instanceof SensorMultilevel) {
    return getMultilevelState(level);
  }
 else   if (device instanceof SwitchBinary) {
    return getBinaryState(level.toLowerCase());
  }
 else   if (device instanceof SwitchMultilevel) {
    if (channel.getAcceptedItemType().equals("String_Node_Str")) {
      return getPercentState(level);
    }
 else {
      return getMultilevelState(level);
    }
  }
 else   if (device instanceof SwitchRGBW) {
    return getColorState(device.getMetrics().getColor());
  }
 else   if (device instanceof SwitchToggle) {
  }
 else   if (device instanceof Thermostat) {
    return getMultilevelState(level);
  }
 else   if (device instanceof SwitchControl) {
    return getBinaryState(level.toLowerCase());
  }
 else   if (device instanceof ToggleButton) {
  }
  return UnDefType.UNDEF;
}
Program: 62548
Project: 62548
Buggy source:
/** 
 * Transforms an value in an openHAB type.
 * @param multilevel sensor value
 * @return transformed openHAB state
 */
private static State getMultilevelState(String multilevelSensorValue){
  if (multilevelSensorValue != null) {
    return new DecimalType(multilevelSensorValue);
  }
  return UnDefType.UNDEF;
}

Fixed version (ground truth):
/** 
 * Transforms an value in an openHAB type.
 * @param multilevel sensor value
 * @return transformed openHAB state
 */
private static State getMultilevelState(String multilevelValue){
  if (multilevelValue != null) {
    return new DecimalType(multilevelValue);
  }
  return UnDefType.UNDEF;
}
Program: 62550
Project: 62550
Buggy source:
/** 
 * Sends the message, retries if there was an error.
 */
private Object[] sendMessage(int port,BinRpcMessage request,int socketRetryCounter) throws IOException {
  BinRpcMessage resp=null;
  try {
    Socket socket=socketHandler.getSocket(port);
    socket.getOutputStream().write(request.createMessage());
    resp=new BinRpcMessage(socket.getInputStream(),false,config.getEncoding());
    return new RpcResponseParser(request).parse(resp.getResponseData());
  }
 catch (  UnknownRpcFailureException rpcEx) {
    throw rpcEx;
  }
catch (  IOException ioEx) {
    if ("String_Node_Str".equals(request.getMethodName()) || socketRetryCounter >= MAX_SOCKET_RETRY) {
      throw ioEx;
    }
 else {
      socketRetryCounter++;
      logger.debug("String_Node_Str",socketRetryCounter,MAX_SOCKET_RETRY);
      socketHandler.removeSocket(port);
      return sendMessage(port,request,socketRetryCounter);
    }
  }
 finally {
    if (TRACE_ENABLED) {
      logger.trace("String_Node_Str",resp == null ? "String_Node_Str" : resp.toString());
    }
  }
}

Fixed version (ground truth):
/** 
 * Sends the message, retries if there was an error.
 */
private Object[] sendMessage(int port,BinRpcMessage request,int socketRetryCounter) throws IOException {
  BinRpcMessage resp=null;
  try {
    Socket socket=socketHandler.getSocket(port);
    socket.getOutputStream().write(request.createMessage());
    resp=new BinRpcMessage(socket.getInputStream(),false,config.getEncoding());
    return new RpcResponseParser(request).parse(resp.getResponseData());
  }
 catch (  UnknownRpcFailureException|UnknownParameterSetException rpcEx) {
    throw rpcEx;
  }
catch (  IOException ioEx) {
    if ("String_Node_Str".equals(request.getMethodName()) || socketRetryCounter >= MAX_SOCKET_RETRY) {
      throw ioEx;
    }
 else {
      socketRetryCounter++;
      logger.debug("String_Node_Str",socketRetryCounter,MAX_SOCKET_RETRY);
      socketHandler.removeSocket(port);
      return sendMessage(port,request,socketRetryCounter);
    }
  }
 finally {
    if (TRACE_ENABLED) {
      logger.trace("String_Node_Str",resp == null ? "String_Node_Str" : resp.toString());
    }
  }
}
Program: 62551
Project: 62551
Buggy source:
/** 
 * Loads all datapoint metadata into the given channel.
 */
public void addChannelDatapoints(HmChannel channel,HmParamsetType paramsetType) throws IOException {
  RpcRequest request=createRpcRequest("String_Node_Str");
  request.addArg(getRpcAddress(channel.getDevice().getAddress()) + "String_Node_Str" + channel.getNumber());
  request.addArg(paramsetType.toString());
  new GetParamsetDescriptionParser(channel,paramsetType).parse(sendMessage(config.getRpcPort(channel),request));
}

Fixed version (ground truth):
/** 
 * Loads all datapoint metadata into the given channel.
 */
public void addChannelDatapoints(HmChannel channel,HmParamsetType paramsetType) throws IOException {
  RpcRequest request=createRpcRequest("String_Node_Str");
  request.addArg(getRpcAddress(channel.getDevice().getAddress()) + "String_Node_Str" + channel.getNumber());
  request.addArg(paramsetType.toString());
  try {
    new GetParamsetDescriptionParser(channel,paramsetType).parse(sendMessage(config.getRpcPort(channel),request));
  }
 catch (  UnknownParameterSetException ex) {
    if (paramsetType == HmParamsetType.VALUES) {
      throw ex;
    }
  }
}
Program: 62552
Project: 62552
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected synchronized Object[] sendMessage(int port,RpcRequest request) throws IOException {
  try {
    if (TRACE_ENABLED) {
      logger.trace("String_Node_Str",port,request);
    }
    BytesContentProvider content=new BytesContentProvider(request.createMessage());
    String url=String.format("String_Node_Str",config.getGatewayAddress(),port);
    ContentResponse response=httpClient.POST(url).content(content).timeout(config.getTimeout(),TimeUnit.SECONDS).header(HttpHeader.CONTENT_TYPE,"String_Node_Str" + config.getEncoding()).send();
    String result=new String(response.getContent(),config.getEncoding());
    if (TRACE_ENABLED) {
      logger.trace("String_Node_Str",port,result);
    }
    Object[] data=new XmlRpcResponse(new ByteArrayInputStream(result.getBytes(config.getEncoding())),config.getEncoding()).getResponseData();
    return new RpcResponseParser(request).parse(data);
  }
 catch (  UnknownRpcFailureException ex) {
    throw ex;
  }
catch (  Exception ex) {
    throw new IOException(ex.getMessage(),ex);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected synchronized Object[] sendMessage(int port,RpcRequest request) throws IOException {
  try {
    if (TRACE_ENABLED) {
      logger.trace("String_Node_Str",port,request);
    }
    BytesContentProvider content=new BytesContentProvider(request.createMessage());
    String url=String.format("String_Node_Str",config.getGatewayAddress(),port);
    ContentResponse response=httpClient.POST(url).content(content).timeout(config.getTimeout(),TimeUnit.SECONDS).header(HttpHeader.CONTENT_TYPE,"String_Node_Str" + config.getEncoding()).send();
    String result=new String(response.getContent(),config.getEncoding());
    if (TRACE_ENABLED) {
      logger.trace("String_Node_Str",port,result);
    }
    Object[] data=new XmlRpcResponse(new ByteArrayInputStream(result.getBytes(config.getEncoding())),config.getEncoding()).getResponseData();
    return new RpcResponseParser(request).parse(data);
  }
 catch (  UnknownRpcFailureException|UnknownParameterSetException ex) {
    throw ex;
  }
catch (  Exception ex) {
    throw new IOException(ex.getMessage(),ex);
  }
}
Program: 62553
Project: 62553
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override @SuppressWarnings("String_Node_Str") public Object[] parse(Object[] message) throws IOException {
  if (message != null && message.length > 0) {
    Object responseData=message[0];
    if (responseData instanceof Map) {
      Map<String,Object> map=(Map<String,Object>)responseData;
      if (map.containsKey("String_Node_Str")) {
        Number faultCode=toNumber(map.get("String_Node_Str"));
        String faultString=toString(map.get("String_Node_Str"));
        String faultMessage=String.format("String_Node_Str",faultCode,faultString,response);
        if (faultCode.intValue() == -1 && StringUtils.equals("String_Node_Str",faultString)) {
          throw new UnknownRpcFailureException(faultMessage);
        }
        throw new IOException(faultMessage);
      }
    }
    return message;
  }
  throw new IOException("String_Node_Str" + message);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @SuppressWarnings("String_Node_Str") public Object[] parse(Object[] message) throws IOException {
  if (message != null && message.length > 0) {
    Object responseData=message[0];
    if (responseData instanceof Map) {
      Map<String,Object> map=(Map<String,Object>)responseData;
      if (map.containsKey("String_Node_Str")) {
        Number faultCode=toNumber(map.get("String_Node_Str"));
        String faultString=toString(map.get("String_Node_Str"));
        String faultMessage=String.format("String_Node_Str",faultCode,faultString,response);
        if (faultCode.intValue() == -1 && StringUtils.equals("String_Node_Str",faultString)) {
          throw new UnknownRpcFailureException(faultMessage);
        }
 else         if (faultCode.intValue() == -3 && StringUtils.equals("String_Node_Str",faultString)) {
          throw new UnknownParameterSetException(faultMessage);
        }
        throw new IOException(faultMessage);
      }
    }
    return message;
  }
  throw new IOException("String_Node_Str" + message);
}
Program: 62555
Project: 62555
Buggy source:
public void warmer(){
  brightness=com.warmer(bulb,brightness);
}

Fixed version (ground truth):
public void warmer(){
  colorTemperature=com.warmer(bulb,colorTemperature);
}
Program: 62556
Project: 62556
Buggy source:
public void cooler(){
  brightness=com.cooler(bulb,brightness);
}

Fixed version (ground truth):
public void cooler(){
  colorTemperature=com.cooler(bulb,colorTemperature);
}
Program: 62558
Project: 62558
Buggy source:
@Override protected State getNAThingProperty(String channelId){
switch (channelId) {
case CHANNEL_BATTERY_LEVEL:
    return ChannelTypeUtils.toDecimalType(getBatteryPercent());
case CHANNEL_LOW_BATTERY:
  return module.getBatteryVp() < batteryLow ? OnOffType.ON : OnOffType.OFF;
case CHANNEL_LAST_MESSAGE:
return ChannelTypeUtils.toDateTimeType(module.getLastMessage());
case CHANNEL_RF_STATUS:
Integer rfStatus=module.getRfStatus();
return ChannelTypeUtils.toDecimalType(getSignalStrength(rfStatus));
default :
return super.getNAThingProperty(channelId);
}
}

Fixed version (ground truth):
@Override protected State getNAThingProperty(String channelId){
  if (module != null) {
switch (channelId) {
case CHANNEL_BATTERY_LEVEL:
      return ChannelTypeUtils.toDecimalType(getBatteryPercent());
case CHANNEL_LOW_BATTERY:
    return module.getBatteryVp() < batteryLow ? OnOffType.ON : OnOffType.OFF;
case CHANNEL_LAST_MESSAGE:
  return ChannelTypeUtils.toDateTimeType(module.getLastMessage());
case CHANNEL_RF_STATUS:
Integer rfStatus=module.getRfStatus();
return ChannelTypeUtils.toDecimalType(getSignalStrength(rfStatus));
}
}
return super.getNAThingProperty(channelId);
}