nus-yam/ex-repair huggingface dataset:
Program: 39820
Project: 39820
Buggy source:
@Override public DoFn<ExtendedRecord,KV<String,TaxonRecord>> interpret(){
  return new DoFn<ExtendedRecord,KV<String,TaxonRecord>>(){
    @ProcessElement public void processElement(    ProcessContext context){
      ExtendedRecord extendedRecord=context.element();
      String id=extendedRecord.getId();
      Collection<Validation> validations=new ArrayList<>();
      String wsPropertiesPath=context.getPipelineOptions().as(DataProcessingPipelineOptions.class).getWsProperties();
      TaxonRecord taxonRecord=new TaxonRecord();
      Interpretation.of(extendedRecord).using(TaxonomyInterpreter.taxonomyInterpreter(taxonRecord,wsPropertiesPath)).forEachValidation(trace -> validations.add(toValidation(trace.getContext())));
      context.output(getDataTag(),KV.of(id,taxonRecord));
      if (!validations.isEmpty()) {
        OccurrenceIssue issue=OccurrenceIssue.newBuilder().setId(id).setIssues(validations).build();
        context.output(getIssueTag(),KV.of(id,issue));
      }
    }
  }
;
}

Fixed version (ground truth):
@Override public DoFn<ExtendedRecord,KV<String,TaxonRecord>> interpret(){
  return new DoFn<ExtendedRecord,KV<String,TaxonRecord>>(){
    @ProcessElement public void processElement(    ProcessContext context){
      ExtendedRecord extendedRecord=context.element();
      String id=extendedRecord.getId();
      Collection<Validation> validations=new ArrayList<>();
      String wsPropertiesPath=context.getPipelineOptions().as(DataProcessingPipelineOptions.class).getWsProperties();
      TaxonRecord taxonRecord=new TaxonRecord();
      Interpretation.of(extendedRecord).using(TaxonomyInterpreter.taxonomyInterpreter(taxonRecord,wsPropertiesPath)).forEachValidation(trace -> validations.add(toValidation(trace.getContext())));
      if (Objects.nonNull(taxonRecord.getId())) {
        context.output(getDataTag(),KV.of(id,taxonRecord));
      }
 else {
        LOG.info("String_Node_Str",id);
      }
      if (!validations.isEmpty()) {
        OccurrenceIssue issue=OccurrenceIssue.newBuilder().setId(id).setIssues(validations).build();
        context.output(getIssueTag(),KV.of(id,issue));
      }
    }
  }
;
}
Program: 39821
Project: 39821
Buggy source:
@ProcessElement public void processElement(ProcessContext context){
  ExtendedRecord extendedRecord=context.element();
  String id=extendedRecord.getId();
  Collection<Validation> validations=new ArrayList<>();
  String wsPropertiesPath=context.getPipelineOptions().as(DataProcessingPipelineOptions.class).getWsProperties();
  TaxonRecord taxonRecord=new TaxonRecord();
  Interpretation.of(extendedRecord).using(TaxonomyInterpreter.taxonomyInterpreter(taxonRecord,wsPropertiesPath)).forEachValidation(trace -> validations.add(toValidation(trace.getContext())));
  context.output(getDataTag(),KV.of(id,taxonRecord));
  if (!validations.isEmpty()) {
    OccurrenceIssue issue=OccurrenceIssue.newBuilder().setId(id).setIssues(validations).build();
    context.output(getIssueTag(),KV.of(id,issue));
  }
}

Fixed version (ground truth):
@ProcessElement public void processElement(ProcessContext context){
  ExtendedRecord extendedRecord=context.element();
  String id=extendedRecord.getId();
  Collection<Validation> validations=new ArrayList<>();
  String wsPropertiesPath=context.getPipelineOptions().as(DataProcessingPipelineOptions.class).getWsProperties();
  TaxonRecord taxonRecord=new TaxonRecord();
  Interpretation.of(extendedRecord).using(TaxonomyInterpreter.taxonomyInterpreter(taxonRecord,wsPropertiesPath)).forEachValidation(trace -> validations.add(toValidation(trace.getContext())));
  if (Objects.nonNull(taxonRecord.getId())) {
    context.output(getDataTag(),KV.of(id,taxonRecord));
  }
 else {
    LOG.info("String_Node_Str",id);
  }
  if (!validations.isEmpty()) {
    OccurrenceIssue issue=OccurrenceIssue.newBuilder().setId(id).setIssues(validations).build();
    context.output(getIssueTag(),KV.of(id,issue));
  }
}
Program: 39822
Project: 39822
Buggy source:
/** 
 * {@link DwcTerm#individualCount} interpretation.
 */
static ExtendedRecordInterpreter interpretIndividualCount(InterpretedExtendedRecord interpretedExtendedRecord){
  return (  ExtendedRecord extendedRecord) -> SimpleTypeParser.parseInt(extendedRecord,DwcTerm.individualCount,parseResult -> {
    Interpretation<ExtendedRecord> interpretation=Interpretation.of(extendedRecord);
    if (parseResult.isPresent()) {
      interpretedExtendedRecord.setIndividualCount(parseResult.get());
    }
 else {
      interpretation.withValidation(Trace.of(DwcTerm.individualCount.name(),IssueType.INDIVIDUAL_COUNT_INVALID));
    }
    return interpretation;
  }
);
}

Fixed version (ground truth):
/** 
 * {@link DwcTerm#individualCount} interpretation.
 */
static ExtendedRecordInterpreter interpretIndividualCount(InterpretedExtendedRecord interpretedExtendedRecord){
  return (  ExtendedRecord extendedRecord) -> SimpleTypeParser.parseInt(extendedRecord,DwcTerm.individualCount,parseResult -> {
    Interpretation<ExtendedRecord> interpretation=Interpretation.of(extendedRecord);
    if (parseResult.isPresent()) {
      interpretedExtendedRecord.setIndividualCount(parseResult.get());
    }
 else {
      interpretation.withValidation(Trace.of(DwcTerm.individualCount.name(),IssueType.INDIVIDUAL_COUNT_INVALID));
    }
    return interpretation;
  }
).orElse(Interpretation.of(extendedRecord));
}
Program: 39823
Project: 39823
Buggy source:
/** 
 * {@link DwcTerm#establishmentMeans} interpretation.
 */
static ExtendedRecordInterpreter interpretEstablishmentMeans(InterpretedExtendedRecord interpretedExtendedRecord){
  return (  ExtendedRecord extendedRecord) -> VocabularyParsers.establishmentMeansParser().map(extendedRecord,parseResult -> {
    Interpretation<ExtendedRecord> interpretation=Interpretation.of(extendedRecord);
    if (parseResult.isSuccessful()) {
      interpretedExtendedRecord.setEstablishmentMeans(parseResult.getPayload().name());
    }
    return interpretation;
  }
).get();
}

Fixed version (ground truth):
/** 
 * {@link DwcTerm#establishmentMeans} interpretation.
 */
static ExtendedRecordInterpreter interpretEstablishmentMeans(InterpretedExtendedRecord interpretedExtendedRecord){
  return (  ExtendedRecord extendedRecord) -> VocabularyParsers.establishmentMeansParser().map(extendedRecord,parseResult -> {
    Interpretation<ExtendedRecord> interpretation=Interpretation.of(extendedRecord);
    if (parseResult.isSuccessful()) {
      interpretedExtendedRecord.setEstablishmentMeans(parseResult.getPayload().name());
    }
    return interpretation;
  }
).orElse(Interpretation.of(extendedRecord));
}
Program: 39824
Project: 39824
Buggy source:
/** 
 * {@link DwcTerm#typeStatus} interpretation.
 */
static ExtendedRecordInterpreter interpretTypeStatus(InterpretedExtendedRecord interpretedExtendedRecord){
  return (  ExtendedRecord extendedRecord) -> VocabularyParsers.typeStatusParser().map(extendedRecord,parseResult -> {
    Interpretation<ExtendedRecord> interpretation=Interpretation.of(extendedRecord);
    if (parseResult.isSuccessful()) {
      interpretedExtendedRecord.setTypeStatus(parseResult.getPayload().name());
    }
 else {
      interpretation.withValidation(Trace.of(DwcTerm.typeStatus.name(),IssueType.TYPE_STATUS_INVALID));
    }
    return interpretation;
  }
).get();
}

Fixed version (ground truth):
/** 
 * {@link DwcTerm#typeStatus} interpretation.
 */
static ExtendedRecordInterpreter interpretTypeStatus(InterpretedExtendedRecord interpretedExtendedRecord){
  return (  ExtendedRecord extendedRecord) -> VocabularyParsers.typeStatusParser().map(extendedRecord,parseResult -> {
    Interpretation<ExtendedRecord> interpretation=Interpretation.of(extendedRecord);
    if (parseResult.isSuccessful()) {
      interpretedExtendedRecord.setTypeStatus(parseResult.getPayload().name());
    }
 else {
      interpretation.withValidation(Trace.of(DwcTerm.typeStatus.name(),IssueType.TYPE_STATUS_INVALID));
    }
    return interpretation;
  }
).orElse(Interpretation.of(extendedRecord));
}
Program: 39825
Project: 39825
Buggy source:
/** 
 * {@link DwcTerm#basisOfRecord} interpretation.
 */
static ExtendedRecordInterpreter interpretBasisOfRecord(InterpretedExtendedRecord interpretedExtendedRecord){
  return (  ExtendedRecord extendedRecord) -> VocabularyParsers.basisOfRecordParser().map(extendedRecord,parseResult -> {
    Interpretation<ExtendedRecord> interpretation=Interpretation.of(extendedRecord);
    if (parseResult.isSuccessful()) {
      interpretedExtendedRecord.setBasisOfRecord(parseResult.getPayload().name());
    }
 else {
      interpretation.withValidation(Trace.of(DwcTerm.basisOfRecord.name(),IssueType.BASIS_OF_RECORD_INVALID));
    }
    return interpretation;
  }
).get();
}

Fixed version (ground truth):
/** 
 * {@link DwcTerm#basisOfRecord} interpretation.
 */
static ExtendedRecordInterpreter interpretBasisOfRecord(InterpretedExtendedRecord interpretedExtendedRecord){
  return (  ExtendedRecord extendedRecord) -> VocabularyParsers.basisOfRecordParser().map(extendedRecord,parseResult -> {
    Interpretation<ExtendedRecord> interpretation=Interpretation.of(extendedRecord);
    if (parseResult.isSuccessful()) {
      interpretedExtendedRecord.setBasisOfRecord(parseResult.getPayload().name());
    }
 else {
      interpretation.withValidation(Trace.of(DwcTerm.basisOfRecord.name(),IssueType.BASIS_OF_RECORD_INVALID));
    }
    return interpretation;
  }
).orElse(Interpretation.of(extendedRecord));
}
Program: 39826
Project: 39826
Buggy source:
/** 
 * {@link DwcTerm#lifeStage} interpretation.
 */
static ExtendedRecordInterpreter interpretLifeStage(InterpretedExtendedRecord interpretedExtendedRecord){
  return (  ExtendedRecord extendedRecord) -> VocabularyParsers.lifeStageParser().map(extendedRecord,parseResult -> {
    Interpretation<ExtendedRecord> interpretation=Interpretation.of(extendedRecord);
    if (parseResult.isSuccessful()) {
      interpretedExtendedRecord.setLifeStage(parseResult.getPayload().name());
    }
    return interpretation;
  }
).get();
}

Fixed version (ground truth):
/** 
 * {@link DwcTerm#lifeStage} interpretation.
 */
static ExtendedRecordInterpreter interpretLifeStage(InterpretedExtendedRecord interpretedExtendedRecord){
  return (  ExtendedRecord extendedRecord) -> VocabularyParsers.lifeStageParser().map(extendedRecord,parseResult -> {
    Interpretation<ExtendedRecord> interpretation=Interpretation.of(extendedRecord);
    if (parseResult.isSuccessful()) {
      interpretedExtendedRecord.setLifeStage(parseResult.getPayload().name());
    }
    return interpretation;
  }
).orElse(Interpretation.of(extendedRecord));
}
Program: 39827
Project: 39827
Buggy source:
/** 
 * {@link DwcTerm#sex} interpretation.
 */
static ExtendedRecordInterpreter interpretSex(InterpretedExtendedRecord interpretedExtendedRecord){
  return (  ExtendedRecord extendedRecord) -> VocabularyParsers.sexParser().map(extendedRecord,parseResult -> {
    Interpretation<ExtendedRecord> interpretation=Interpretation.of(extendedRecord);
    if (parseResult.isSuccessful()) {
      interpretedExtendedRecord.setSex(parseResult.getPayload().name());
    }
    return interpretation;
  }
).get();
}

Fixed version (ground truth):
/** 
 * {@link DwcTerm#sex} interpretation.
 */
static ExtendedRecordInterpreter interpretSex(InterpretedExtendedRecord interpretedExtendedRecord){
  return (  ExtendedRecord extendedRecord) -> VocabularyParsers.sexParser().map(extendedRecord,parseResult -> {
    Interpretation<ExtendedRecord> interpretation=Interpretation.of(extendedRecord);
    if (parseResult.isSuccessful()) {
      interpretedExtendedRecord.setSex(parseResult.getPayload().name());
    }
    return interpretation;
  }
).orElse(Interpretation.of(extendedRecord));
}
Program: 39828
Project: 39828
Buggy source:
/** 
 * {@link DwcTerm#continent} interpretation.
 */
static LocationInterpreter interpretContinent(Location locationRecord){
  return (  ExtendedRecord extendedRecord) -> VocabularyParsers.continentParser().map(extendedRecord,parseResult -> {
    Interpretation<ExtendedRecord> interpretation=Interpretation.of(extendedRecord);
    if (parseResult.isSuccessful()) {
      locationRecord.setContinent(parseResult.getPayload().name());
    }
 else {
      interpretation.withValidation(Trace.of(DwcTerm.continent.name(),IssueType.CONTINENT_INVALID));
    }
    return interpretation;
  }
).get();
}

Fixed version (ground truth):
/** 
 * {@link DwcTerm#continent} interpretation.
 */
static LocationInterpreter interpretContinent(Location locationRecord){
  return (  ExtendedRecord extendedRecord) -> VocabularyParsers.continentParser().map(extendedRecord,parseResult -> {
    Interpretation<ExtendedRecord> interpretation=Interpretation.of(extendedRecord);
    if (parseResult.isSuccessful()) {
      locationRecord.setContinent(parseResult.getPayload().name());
    }
 else {
      interpretation.withValidation(Trace.of(DwcTerm.continent.name(),IssueType.CONTINENT_INVALID));
    }
    return interpretation;
  }
).orElse(Interpretation.of(extendedRecord));
}
Program: 39829
Project: 39829
Buggy source:
/** 
 * {@link DwcTerm#coordinatePrecision} interpretation.
 */
static LocationInterpreter interpretCoordinatePrecision(Location locationRecord){
  return (  ExtendedRecord extendedRecord) -> SimpleTypeParser.parseDouble(extendedRecord,DwcTerm.coordinatePrecision,parseResult -> {
    Interpretation<ExtendedRecord> interpretation=Interpretation.of(extendedRecord);
    Double result=parseResult.orElse(null);
    if (result != null && result >= COORDINATE_PRECISION_LOWER_BOUND && result <= COORDINATE_PRECISION_UPPER_BOUND) {
      locationRecord.setCoordinatePrecision(result);
    }
 else {
      interpretation.withValidation(Trace.of(DwcTerm.coordinatePrecision.name(),IssueType.COORDINATE_PRECISION_INVALID));
    }
    return interpretation;
  }
);
}

Fixed version (ground truth):
/** 
 * {@link DwcTerm#coordinatePrecision} interpretation.
 */
static LocationInterpreter interpretCoordinatePrecision(Location locationRecord){
  return (  ExtendedRecord extendedRecord) -> SimpleTypeParser.parseDouble(extendedRecord,DwcTerm.coordinatePrecision,parseResult -> {
    Interpretation<ExtendedRecord> interpretation=Interpretation.of(extendedRecord);
    Double result=parseResult.orElse(null);
    if (result != null && result >= COORDINATE_PRECISION_LOWER_BOUND && result <= COORDINATE_PRECISION_UPPER_BOUND) {
      locationRecord.setCoordinatePrecision(result);
    }
 else {
      interpretation.withValidation(Trace.of(DwcTerm.coordinatePrecision.name(),IssueType.COORDINATE_PRECISION_INVALID));
    }
    return interpretation;
  }
).orElse(Interpretation.of(extendedRecord));
}
Program: 39830
Project: 39830
Buggy source:
/** 
 * {@link DwcTerm#coordinateUncertaintyInMeters} interpretation.
 */
static LocationInterpreter interpretCoordinateUncertaintyInMeters(Location locationRecord){
  return (  ExtendedRecord extendedRecord) -> {
    Interpretation<ExtendedRecord> interpretation=Interpretation.of(extendedRecord);
    String value=extendedRecord.getCoreTerms().get(DwcTerm.coordinateUncertaintyInMeters.qualifiedName());
    ParseResult<Double> parseResult=MeterRangeParser.parseMeters(value.trim());
    Double result=parseResult.isSuccessful() ? Math.abs(parseResult.getPayload()) : null;
    if (result != null && result > COORDINATE_UNCERTAINTY_METERS_LOWER_BOUND && result < COORDINATE_UNCERTAINTY_METERS_UPPER_BOUND) {
      locationRecord.setCoordinateUncertaintyInMeters(result);
    }
 else {
      interpretation.withValidation(Trace.of(DwcTerm.coordinateUncertaintyInMeters.name(),IssueType.COORDINATE_UNCERTAINTY_METERS_INVALID));
    }
    return interpretation;
  }
;
}

Fixed version (ground truth):
/** 
 * {@link DwcTerm#coordinateUncertaintyInMeters} interpretation.
 */
static LocationInterpreter interpretCoordinateUncertaintyInMeters(Location locationRecord){
  return (  ExtendedRecord extendedRecord) -> {
    Interpretation<ExtendedRecord> interpretation=Interpretation.of(extendedRecord);
    String value=extendedRecord.getCoreTerms().get(DwcTerm.coordinateUncertaintyInMeters.qualifiedName());
    ParseResult<Double> parseResult=MeterRangeParser.parseMeters(value);
    Double result=parseResult.isSuccessful() ? Math.abs(parseResult.getPayload()) : null;
    if (result != null && result > COORDINATE_UNCERTAINTY_METERS_LOWER_BOUND && result < COORDINATE_UNCERTAINTY_METERS_UPPER_BOUND) {
      locationRecord.setCoordinateUncertaintyInMeters(result);
    }
 else {
      interpretation.withValidation(Trace.of(DwcTerm.coordinateUncertaintyInMeters.name(),IssueType.COORDINATE_UNCERTAINTY_METERS_INVALID));
    }
    return interpretation;
  }
;
}
Program: 39831
Project: 39831
Buggy source:
/** 
 * Parses an integer value and applies a mapping function to its response (if any).
 */
public static <U>U parseInt(ExtendedRecord extendedRecord,DwcTerm term,Function<Optional<Integer>,U> mapper){
  return Optional.ofNullable(extendedRecord.getCoreTerms().get(term.qualifiedName())).map(termValue -> mapper.apply(Optional.ofNullable(NumberParser.parseInteger(termValue)))).get();
}

Fixed version (ground truth):
/** 
 * Parses an integer value and applies a mapping function to its response (if any).
 */
public static <U>Optional<U> parseInt(ExtendedRecord extendedRecord,DwcTerm term,Function<Optional<Integer>,U> mapper){
  return Optional.ofNullable(extendedRecord.getCoreTerms().get(term.qualifiedName())).map(termValue -> mapper.apply(Optional.ofNullable(NumberParser.parseInteger(termValue))));
}
Program: 39832
Project: 39832
Buggy source:
/** 
 * Parses a double value and applies a mapping function to its response (if any).
 */
public static <U>U parseDouble(ExtendedRecord extendedRecord,DwcTerm term,Function<Optional<Double>,U> mapper){
  return Optional.ofNullable(extendedRecord.getCoreTerms().get(term.qualifiedName())).map(termValue -> mapper.apply(Optional.ofNullable(NumberParser.parseDouble(termValue)))).get();
}

Fixed version (ground truth):
/** 
 * Parses a double value and applies a mapping function to its response (if any).
 */
public static <U>Optional<U> parseDouble(ExtendedRecord extendedRecord,DwcTerm term,Function<Optional<Double>,U> mapper){
  return Optional.ofNullable(extendedRecord.getCoreTerms().get(term.qualifiedName())).map(termValue -> mapper.apply(Optional.ofNullable(NumberParser.parseDouble(termValue))));
}
Program: 39833
Project: 39833
Buggy source:
/** 
 * Parses a boolean value and applies mapping functions to its response (if any).
 */
public static <U>U parseBoolean(ExtendedRecord extendedRecord,DwcTerm term,Function<ParseResult<Boolean>,U> mapper){
  return Optional.ofNullable(extendedRecord.getCoreTerms().get(term.qualifiedName())).map(termValue -> mapper.apply(BOOLEAN_PARSER.parse(termValue))).get();
}

Fixed version (ground truth):
/** 
 * Parses a boolean value and applies mapping functions to its response (if any).
 */
public static <U>Optional<U> parseBoolean(ExtendedRecord extendedRecord,DwcTerm term,Function<ParseResult<Boolean>,U> mapper){
  return Optional.ofNullable(extendedRecord.getCoreTerms().get(term.qualifiedName())).map(termValue -> mapper.apply(BOOLEAN_PARSER.parse(termValue)));
}
Program: 39835
Project: 39835
Buggy source:
private static Optional<Properties> loadProperties(Path propertiesPath){
  Function<Path,InputStream> absolute=path -> {
    try {
      return new FileInputStream(path.toFile());
    }
 catch (    FileNotFoundException ex) {
      throw new IllegalArgumentException(ex.getMessage(),ex);
    }
  }
;
  Function<Path,InputStream> resource=path -> Thread.currentThread().getContextClassLoader().getResourceAsStream(path.toString());
  Function<Path,InputStream> function=propertiesPath.isAbsolute() ? absolute : resource;
  Properties props=new Properties();
  try (InputStream in=function.apply(propertiesPath)){
    props.load(in);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",propertiesPath.toString(),e);
    return Optional.empty();
  }
  return Optional.of(props);
}

Fixed version (ground truth):
private static Optional<Properties> loadProperties(Path propertiesPath){
  Function<Path,InputStream> absolute=path -> {
    try {
      return new FileInputStream(path.toFile());
    }
 catch (    FileNotFoundException ex) {
      LOG.error("String_Node_Str",propertiesPath.toString(),ex);
      throw new IllegalArgumentException(ex.getMessage(),ex);
    }
  }
;
  Function<Path,InputStream> resource=path -> Thread.currentThread().getContextClassLoader().getResourceAsStream(path.toString());
  Function<Path,InputStream> function=propertiesPath.isAbsolute() ? absolute : resource;
  Properties props=new Properties();
  try (InputStream in=function.apply(propertiesPath)){
    props.load(in);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",propertiesPath.toString(),e);
    return Optional.empty();
  }
  return Optional.of(props);
}
Program: 39836
Project: 39836
Buggy source:
public <U>Interpretation<U> using(Function<? super T,Interpretation<U>> mapper){
  Interpretation<U> interpretation=mapper.apply(value);
  List<Trace<LineageType>> newLineage=new ArrayList<>(lineage);
  newLineage.addAll(interpretation.lineage);
  List<Trace<IssueType>> newValidations=new ArrayList<>(validations);
  newValidations.addAll(interpretation.validations);
  return new Interpretation<>(interpretation.value,newValidations,newLineage);
}

Fixed version (ground truth):
public <U>Interpretation<U> using(Function<? super T,Interpretation<U>> mapper){
  Interpretation<U> interpretation=mapper.apply(value);
  List<Trace<LineageType>> newLineage=new ArrayList<>(lineage);
  if (Objects.nonNull(interpretation.lineage)) {
    newLineage.addAll(interpretation.lineage);
  }
  List<Trace<IssueType>> newValidations=new ArrayList<>(validations);
  if (Objects.nonNull(interpretation.validations)) {
    newValidations.addAll(interpretation.validations);
  }
  return new Interpretation<>(interpretation.value,newValidations,newLineage);
}
Program: 39837
Project: 39837
Buggy source:
/** 
 * Parses a single DMS coordinate
 * @return the converted decimal up to 6 decimals accuracy
 */
@VisibleForTesting protected static double parseDMS(String coord,boolean lat){
  final String DIRS=lat ? "String_Node_Str" : "String_Node_Str";
  coord=coord.trim().toUpperCase();
  if (coord.length() > 3) {
    char dir='n';
    if (DIRS.contains(String.valueOf(coord.charAt(0)))) {
      dir=coord.charAt(0);
      coord=coord.substring(1);
    }
 else     if (DIRS.contains(String.valueOf(coord.charAt(coord.length() - 1)))) {
      dir=coord.charAt(coord.length() - 1);
      coord=coord.substring(0,coord.length() - 1);
    }
    Matcher m=DMS_SINGLE.matcher(coord);
    if (m.find()) {
      return coordFromMatcher(m,1,2,3,String.valueOf(dir));
    }
  }
  throw new IllegalArgumentException("String_Node_Str" + coord);
}

Fixed version (ground truth):
/** 
 * Parses a single DMS coordinate
 * @return the converted decimal up to 6 decimals accuracy
 */
private static double parseDMS(String coord,boolean lat){
  final String DIRS=lat ? "String_Node_Str" : "String_Node_Str";
  coord=coord.trim().toUpperCase();
  if (coord.length() > 3) {
    char dir='n';
    if (DIRS.contains(String.valueOf(coord.charAt(0)))) {
      dir=coord.charAt(0);
      coord=coord.substring(1);
    }
 else     if (DIRS.contains(String.valueOf(coord.charAt(coord.length() - 1)))) {
      dir=coord.charAt(coord.length() - 1);
      coord=coord.substring(0,coord.length() - 1);
    }
    Matcher m=DMS_SINGLE.matcher(coord);
    if (m.find()) {
      return coordFromMatcher(m,1,2,3,String.valueOf(dir));
    }
  }
  throw new IllegalArgumentException("String_Node_Str" + coord);
}
Program: 39838
Project: 39838
Buggy source:
public static ParsedField<LatLng> parseVerbatimCoordinates(final String coordinates){
  if (Strings.isNullOrEmpty(coordinates)) {
    return ParsedField.fail(new InterpretationIssue(IssueType.COORDINATE_INVALID,DwcTerm.verbatimCoordinates));
  }
  Matcher m=DMS_COORD.matcher(coordinates);
  if (m.find()) {
    final String dir1=m.group(4);
    final String dir2=m.group(8);
    double c1=coordFromMatcher(m,1,2,3,dir1);
    double c2=coordFromMatcher(m,5,6,7,dir2);
    if (isLat(dir1) && !isLat(dir2)) {
      return validateAndRound(c1,c2);
    }
 else     if (!isLat(dir1) && isLat(dir2)) {
      return validateAndRound(c2,c1);
    }
 else {
      return ParsedField.fail(new InterpretationIssue(IssueType.COORDINATE_INVALID,DwcTerm.decimalLatitude,DwcTerm.decimalLongitude));
    }
  }
 else   if (coordinates.length() > 4) {
    for (    final char delim : "String_Node_Str".toCharArray()) {
      int cnt=StringUtils.countMatches(coordinates,String.valueOf(delim));
      if (cnt == 1) {
        String[] latlon=StringUtils.split(coordinates,delim);
        return parseLatLng(latlon[0],latlon[1]);
      }
    }
  }
  return ParsedField.fail(new InterpretationIssue(IssueType.COORDINATE_INVALID,DwcTerm.decimalLatitude,DwcTerm.decimalLongitude));
}

Fixed version (ground truth):
public static ParsedField<LatLng> parseVerbatimCoordinates(final String coordinates){
  if (Strings.isNullOrEmpty(coordinates)) {
    return ParsedField.fail(new InterpretationIssue(IssueType.COORDINATE_INVALID,DwcTerm.verbatimCoordinates));
  }
  Matcher m=DMS_COORD.matcher(coordinates);
  if (m.find()) {
    final String dir1=m.group(4);
    final String dir2=m.group(8);
    double c1=coordFromMatcher(m,1,2,3,dir1);
    double c2=coordFromMatcher(m,5,6,7,dir2);
    if (isLat(dir1) && !isLat(dir2)) {
      return validateAndRound(c1,c2);
    }
 else     if (!isLat(dir1) && isLat(dir2)) {
      return validateAndRound(c2,c1);
    }
 else {
      return ParsedField.fail(new InterpretationIssue(IssueType.COORDINATE_INVALID,DwcTerm.decimalLatitude,DwcTerm.decimalLongitude));
    }
  }
 else   if (coordinates.length() > 4) {
    for (    final char delim : "String_Node_Str".toCharArray()) {
      int cnt=StringUtils.countMatches(coordinates,String.valueOf(delim));
      if (cnt == 1) {
        String[] latlon=StringUtils.split(coordinates,delim);
        if (latlon.length > 1) {
          return parseLatLng(latlon[0],latlon[1]);
        }
      }
    }
  }
  return ParsedField.fail(new InterpretationIssue(IssueType.COORDINATE_INVALID,DwcTerm.decimalLatitude,DwcTerm.decimalLongitude));
}
Program: 39839
Project: 39839
Buggy source:
/** 
 * Matches a   {@link ExtendedRecord} to an existing specie using the species match 2 WS.
 * @param extendedRecord avro file with the taxonomic data
 * @return {@link NameUsageMatch2} with the match received from the WS.
 */
public HttpResponse<NameUsageMatch2> getMatch(ExtendedRecord extendedRecord){
  HttpResponse<NameUsageMatch2> response=tryNameMatch(extendedRecord.getCoreTerms());
  if (isSuccessfulMatch(response) || !hasIdentifications(extendedRecord)) {
    return response;
  }
  LOG.info("String_Node_Str");
  List<Map<String,String>> identifications=extendedRecord.getExtensions().get(DwcTerm.Identification.qualifiedName());
  identifications.sort(Comparator.comparing((  Map<String,String> map) -> {
    if (!map.containsKey(DwcTerm.dateIdentified.qualifiedName()) || Objects.isNull(map.get(DwcTerm.dateIdentified.qualifiedName()))) {
      return LocalDateTime.MIN;
    }
    return LocalDateTime.parse(map.get(DwcTerm.dateIdentified.qualifiedName()));
  }
).reversed());
  for (  Map<String,String> record : identifications) {
    response=tryNameMatch(record);
    if (isSuccessfulMatch(response)) {
      LOG.info("String_Node_Str",record.get(DwcTerm.identificationID.name()));
      return response;
    }
  }
  return response;
}

Fixed version (ground truth):
/** 
 * Matches a   {@link ExtendedRecord} to an existing specie using the species match 2 WS.
 * @param extendedRecord avro file with the taxonomic data
 * @return {@link NameUsageMatch2} with the match received from the WS.
 */
public HttpResponse<NameUsageMatch2> getMatch(ExtendedRecord extendedRecord){
  HttpResponse<NameUsageMatch2> response=tryNameMatch(extendedRecord.getCoreTerms());
  if (isSuccessfulMatch(response) || !hasIdentifications(extendedRecord)) {
    return response;
  }
  LOG.info("String_Node_Str");
  List<Map<String,String>> identifications=extendedRecord.getExtensions().get(DwcTerm.Identification.qualifiedName());
  identifications.sort(Comparator.comparing((  Map<String,String> map) -> {
    ParsedTemporalDates parsedDates=TemporalParser.parseRawDate(map.get(DwcTerm.dateIdentified.qualifiedName()));
    return parsedDates.getFrom().map((temporal) -> Instant.from(temporal).toEpochMilli()).orElse(0L);
  }
).reversed());
  for (  Map<String,String> record : identifications) {
    response=tryNameMatch(record);
    if (isSuccessfulMatch(response)) {
      LOG.info("String_Node_Str",record.get(DwcTerm.identificationID.name()));
      return response;
    }
  }
  return response;
}
Program: 39840
Project: 39840
Buggy source:
private static DataProcessingPipelineOptions createPipelineOptionsFromArgsWithoutValidation(Configuration config,String[] args){
  DataProcessingPipelineOptions options=PipelineOptionsFactory.fromArgs(args).as(DataProcessingPipelineOptions.class);
  options.setHdfsConfiguration(Collections.singletonList(config));
  return options;
}

Fixed version (ground truth):
private static DataProcessingPipelineOptions createPipelineOptionsFromArgsWithoutValidation(Configuration config,String[] args){
  PipelineOptionsFactory.register(DataProcessingPipelineOptions.class);
  DataProcessingPipelineOptions options=PipelineOptionsFactory.fromArgs(args).as(DataProcessingPipelineOptions.class);
  options.setHdfsConfiguration(Collections.singletonList(config));
  return options;
}
Program: 39841
Project: 39841
Buggy source:
private static Country getCountryMatched(Optional<Country> countryName,Optional<Country> countryCode){
  if (countryCode.isPresent()) {
    return countryCode.get();
  }
  if (countryName.isPresent()) {
    countryName.get();
  }
  return null;
}

Fixed version (ground truth):
private static Country getCountryMatched(Optional<Country> countryName,Optional<Country> countryCode){
  if (countryCode.isPresent()) {
    return countryCode.get();
  }
  if (countryName.isPresent()) {
    return countryName.get();
  }
  return null;
}
Program: 39842
Project: 39842
Buggy source:
SchemaData addFieldAsFirstElement(Schema.Field field){
  fields.add(0,field);
  return this;
}

Fixed version (ground truth):
private SchemaData addFieldAsFirstElement(Schema.Field field){
  fields.add(0,field);
  return this;
}
Program: 39843
Project: 39843
Buggy source:
private static void createFieldsRecursive(List<Schema.Field> avroFields,Field[] fields,Map<String,Schema> customSchemas,String namespace){
  for (  Field field : fields) {
    Schema schema=null;
    if (field.getType().isEnum()) {
      schema=Schema.createEnum(capitalize(field.getName()),null,namespace,Arrays.stream(field.getType().getEnumConstants()).map(value -> value.toString()).collect(Collectors.toList()));
    }
 else     if (isCollection(field)) {
      schema=Schema.createArray(createSchema(getCollectionType(field),customSchemas));
    }
 else     if (isJavaType(field)) {
      schema=createSchema(field.getType().getSimpleName(),customSchemas);
    }
 else {
      String recordName=capitalize(field.getType().getSimpleName());
      schema=Schema.createRecord(recordName,null,namespace,false);
      customSchemas.put(recordName,schema);
      List<Schema.Field> avroFieldsRecordSchema=new ArrayList<>();
      createFieldsRecursive(avroFieldsRecordSchema,field.getType().getDeclaredFields(),customSchemas,namespace);
      schema.setFields(avroFieldsRecordSchema);
    }
    schema=makeNullable(schema);
    avroFields.add(new Schema.Field(field.getName(),schema,null,defaultValueOf(schema)));
  }
}

Fixed version (ground truth):
private static void createFieldsRecursive(List<Schema.Field> avroFields,Field[] fields,Map<String,Schema> customSchemas,String namespace){
  for (  Field field : fields) {
    Schema schema;
    if (field.getType().isEnum()) {
      schema=Schema.createEnum(capitalize(field.getName()),null,namespace,Arrays.stream(field.getType().getEnumConstants()).map(Object::toString).collect(Collectors.toList()));
    }
 else     if (isCollection(field)) {
      schema=Schema.createArray(createSchema(getCollectionType(field),customSchemas));
    }
 else     if (isJavaType(field)) {
      schema=createSchema(field.getType().getSimpleName(),customSchemas);
    }
 else {
      String recordName=capitalize(field.getType().getSimpleName());
      schema=Schema.createRecord(recordName,null,namespace,false);
      customSchemas.put(recordName,schema);
      List<Schema.Field> avroFieldsRecordSchema=new ArrayList<>();
      createFieldsRecursive(avroFieldsRecordSchema,field.getType().getDeclaredFields(),customSchemas,namespace);
      schema.setFields(avroFieldsRecordSchema);
    }
    schema=makeNullable(schema);
    avroFields.add(new Schema.Field(field.getName(),schema,null,defaultValueOf(schema)));
  }
}
Program: 39844
Project: 39844
Buggy source:
private static SchemaData generateSchemaData(Class clazz,String schemaName,String schemaDoc,String namespace){
  Objects.requireNonNull(clazz,"String_Node_Str");
  Objects.requireNonNull(schemaName,"String_Node_Str");
  Objects.requireNonNull(namespace,"String_Node_Str");
  Schema schemaGenerated=Schema.createRecord(schemaName,schemaDoc,namespace,false);
  Map<String,Schema> customTypes=new HashMap<>();
  customTypes.put(clazz.getSimpleName(),schemaGenerated);
  List<Schema.Field> schemaFields=new ArrayList<>();
  createFieldsRecursive(schemaFields,clazz.getDeclaredFields(),customTypes,namespace);
  return new SchemaData(schemaGenerated,schemaFields);
}

Fixed version (ground truth):
private static SchemaData generateSchemaData(Class<?> clazz,String schemaName,String schemaDoc,String namespace){
  Objects.requireNonNull(clazz,"String_Node_Str");
  Objects.requireNonNull(schemaName,"String_Node_Str");
  Objects.requireNonNull(namespace,"String_Node_Str");
  Schema schemaGenerated=Schema.createRecord(schemaName,schemaDoc,namespace,false);
  Map<String,Schema> customTypes=new HashMap<>();
  customTypes.put(clazz.getSimpleName(),schemaGenerated);
  List<Schema.Field> schemaFields=createFields(clazz,customTypes,namespace);
  return new SchemaData(schemaGenerated,schemaFields);
}
Program: 39845
Project: 39845
Buggy source:
/** 
 * Currently we generate all the fields nullable so the default will be always null, but we leave this method for the future.
 */
private static JsonNode defaultValueOf(Schema schema){
  Schema.Type schemaType=Schema.Type.UNION.equals(schema.getType()) ? schema.getTypes().get(0).getType() : schema.getType();
  return commonSchemasDefaults.getOrDefault(schemaType,NullNode.getInstance());
}

Fixed version (ground truth):
/** 
 * Currently we generate all the fields nullable so the default will be always null, but we leave this method for the future.
 */
private static JsonNode defaultValueOf(Schema schema){
  Schema.Type schemaType=Schema.Type.UNION == schema.getType() ? schema.getTypes().get(0).getType() : schema.getType();
  return COMMON_SCHEMAS_DEFAULTS.getOrDefault(schemaType,NullNode.getInstance());
}
Program: 39846
Project: 39846
Buggy source:
SchemaData(Schema rawSchema,List<Schema.Field> fields){
  this.rawSchema=rawSchema;
  this.fields=fields;
}

Fixed version (ground truth):
private SchemaData(Schema rawSchema,List<Schema.Field> fields){
  this.rawSchema=rawSchema;
  this.fields=fields;
}
Program: 39847
Project: 39847
Buggy source:
private static Schema createSchema(String className,Map<String,Schema> customSchemas){
  if (customSchemas.containsKey(className)) {
    return customSchemas.get(className);
  }
  if (commonTypesSchemas.get(className.toLowerCase()) == null) {
    return Schema.create(Schema.Type.STRING);
  }
  return Optional.ofNullable(commonTypesSchemas.get(className.toLowerCase())).orElse(Schema.create(Schema.Type.STRING));
}

Fixed version (ground truth):
private static Schema createSchema(String className,Map<String,Schema> customSchemas){
  if (customSchemas.containsKey(className)) {
    return customSchemas.get(className);
  }
  if (COMMON_TYPES_SCHEMAS.get(className.toLowerCase()) == null) {
    return Schema.create(Schema.Type.STRING);
  }
  return Optional.ofNullable(COMMON_TYPES_SCHEMAS.get(className.toLowerCase())).orElse(Schema.create(Schema.Type.STRING));
}
Program: 39848
Project: 39848
Buggy source:
Schema buildSchema(){
  rawSchema.setFields(fields);
  return rawSchema;
}

Fixed version (ground truth):
private Schema buildSchema(){
  rawSchema.setFields(fields);
  return rawSchema;
}
Program: 39849
Project: 39849
Buggy source:
/** 
 * Generates an Avro schema from a Java class.
 * @param clazz      class to generate the schema from
 * @param schemaName name of the schema
 * @param schemaDoc  documentation of the schema
 * @param namespace  namespace of the schema
 * @return {@link Schema} generated
 */
public static Schema generateSchema(Class clazz,String schemaName,String schemaDoc,String namespace){
  return generateSchemaData(clazz,schemaName,schemaDoc,namespace).buildSchema();
}

Fixed version (ground truth):
/** 
 * Generates an Avro schema from a Java class.
 * @param clazz      class to generate the schema from
 * @param schemaName name of the schema
 * @param schemaDoc  documentation of the schema
 * @param namespace  namespace of the schema
 * @return {@link Schema} generated
 */
public static Schema generateSchema(Class<?> clazz,String schemaName,String schemaDoc,String namespace){
  return generateSchemaData(clazz,schemaName,schemaDoc,namespace).buildSchema();
}
Program: 39850
Project: 39850
Buggy source:
@Override public void onCreate(){
  viewerBinding=DataBindingUtil.inflate(LayoutInflater.from(getBaseContext()),R.layout.view_viewer,null,false);
  toggleBinding=DataBindingUtil.inflate(LayoutInflater.from(getBaseContext()),R.layout.view_toggle,null,false);
  mParams=new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT,WindowManager.LayoutParams.MATCH_PARENT,Build.VERSION.SDK_INT < Build.VERSION_CODES.O ? WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY : WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,PixelFormat.TRANSLUCENT);
  mWindowManager=(WindowManager)getSystemService(WINDOW_SERVICE);
  mWindowManager.addView(viewerBinding.getRoot(),mParams);
  mWindowManager.addView(toggleBinding.getRoot(),new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT,WindowManager.LayoutParams.WRAP_CONTENT,Build.VERSION.SDK_INT < Build.VERSION_CODES.O ? WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY : WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN,PixelFormat.TRANSLUCENT));
  super.onCreate();
}

Fixed version (ground truth):
@Override public void onCreate(){
  viewerBinding=DataBindingUtil.inflate(LayoutInflater.from(getBaseContext()),R.layout.view_viewer,null,false);
  toggleBinding=DataBindingUtil.inflate(LayoutInflater.from(getBaseContext()),R.layout.view_toggle,null,false);
  mParams=new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT,WindowManager.LayoutParams.MATCH_PARENT,Build.VERSION.SDK_INT < Build.VERSION_CODES.O ? WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY : WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,PixelFormat.TRANSLUCENT);
  mWindowManager=(WindowManager)getSystemService(WINDOW_SERVICE);
  mWindowManager.addView(viewerBinding.getRoot(),mParams);
  mWindowManager.addView(toggleBinding.getRoot(),new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT,WindowManager.LayoutParams.WRAP_CONTENT,Build.VERSION.SDK_INT < Build.VERSION_CODES.O ? WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY : WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN,PixelFormat.TRANSLUCENT));
  super.onCreate();
}
Program: 39851
Project: 39851
Buggy source:
@Override public void onCreate(){
  viewerBinding=DataBindingUtil.inflate(LayoutInflater.from(getBaseContext()),R.layout.view_viewer,null,false);
  toggleBinding=DataBindingUtil.inflate(LayoutInflater.from(getBaseContext()),R.layout.view_toggle,null,false);
  mParams=new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT,WindowManager.LayoutParams.MATCH_PARENT,Build.VERSION.SDK_INT < Build.VERSION_CODES.O ? WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY : WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN,PixelFormat.TRANSLUCENT);
  mWindowManager=(WindowManager)getSystemService(WINDOW_SERVICE);
  mWindowManager.addView(viewerBinding.getRoot(),mParams);
  mWindowManager.addView(toggleBinding.getRoot(),new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT,WindowManager.LayoutParams.WRAP_CONTENT,Build.VERSION.SDK_INT < Build.VERSION_CODES.O ? WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY : WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN,PixelFormat.TRANSLUCENT));
  super.onCreate();
}

Fixed version (ground truth):
@Override public void onCreate(){
  viewerBinding=DataBindingUtil.inflate(LayoutInflater.from(getBaseContext()),R.layout.view_viewer,null,false);
  toggleBinding=DataBindingUtil.inflate(LayoutInflater.from(getBaseContext()),R.layout.view_toggle,null,false);
  mParams=new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT,WindowManager.LayoutParams.MATCH_PARENT,Build.VERSION.SDK_INT < Build.VERSION_CODES.O ? WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY : WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,PixelFormat.TRANSLUCENT);
  mWindowManager=(WindowManager)getSystemService(WINDOW_SERVICE);
  mWindowManager.addView(viewerBinding.getRoot(),mParams);
  mWindowManager.addView(toggleBinding.getRoot(),new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT,WindowManager.LayoutParams.WRAP_CONTENT,Build.VERSION.SDK_INT < Build.VERSION_CODES.O ? WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY : WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN,PixelFormat.TRANSLUCENT));
  super.onCreate();
}
Program: 39852
Project: 39852
Buggy source:
private void processScript(Script script){
  String scriptType=script.getType();
  scriptEngine=Main.scriptEngineManager.getEngineByName(scriptType);
  scriptEngine.put("String_Node_Str",this);
  scriptEngine.put("String_Node_Str",preload);
  scriptEngine.put("String_Node_Str",context);
  for (  String id : preload.keySet()) {
    scriptEngine.put(id,preload.get(id));
  }
  for (  String id : context.keySet()) {
    scriptEngine.put(id,context.get(id));
  }
  handleCustomerCode(null,accessCode -> scriptEngine.eval(script.getScript()));
  vertx.eventBus().<JsonObject>send(WebClientVerticle.class.getName(),new JsonObject().put("String_Node_Str",script.getHref()),ar -> {
    if (ar.succeeded()) {
      JsonObject result=ar.result().body();
      String content=resultMap.remove(result.getString("String_Node_Str"));
      if ("String_Node_Str".equals(result.getString("String_Node_Str"))) {
        handleCustomerCode(null,accessCode -> scriptEngine.eval(content));
      }
 else {
        handleThrowableMessage(new Exception(content));
      }
    }
 else {
      handleThrowableMessage(ar.cause());
    }
  }
);
}

Fixed version (ground truth):
private void processScript(Script script){
  String scriptType=script.getType();
  scriptEngine=Main.scriptEngineManager.getEngineByName(scriptType);
  scriptEngine.put("String_Node_Str",this);
  scriptEngine.put("String_Node_Str",preload);
  scriptEngine.put("String_Node_Str",context);
  for (  String id : preload.keySet()) {
    scriptEngine.put(id,preload.get(id));
  }
  for (  String id : context.keySet()) {
    scriptEngine.put(id,context.get(id));
  }
  handleCustomerCode(null,accessCode -> scriptEngine.eval(script.getScript()));
  if (script.getHref() == null || script.getHref().equals("String_Node_Str"))   return;
  vertx.eventBus().<JsonObject>send(WebClientVerticle.class.getName(),new JsonObject().put("String_Node_Str",script.getHref()),ar -> {
    if (ar.succeeded()) {
      JsonObject result=ar.result().body();
      String content=resultMap.remove(result.getString("String_Node_Str"));
      if ("String_Node_Str".equals(result.getString("String_Node_Str"))) {
        handleCustomerCode(null,accessCode -> scriptEngine.eval(content));
      }
 else {
        handleThrowableMessage(new Exception(content));
      }
    }
 else {
      handleThrowableMessage(ar.cause());
    }
  }
);
}
Program: 39853
Project: 39853
Buggy source:
private void handleCustomerCode(String accessCode,Handler handler){
  vertx.executeBlocking(fut -> {
    Thread thread=new CustomerThread(() -> {
      try {
        fut.complete(handler.handle(accessCode));
      }
 catch (      Throwable throwable) {
        fut.fail(throwable);
      }
    }
);
    thread.setDaemon(true);
    thread.start();
    vertx.setTimer(Long.getLong(DEFAULT_TOLERATED_WORKER_EXECUTE_TIME),id -> {
      if (thread.isAlive()) {
        thread.interrupt();
      }
    }
);
    vertx.setTimer(Long.getLong(DEFAULT_MAX_WORKER_EXECUTE_TIME),id -> {
      if (thread.isAlive()) {
        thread.stop();
      }
    }
);
  }
,res -> {
    if (res.succeeded()) {
      handleMessage(res.result());
    }
 else {
      handleThrowableMessage(res.cause());
    }
  }
);
}

Fixed version (ground truth):
private void handleCustomerCode(String accessCode,Handler handler){
  vertx.executeBlocking(fut -> {
    Thread thread=new CustomerThread(() -> {
      try {
        fut.complete(handler.handle(accessCode));
      }
 catch (      Throwable throwable) {
        fut.fail(throwable);
      }
    }
);
    thread.setDaemon(true);
    thread.start();
    vertx.setTimer(Long.getLong(DEFAULT_TOLERATED_WORKER_EXECUTE_TIME),id -> {
      System.out.println(2);
      if (thread.isAlive()) {
        System.out.println(1);
        thread.interrupt();
      }
    }
);
    vertx.setTimer(Long.getLong(DEFAULT_MAX_WORKER_EXECUTE_TIME),id -> {
      System.out.println(2);
      if (thread.isAlive()) {
        System.out.println(3);
        thread.stop();
      }
    }
);
  }
,res -> {
    if (res.succeeded()) {
      handleMessage(res.result());
    }
 else {
      handleThrowableMessage(res.cause());
    }
  }
);
}
Program: 39854
Project: 39854
Buggy source:
public BooleanProperty getBooleanProperty(String name){
  if (properties.get(name) == null) {
    properties.put(name,new SimpleBooleanProperty());
  }
  return (BooleanProperty)properties.get(name);
}

Fixed version (ground truth):
public BooleanProperty getBooleanProperty(String name){
  if (properties.get(name) == null) {
    properties.put(name,new SimpleBooleanProperty());
  }
  if (!(properties.get(name) instanceof BooleanProperty)) {
    properties.put(name,new SimpleBooleanProperty());
  }
  return (BooleanProperty)properties.get(name);
}