nus-yam/ex-repair huggingface dataset:
Program: 24985
Project: 24985
Buggy source:
private void writeImprovements(final String modeName,final FMeasureCounts corpusFMeasure,final Map<String,SummaryConfusionMatrix> data,final ImprovementMode improvementMode,final File outputFile) throws IOException {
  final List<Scored<String>> improvements=Lists.newArrayList();
  for (  Map.Entry<String,SummaryConfusionMatrix> entry : data.entrySet()) {
    final FMeasureCounts improvedCounts=improvementMode.improve(corpusFMeasure,entry.getValue().FMeasureVsAllOthers(PRESENT));
    final double F1Improvement=improvedCounts.F1() - corpusFMeasure.F1();
    improvements.add(Scored.from(entry.getKey(),F1Improvement));
  }
  Collections.sort(improvements,Scoreds.<String>ByScoreThenByItem().reverse());
  final StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str" + modeName + "String_Node_Str"+ improvementMode.toString()+ "String_Node_Str");
  final int nameFieldSize=4 + MapUtils.longestKeyLength(data);
  final String headerFormat="String_Node_Str" + nameFieldSize + "String_Node_Str";
  final String entryFormat="String_Node_Str" + nameFieldSize + "String_Node_Str";
  sb.append(String.format(headerFormat,modeName));
  sb.append(Strings.repeat("String_Node_Str",nameFieldSize + 18)).append("String_Node_Str");
  for (  Scored<String> improvement : improvements) {
    sb.append(String.format(entryFormat,improvement.item(),improvement.score()));
  }
  Files.asCharSink(outputFile,Charsets.UTF_8).write(sb.toString());
}

Fixed version (ground truth):
private void writeImprovements(final String modeName,final FMeasureCounts corpusFMeasure,final Map<String,SummaryConfusionMatrix> data,final ImprovementMode improvementMode,final File outputFile) throws IOException {
  final List<Scored<String>> improvements=Lists.newArrayList();
  for (  Map.Entry<String,SummaryConfusionMatrix> entry : data.entrySet()) {
    final FMeasureCounts improvedCounts=improvementMode.improve(corpusFMeasure,entry.getValue().FMeasureVsAllOthers(PRESENT));
    final double F1Improvement=improvedCounts.F1() - corpusFMeasure.F1();
    improvements.add(Scored.from(entry.getKey(),F1Improvement));
  }
  Collections.sort(improvements,Scoreds.<String>ByScoreThenByItem().reverse());
  final StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str" + modeName + "String_Node_Str"+ improvementMode.toString()+ "String_Node_Str");
  final int nameFieldSize=4 + MapUtils.longestKeyLength(data);
  final String headerFormat="String_Node_Str" + nameFieldSize + "String_Node_Str";
  final String entryFormat="String_Node_Str" + nameFieldSize + "String_Node_Str";
  sb.append(String.format(headerFormat,modeName));
  sb.append(Strings.repeat("String_Node_Str",nameFieldSize + 18)).append("String_Node_Str");
  for (  Scored<String> improvement : improvements) {
    sb.append(String.format(entryFormat,improvement.item(),100.0 * improvement.score()));
  }
  Files.asCharSink(outputFile,Charsets.UTF_8).write(sb.toString());
}
Program: 24986
Project: 24986
Buggy source:
@Override public KBPAnswerSourceObserver answerSourceObserver(final SystemOutputAnswerSource<Answerable> systemOutputSource,final AnswerKeyAnswerSource<Answerable> answerKeyAnswerSource){
  ++docs;
  if (answerKeyAnswerSource.answerKey().completelyAnnotated()) {
    ++skipped;
    return innerObserver.answerSourceObserver(systemOutputSource,answerKeyAnswerSource);
  }
 else {
    return new KBPAnswerSourceObserver(systemOutputSource,answerKeyAnswerSource){
    }
;
  }
}

Fixed version (ground truth):
@Override public KBPAnswerSourceObserver answerSourceObserver(final SystemOutputAnswerSource<Answerable> systemOutputSource,final AnswerKeyAnswerSource<Answerable> answerKeyAnswerSource){
  ++docs;
  if (answerKeyAnswerSource.answerKey().completelyAnnotated()) {
    return innerObserver.answerSourceObserver(systemOutputSource,answerKeyAnswerSource);
  }
 else {
    ++skipped;
    return new KBPAnswerSourceObserver(systemOutputSource,answerKeyAnswerSource){
    }
;
  }
}
Program: 24987
Project: 24987
Buggy source:
private void assertValidTypes(Response response){
  if (typeAndRoleValidator.isValidEventType(response)) {
    if (!typeAndRoleValidator.isValidArgumentRole(response)) {
      log.error("String_Node_Str",response.role(),response.type(),response.docID(),StringUtils.CommaSpaceJoiner.join(typeAndRoleValidator.validRolesFor(response.type())));
      System.exit(1);
    }
  }
 else {
    log.error("String_Node_Str",response.type(),response.docID(),StringUtils.CommaSpaceJoiner.join(typeAndRoleValidator.validEventTypes()));
    System.exit(1);
  }
}

Fixed version (ground truth):
private void assertValidTypes(Response response){
  if (typeAndRoleValidator.isValidEventType(response)) {
    if (!typeAndRoleValidator.isValidArgumentRole(response)) {
      throw new RuntimeException(String.format("String_Node_Str",response.role(),response.type(),response.docID(),StringUtils.CommaSpaceJoiner.join(typeAndRoleValidator.validRolesFor(response.type()))));
    }
  }
 else {
    throw new RuntimeException(String.format("String_Node_Str",response.type(),response.docID(),StringUtils.CommaSpaceJoiner.join(typeAndRoleValidator.validEventTypes())));
  }
}
Program: 24988
Project: 24988
Buggy source:
private SkipIncompleteAnnotations(final KBPScoringObserver<Answerable> innerObserver){
  super(innerObserver.name());
  this.innerObserver=checkNotNull(innerObserver);
}

Fixed version (ground truth):
private SkipIncompleteAnnotations(final KBPScoringObserver<Answerable> innerObserver){
  super(innerObserver.name() + "String_Node_Str");
  this.innerObserver=checkNotNull(innerObserver);
}
Program: 24989
Project: 24989
Buggy source:
/** 
 * Given the string contents of a document, will return the offset ranges of those portions within <quote> tags. This does not pay attention to the attributes of the quote tags.
 * @param s
 * @return
 */
public static ImmutableRangeSet<Integer> computeQuotedRegions(String s){
  checkNotNull(s);
  final ImmutableRangeSet.Builder<Integer> ret=ImmutableRangeSet.builder();
  int curPos=0;
  int regionStart=s.indexOf(BANNED_REGION_START,curPos);
  while (regionStart != -1) {
    curPos=regionStart;
    int nestingCount=1;
    while (nestingCount > 0) {
      final int nextStart=s.indexOf(BANNED_REGION_START,curPos + 1);
      final int nextEnd=s.indexOf(BANNED_REGION_END,curPos + 1);
      if (nextEnd == -1) {
        throw new RuntimeException(String.format("String_Node_Str",regionStart));
      }
 else       if (nextStart == -1 || nextEnd < nextStart) {
        --nestingCount;
        curPos=nextEnd;
      }
 else       if (nextEnd > nextStart) {
        ++nestingCount;
        curPos=nextStart;
      }
 else {
        throw new RuntimeException("String_Node_Str");
      }
    }
    ret.add(Range.closed(regionStart,curPos + BANNED_REGION_END.length() - 1));
    regionStart=s.indexOf(BANNED_REGION_START,curPos + 1);
  }
  return ret.build();
}

Fixed version (ground truth):
/** 
 * Given the string contents of a document, will return the offset ranges of those portions within <quote> tags. This does not pay attention to the attributes of the quote tags.
 * @param s
 * @return
 */
public static ImmutableRangeSet<Integer> computeQuotedRegions(String s){
  checkNotNull(s);
  final ImmutableRangeSet.Builder<Integer> ret=ImmutableRangeSet.builder();
  int curPos=0;
  int regionStart=StringUtils.earliestIndexOfAny(s,BANNED_REGION_STARTS,curPos);
  while (regionStart != -1) {
    curPos=regionStart;
    int nestingCount=1;
    while (nestingCount > 0) {
      final int nextStart=StringUtils.earliestIndexOfAny(s,BANNED_REGION_STARTS,curPos + 1);
      final int nextEnd=s.indexOf(BANNED_REGION_END,curPos + 1);
      if (nextEnd == -1) {
        throw new RuntimeException(String.format("String_Node_Str",regionStart));
      }
 else       if (nextStart == -1 || nextEnd < nextStart) {
        --nestingCount;
        curPos=nextEnd;
      }
 else       if (nextEnd > nextStart) {
        ++nestingCount;
        curPos=nextStart;
      }
 else {
        throw new RuntimeException("String_Node_Str");
      }
    }
    ret.add(Range.closed(regionStart,curPos + BANNED_REGION_END.length() - 1));
    regionStart=StringUtils.earliestIndexOfAny(s,BANNED_REGION_STARTS,curPos + 1);
  }
  return ret.build();
}
Program: 24991
Project: 24991
Buggy source:
/** 
 * <p>Tell whether the specified schema exists in the database. To do so, it is using the given   {@link DatabaseMetaData} object to query the database and list all existing schemas.</p><p><i>Note: This function is completely useless if the connection is not supporting schemas. </i></p> <p><i>Note: Test on the schema name is done considering the case sensitivity indicated by the translator (see  {@link JDBCTranslator#isCaseSensitive(IdentifierField)}). </i></p> <p><i>Note: This functions is used by   {@link #addUploadedTable(TAPTable,TableIterator)} and {@link #resetTAPSchema(Statement,TAPTable[])}. </i></p>
 * @param schemaName	DB name of the schema whose the existence must be checked.
 * @param dbMeta		Metadata about the database, and mainly the list of all existing schemas.
 * @return	<i>true</i> if the specified schema exists, <i>false</i> otherwise.
 * @throws SQLException	If any error occurs while interrogating the database about existing schema.
 */
protected boolean isSchemaExisting(String schemaName,final DatabaseMetaData dbMeta) throws SQLException {
  if (DBMS_MYSQL.equals(dbms) || !supportsSchema || schemaName == null || schemaName.length() == 0)   return true;
  boolean caseSensitive=translator.isCaseSensitive(IdentifierField.SCHEMA);
  ResultSet rs=null;
  try {
    rs=dbMeta.getSchemas();
    boolean hasSchema=false;
    while (!hasSchema && rs.next()) {
      hasSchema=equals(rs.getString(1),schemaName,caseSensitive);
    }
    return hasSchema;
  }
  finally {
    close(rs);
  }
}

Fixed version (ground truth):
/** 
 * <p>Tell whether the specified schema exists in the database. To do so, it is using the given   {@link DatabaseMetaData} object to query the database and list all existing schemas.</p><p><i>Note: This function is completely useless if the connection is not supporting schemas. </i></p> <p><i>Note: Test on the schema name is done considering the case sensitivity indicated by the translator (see  {@link JDBCTranslator#isCaseSensitive(IdentifierField)}). </i></p> <p><i>Note: This functions is used by   {@link #addUploadedTable(TAPTable,TableIterator)} and {@link #resetTAPSchema(Statement,TAPTable[])}. </i></p>
 * @param schemaName	DB name of the schema whose the existence must be checked.
 * @param dbMeta		Metadata about the database, and mainly the list of all existing schemas.
 * @return	<i>true</i> if the specified schema exists, <i>false</i> otherwise.
 * @throws SQLException	If any error occurs while interrogating the database about existing schema.
 */
protected boolean isSchemaExisting(String schemaName,final DatabaseMetaData dbMeta) throws SQLException {
  if (!supportsSchema || schemaName == null || schemaName.length() == 0)   return true;
  boolean caseSensitive=translator.isCaseSensitive(IdentifierField.SCHEMA);
  ResultSet rs=null;
  try {
    rs=getDBMetaSchemas(dbMeta);
    boolean hasSchema=false;
    while (!hasSchema && rs.next()) {
      hasSchema=equals(rs.getString(1),schemaName,caseSensitive);
    }
    return hasSchema;
  }
  finally {
    close(rs);
  }
}
Program: 24998
Project: 24998
Buggy source:
private boolean jj_3R_128(){
  Token xsp;
  xsp=jj_scanpos;
  if (jj_scan_token(99)) {
    jj_scanpos=xsp;
    if (jj_scan_token(100)) {
      jj_scanpos=xsp;
      if (jj_scan_token(101))       return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean jj_3R_128(){
  Token xsp;
  xsp=jj_scanpos;
  if (jj_scan_token(97)) {
    jj_scanpos=xsp;
    if (jj_scan_token(98)) {
      jj_scanpos=xsp;
      if (jj_scan_token(99))       return true;
    }
  }
  return false;
}
Program: 24999
Project: 24999
Buggy source:
/** 
 * Generate ParseException. 
 */
public ParseException generateParseException(){
  jj_expentries.clear();
  boolean[] la1tokens=new boolean[103];
  if (jj_kind >= 0) {
    la1tokens[jj_kind]=true;
    jj_kind=-1;
  }
  for (int i=0; i < 98; i++) {
    if (jj_la1[i] == jj_gen) {
      for (int j=0; j < 32; j++) {
        if ((jj_la1_0[i] & (1 << j)) != 0) {
          la1tokens[j]=true;
        }
        if ((jj_la1_1[i] & (1 << j)) != 0) {
          la1tokens[32 + j]=true;
        }
        if ((jj_la1_2[i] & (1 << j)) != 0) {
          la1tokens[64 + j]=true;
        }
        if ((jj_la1_3[i] & (1 << j)) != 0) {
          la1tokens[96 + j]=true;
        }
      }
    }
  }
  for (int i=0; i < 103; i++) {
    if (la1tokens[i]) {
      jj_expentry=new int[1];
      jj_expentry[0]=i;
      jj_expentries.add(jj_expentry);
    }
  }
  jj_endpos=0;
  jj_rescan_token();
  jj_add_error_token(0,0);
  int[][] exptokseq=new int[jj_expentries.size()][];
  for (int i=0; i < jj_expentries.size(); i++) {
    exptokseq[i]=jj_expentries.get(i);
  }
  return new ParseException(token,exptokseq,tokenImage);
}

Fixed version (ground truth):
/** 
 * Generate ParseException. 
 */
public ParseException generateParseException(){
  jj_expentries.clear();
  boolean[] la1tokens=new boolean[101];
  if (jj_kind >= 0) {
    la1tokens[jj_kind]=true;
    jj_kind=-1;
  }
  for (int i=0; i < 98; i++) {
    if (jj_la1[i] == jj_gen) {
      for (int j=0; j < 32; j++) {
        if ((jj_la1_0[i] & (1 << j)) != 0) {
          la1tokens[j]=true;
        }
        if ((jj_la1_1[i] & (1 << j)) != 0) {
          la1tokens[32 + j]=true;
        }
        if ((jj_la1_2[i] & (1 << j)) != 0) {
          la1tokens[64 + j]=true;
        }
        if ((jj_la1_3[i] & (1 << j)) != 0) {
          la1tokens[96 + j]=true;
        }
      }
    }
  }
  for (int i=0; i < 101; i++) {
    if (la1tokens[i]) {
      jj_expentry=new int[1];
      jj_expentry[0]=i;
      jj_expentries.add(jj_expentry);
    }
  }
  jj_endpos=0;
  jj_rescan_token();
  jj_add_error_token(0,0);
  int[][] exptokseq=new int[jj_expentries.size()][];
  for (int i=0; i < jj_expentries.size(); i++) {
    exptokseq[i]=jj_expentries.get(i);
  }
  return new ParseException(token,exptokseq,tokenImage);
}
Program: 25000
Project: 25000
Buggy source:
private static void jj_la1_init_2(){
  jj_la1_2=new int[]{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20000000,0x0,0x0,0x0,0x0,0x0,0x20000000,0x0,0xffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x20ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xffffff,0xffffff,0x0,0x0,0xfffe,0xff0000,0x0,0x20ffffff};
}

Fixed version (ground truth):
private static void jj_la1_init_2(){
  jj_la1_2=new int[]{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0000000,0xc0000000,0x0,0xc0000000,0x0,0xc8ffffff,0x0,0x0,0x0,0xc0000000,0x0,0x0,0x0,0xc0000000,0x0,0x0,0x0,0xc0000000,0x0,0xc0000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8000000,0x0,0x0,0x0,0x0,0xc0000000,0xc8000000,0x0,0xc0ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0xc0000000,0x0,0x0,0xc8000000,0xc0000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc8ffffff,0x0,0x0,0x0,0x0,0x0,0x0,0xc8ffffff,0x0,0x0,0x0,0x0,0xc0000000,0xc0000000,0xc0000000,0xc0000000,0x1,0x0,0x0,0x80ffffff,0xc0ffffff,0x0,0x0,0xfffe,0xff0000,0x0,0xc8ffffff};
}
Program: 25001
Project: 25001
Buggy source:
private static void jj_la1_init_3(){
  jj_la1_3=new int[]{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x3,0x0,0x3,0x0,0x3b,0x0,0x0,0x0,0x3,0x0,0x0,0x0,0x23,0x0,0x0,0x0,0x3,0x0,0x3,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x38,0x30,0x0,0x0,0x3b,0x3,0x0,0x3b,0x0,0x0,0x0,0x0,0x0,0x0,0x3b,0x0,0x0,0x3,0x3,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3b,0x0,0x0,0x0,0x0,0x0,0x0,0x3b,0x0,0x0,0x0,0x0,0x3,0x3,0x3,0x3,0x0,0x0,0x0,0x2,0x3b,0x0,0x0,0x0,0x0,0x0,0x3b};
}

Fixed version (ground truth):
private static void jj_la1_init_3(){
  jj_la1_3=new int[]{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xe,0xc,0x0,0x0,0xe,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0xe};
}
Program: 25002
Project: 25002
Buggy source:
public ADQLObject next(){
  if (!subQueryGot) {
    subQueryGot=true;
    return subQuery;
  }
 else   throw new NoSuchElementException();
}

Fixed version (ground truth):
@Override public ADQLObject next(){
  if (!subQueryGot) {
    subQueryGot=true;
    return subQuery;
  }
 else   throw new NoSuchElementException();
}
Program: 25003
Project: 25003
Buggy source:
public String getName(){
  return hasAlias() ? alias : (isSubQuery() ? "String_Node_Str" : getTableName());
}

Fixed version (ground truth):
@Override public String getName(){
  return hasAlias() ? alias : (isSubQuery() ? "String_Node_Str" : getTableName());
}
Program: 25004
Project: 25004
Buggy source:
public ArrayList<ADQLTable> getTablesByAlias(final String alias,final boolean caseSensitive){
  ArrayList<ADQLTable> tables=new ArrayList<ADQLTable>();
  if (hasAlias()) {
    if (!caseSensitive) {
      if (getAlias().equalsIgnoreCase(alias))       tables.add(this);
    }
 else {
      if (IdentifierField.ALIAS.isCaseSensitive(caseSensitivity)) {
        if (getAlias().equals(alias))         tables.add(this);
      }
 else {
        if (getAlias().toLowerCase().equals(alias))         tables.add(this);
      }
    }
  }
  return tables;
}

Fixed version (ground truth):
@Override public ArrayList<ADQLTable> getTablesByAlias(final String alias,final boolean caseSensitive){
  ArrayList<ADQLTable> tables=new ArrayList<ADQLTable>();
  if (hasAlias()) {
    if (!caseSensitive) {
      if (getAlias().equalsIgnoreCase(alias))       tables.add(this);
    }
 else {
      if (IdentifierField.ALIAS.isCaseSensitive(caseSensitivity)) {
        if (getAlias().equals(alias))         tables.add(this);
      }
 else {
        if (getAlias().toLowerCase().equals(alias))         tables.add(this);
      }
    }
  }
  return tables;
}
Program: 25005
Project: 25005
Buggy source:
public void replace(ADQLObject replacer) throws UnsupportedOperationException, IllegalStateException {
  if (!subQueryGot)   throw new IllegalStateException("String_Node_Str");
  if (replacer == null)   remove();
  if (replacer instanceof ADQLQuery)   subQuery=(ADQLQuery)replacer;
 else   throw new UnsupportedOperationException("String_Node_Str" + subQuery.toADQL() + "String_Node_Str"+ replacer.getClass().getName()+ "String_Node_Str"+ replacer.toADQL()+ "String_Node_Str");
}

Fixed version (ground truth):
@Override public void replace(ADQLObject replacer) throws UnsupportedOperationException, IllegalStateException {
  if (!subQueryGot)   throw new IllegalStateException("String_Node_Str");
  if (replacer == null)   remove();
  if (replacer instanceof ADQLQuery)   subQuery=(ADQLQuery)replacer;
 else   throw new UnsupportedOperationException("String_Node_Str" + subQuery.toADQL() + "String_Node_Str"+ replacer.getClass().getName()+ "String_Node_Str"+ replacer.toADQL()+ "String_Node_Str");
}
Program: 25006
Project: 25006
Buggy source:
public ADQLIterator adqlIterator(){
  return new ADQLIterator(){
    private boolean subQueryGot=!isSubQuery();
    public ADQLObject next(){
      if (!subQueryGot) {
        subQueryGot=true;
        return subQuery;
      }
 else       throw new NoSuchElementException();
    }
    public boolean hasNext(){
      return !subQueryGot;
    }
    public void replace(    ADQLObject replacer) throws UnsupportedOperationException, IllegalStateException {
      if (!subQueryGot)       throw new IllegalStateException("String_Node_Str");
      if (replacer == null)       remove();
      if (replacer instanceof ADQLQuery)       subQuery=(ADQLQuery)replacer;
 else       throw new UnsupportedOperationException("String_Node_Str" + subQuery.toADQL() + "String_Node_Str"+ replacer.getClass().getName()+ "String_Node_Str"+ replacer.toADQL()+ "String_Node_Str");
    }
    public void remove(){
      if (!subQueryGot)       throw new IllegalStateException("String_Node_Str");
 else       throw new UnsupportedOperationException("String_Node_Str" + toADQL() + "String_Node_Str");
    }
  }
;
}

Fixed version (ground truth):
@Override public ADQLIterator adqlIterator(){
  return new ADQLIterator(){
    private boolean subQueryGot=!isSubQuery();
    @Override public ADQLObject next(){
      if (!subQueryGot) {
        subQueryGot=true;
        return subQuery;
      }
 else       throw new NoSuchElementException();
    }
    @Override public boolean hasNext(){
      return !subQueryGot;
    }
    @Override public void replace(    ADQLObject replacer) throws UnsupportedOperationException, IllegalStateException {
      if (!subQueryGot)       throw new IllegalStateException("String_Node_Str");
      if (replacer == null)       remove();
      if (replacer instanceof ADQLQuery)       subQuery=(ADQLQuery)replacer;
 else       throw new UnsupportedOperationException("String_Node_Str" + subQuery.toADQL() + "String_Node_Str"+ replacer.getClass().getName()+ "String_Node_Str"+ replacer.toADQL()+ "String_Node_Str");
    }
    @Override public void remove(){
      if (!subQueryGot)       throw new IllegalStateException("String_Node_Str");
 else       throw new UnsupportedOperationException("String_Node_Str" + toADQL() + "String_Node_Str");
    }
  }
;
}
Program: 25007
Project: 25007
Buggy source:
/** 
 * <p>Sets the   {@link DBTable} corresponding to this {@link ADQLTable}.</p> <p><i> <u>Note:</u> This function will do nothing if this   {@link ADQLTable} is a sub query.</i></p>
 * @param dbLink Its corresponding {@link DBTable}.
 */
public final void setDBLink(DBTable dbLink){
  if (!isSubQuery())   this.dbLink=dbLink;
}

Fixed version (ground truth):
/** 
 * Sets the   {@link DBTable} corresponding to this {@link ADQLTable}.
 * @param dbLink Its corresponding {@link DBTable}.
 */
public final void setDBLink(DBTable dbLink){
  this.dbLink=dbLink;
}
Program: 25008
Project: 25008
Buggy source:
/** 
 * Sets the position at which this   {@link ADQLTable} has been found in the original ADQL query string.
 * @param pos	Position of this {@link ADQLTable}.
 */
public final void setPosition(final TextPosition pos){
  position=pos;
}

Fixed version (ground truth):
/** 
 * Sets the position at which this   {@link ADQLTable} has been found in the original ADQL query string.
 * @param pos	Position of this {@link ADQLTable}.
 */
@Override public final void setPosition(final TextPosition pos){
  position=pos;
}
Program: 25009
Project: 25009
Buggy source:
public void remove(){
  if (!subQueryGot)   throw new IllegalStateException("String_Node_Str");
 else   throw new UnsupportedOperationException("String_Node_Str" + toADQL() + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void remove(){
  if (!subQueryGot)   throw new IllegalStateException("String_Node_Str");
 else   throw new UnsupportedOperationException("String_Node_Str" + toADQL() + "String_Node_Str");
}
Program: 25010
Project: 25010
Buggy source:
public ArrayList<ADQLTable> getTables(){
  ArrayList<ADQLTable> tables=new ArrayList<ADQLTable>();
  tables.add(this);
  return tables;
}

Fixed version (ground truth):
@Override public ArrayList<ADQLTable> getTables(){
  ArrayList<ADQLTable> tables=new ArrayList<ADQLTable>();
  tables.add(this);
  return tables;
}
Program: 25011
Project: 25011
Buggy source:
public ADQLObject getCopy() throws Exception {
  return new ADQLTable(this);
}

Fixed version (ground truth):
@Override public ADQLObject getCopy() throws Exception {
  return new ADQLTable(this);
}
Program: 25012
Project: 25012
Buggy source:
public String toADQL(){
  return (isSubQuery() ? ("String_Node_Str" + subQuery.toADQL() + "String_Node_Str") : getFullTableName()) + ((alias == null) ? "String_Node_Str" : ("String_Node_Str" + (isCaseSensitive(IdentifierField.ALIAS) ? ("String_Node_Str" + alias + "String_Node_Str") : alias)));
}

Fixed version (ground truth):
@Override public String toADQL(){
  return (isSubQuery() ? ("String_Node_Str" + subQuery.toADQL() + "String_Node_Str") : getFullTableName()) + ((alias == null) ? "String_Node_Str" : ("String_Node_Str" + (isCaseSensitive(IdentifierField.ALIAS) ? ("String_Node_Str" + alias + "String_Node_Str") : alias)));
}
Program: 25013
Project: 25013
Buggy source:
public SearchColumnList getDBColumns(){
  SearchColumnList list=new SearchColumnList();
  if (isSubQuery() && dbLink == null)   refreshDBLink();
  if (dbLink != null) {
    for (    DBColumn dbCol : dbLink)     list.add(dbCol);
  }
  return list;
}

Fixed version (ground truth):
@Override public SearchColumnList getDBColumns(){
  SearchColumnList list=new SearchColumnList();
  if (isSubQuery() && dbLink == null)   refreshDBLink();
  if (dbLink != null) {
    for (    DBColumn dbCol : dbLink)     list.add(dbCol);
  }
  return list;
}
Program: 25014
Project: 25014
Buggy source:
public boolean hasNext(){
  return !subQueryGot;
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  return !subQueryGot;
}
Program: 25015
Project: 25015
Buggy source:
/** 
 * Gets the position in the original ADQL query string.
 * @return	The position of this {@link ADQLTable}.
 */
public final TextPosition getPosition(){
  return position;
}

Fixed version (ground truth):
/** 
 * Gets the position in the original ADQL query string.
 * @return	The position of this {@link ADQLTable}.
 */
@Override public final TextPosition getPosition(){
  return position;
}
Program: 25016
Project: 25016
Buggy source:
@Override public String translate(final RegionFunction region) throws TranslationException {
  return getDefaultADQLFunction(region);
}

Fixed version (ground truth):
@Override public String translate(MathFunction fct) throws TranslationException {
switch (fct.getType()) {
case TRUNCATE:
    return "String_Node_Str" + ((fct.getNbParameters() >= 2) ? (translate(fct.getParameter(0)) + "String_Node_Str" + translate(fct.getParameter(1))) : "String_Node_Str") + "String_Node_Str";
case MOD:
  return ((fct.getNbParameters() >= 2) ? (translate(fct.getParameter(0)) + "String_Node_Str" + translate(fct.getParameter(1))) : "String_Node_Str");
default :
return getDefaultADQLFunction(fct);
}
}
Program: 25018
Project: 25018
Buggy source:
@Override public void logUWS(LogLevel level,Object obj,String event,String message,Throwable error){
  if (level == null)   level=(error != null) ? LogLevel.ERROR : LogLevel.INFO;
  if (!canLog(level))   return;
  String report=null;
  if (event != null && event.equalsIgnoreCase("String_Node_Str") && obj != null && obj.getClass().getName().equals("String_Node_Str")) {
    int[] backupReport=(int[])obj;
    report="String_Node_Str" + backupReport[0] + "String_Node_Str"+ backupReport[1]+ "String_Node_Str"+ backupReport[2]+ "String_Node_Str"+ backupReport[3]+ "String_Node_Str";
  }
 else   if (event != null && event.equalsIgnoreCase("String_Node_Str") && obj != null && obj.getClass().getName().equals("String_Node_Str")) {
    int[] restoreReport=(int[])obj;
    report="String_Node_Str" + restoreReport[0] + "String_Node_Str"+ restoreReport[1]+ "String_Node_Str"+ restoreReport[2]+ "String_Node_Str"+ restoreReport[3]+ "String_Node_Str";
  }
  log(level,"String_Node_Str",event,null,message,report,error);
}

Fixed version (ground truth):
@Override public void logUWS(LogLevel level,Object obj,String event,String message,Throwable error){
  if (level == null)   level=(error != null) ? LogLevel.ERROR : LogLevel.INFO;
  if (!canLog(level))   return;
  String report=null;
  if (event != null && event.equalsIgnoreCase("String_Node_Str") && obj != null && obj.getClass().getName().equals("String_Node_Str")) {
    int[] backupReport=(int[])obj;
    if (backupReport.length == 2)     report="String_Node_Str" + backupReport[0] + "String_Node_Str"+ backupReport[1]+ "String_Node_Str";
 else     report="String_Node_Str" + backupReport[0] + "String_Node_Str"+ backupReport[1]+ "String_Node_Str"+ backupReport[2]+ "String_Node_Str"+ backupReport[3]+ "String_Node_Str";
  }
 else   if (event != null && event.equalsIgnoreCase("String_Node_Str") && obj != null && obj.getClass().getName().equals("String_Node_Str")) {
    int[] restoreReport=(int[])obj;
    report="String_Node_Str" + restoreReport[0] + "String_Node_Str"+ restoreReport[1]+ "String_Node_Str"+ restoreReport[2]+ "String_Node_Str"+ restoreReport[3]+ "String_Node_Str";
  }
  log(level,"String_Node_Str",event,null,message,report,error);
}
Program: 25019
Project: 25019
Buggy source:
/** 
 * @deprecated since 1.4 ; Former version's mistake: an ORDER BY item is either a regular/delimited column name or an integer, not a qualified column name ; Replaced by {@link #createOrder(Identifier,boolean)} ; This function is no longer used by ADQLParser. 
 */
@Deprecated public ADQLOrder createOrder(final IdentifierItems idItems,final boolean desc) throws Exception {
  ADQLOrder order=new ADQLOrder(idItems.join("String_Node_Str"),desc);
  if (order != null)   order.setCaseSensitive(idItems.getColumnCaseSensitivity());
  return order;
}

Fixed version (ground truth):
/** 
 * @deprecated since 1.4 ; Former version's mistake: an ORDER BY item is either a regular/delimited column name or an integer, not a qualified column name ; Replaced by {@link #createOrder(IdentifierItem,boolean)} ; This function is no longer used by ADQLParser. 
 */
@Deprecated public ADQLOrder createOrder(final IdentifierItems idItems,final boolean desc) throws Exception {
  ADQLOrder order=new ADQLOrder(idItems.join("String_Node_Str"),desc);
  if (order != null)   order.setCaseSensitive(idItems.getColumnCaseSensitivity());
  return order;
}
Program: 25020
Project: 25020
Buggy source:
/** 
 * Sets the position at which this   {@link ADQLList} has been found in the original ADQL query string.
 * @param pos	Position of this {@link ADQLList}.
 * @since 1.4
 */
public final void setPosition(final TextPosition position){
  this.position=position;
}

Fixed version (ground truth):
/** 
 * Sets the position at which this   {@link ADQLList} has been found in the original ADQL query string.
 * @param position	Position of this {@link ADQLList}.
 * @since 1.4
 */
public final void setPosition(final TextPosition position){
  this.position=position;
}
Program: 25021
Project: 25021
Buggy source:
/** 
 * Sets the position at which this   {@link NegativeOperand} has been found in the original ADQL query string.
 * @param pos	Position of this {@link NegativeOperand}.
 * @since 1.4
 */
public final void setPosition(final TextPosition position){
  this.position=position;
}

Fixed version (ground truth):
/** 
 * Sets the position at which this   {@link NegativeOperand} has been found in the original ADQL query string.
 * @param position	Position of this {@link NegativeOperand}.
 * @since 1.4
 */
public final void setPosition(final TextPosition position){
  this.position=position;
}
Program: 25022
Project: 25022
Buggy source:
/** 
 * Sets the position at which this   {@link NumericConstant} has been found in the original ADQL query string.
 * @param pos	Position of this {@link NumericConstant}.
 * @since 1.4
 */
public final void setPosition(final TextPosition position){
  this.position=position;
}

Fixed version (ground truth):
/** 
 * Sets the position at which this   {@link NumericConstant} has been found in the original ADQL query string.
 * @param position	Position of this {@link NumericConstant}.
 * @since 1.4
 */
public final void setPosition(final TextPosition position){
  this.position=position;
}
Program: 25023
Project: 25023
Buggy source:
/** 
 * Sets the position at which this   {@link WrappedOperand} has been found in the original ADQL query string.
 * @param pos	Position of this {@link WrappedOperand}.
 * @since 1.4
 */
public final void setPosition(final TextPosition position){
  this.position=position;
}

Fixed version (ground truth):
/** 
 * Sets the position at which this   {@link WrappedOperand} has been found in the original ADQL query string.
 * @param position	Position of this {@link WrappedOperand}.
 * @since 1.4
 */
public final void setPosition(final TextPosition position){
  this.position=position;
}
Program: 25024
Project: 25024
Buggy source:
/** 
 * Sets the position at which this   {@link StringConstant} has been found in the original ADQL query string.
 * @param pos	Position of this {@link StringConstant}.
 * @since 1.4
 */
public final void setPosition(final TextPosition position){
  this.position=position;
}

Fixed version (ground truth):
/** 
 * Sets the position at which this   {@link StringConstant} has been found in the original ADQL query string.
 * @param position	Position of this {@link StringConstant}.
 * @since 1.4
 */
public final void setPosition(final TextPosition position){
  this.position=position;
}
Program: 25025
Project: 25025
Buggy source:
/** 
 * Sets the position at which this   {@link WrappedOperand} has been found in the original ADQL query string.
 * @param pos	Position of this {@link WrappedOperand}.
 * @since 1.4
 */
public final void setPosition(final TextPosition position){
  this.position=position;
}

Fixed version (ground truth):
/** 
 * Sets the position at which this   {@link WrappedOperand} has been found in the original ADQL query string.
 * @param position	Position of this {@link WrappedOperand}.
 * @since 1.4
 */
public final void setPosition(final TextPosition position){
  this.position=position;
}
Program: 25028
Project: 25028
Buggy source:
@Override public void freeConnection(DBConnection conn){
  try {
    conn.cancel(true);
    ((JDBCConnection)conn).getInnerConnection().close();
  }
 catch (  SQLException se) {
    service.getLogger().error("String_Node_Str" + conn.getID() + "String_Node_Str",se);
  }
}

Fixed version (ground truth):
@Override public void freeConnection(DBConnection conn){
  try {
    conn.endQuery();
    ((JDBCConnection)conn).getInnerConnection().close();
  }
 catch (  SQLException se) {
    service.getLogger().error("String_Node_Str" + conn.getID() + "String_Node_Str",se);
  }
}
Program: 25029
Project: 25029
Buggy source:
@Override public Object nextCol() throws NoSuchElementException, IllegalStateException, DataReadException {
  if (!hasNextCol())   throw new NoSuchElementException("String_Node_Str");
  try {
    Object o=data.getObject(++colIndex);
    if (o != null) {
      DBType colType=getColType();
      if (o instanceof Timestamp)       o=ISO8601Format.format(((Timestamp)o).getTime());
 else       if (translator != null && colType != null && colType.isGeometry()) {
        Region region=translator.translateGeometryFromDB(o);
        if (region != null)         o=region.toSTCS();
      }
    }
    return o;
  }
 catch (  SQLException se) {
    throw new DataReadException("String_Node_Str" + colIndex + "String_Node_Str",se);
  }
catch (  ParseException pe) {
    throw new DataReadException(pe.getMessage());
  }
}

Fixed version (ground truth):
@Override public Object nextCol() throws NoSuchElementException, IllegalStateException, DataReadException {
  if (!hasNextCol())   throw new NoSuchElementException("String_Node_Str");
  try {
    Object o=data.getObject(++colIndex);
    if (o != null) {
      DBType colType=getColType();
      if (o instanceof Timestamp)       o=ISO8601Format.format(((Timestamp)o).getTime());
 else       if (colType != null && o != null && colType.type == DBDatatype.CHAR && (colType.length == 1 || colType.length <= 0) && o instanceof String)       o=((String)o).charAt(0);
 else       if (translator != null && colType != null && colType.isGeometry()) {
        Region region=translator.translateGeometryFromDB(o);
        if (region != null)         o=region.toSTCS();
      }
    }
    return o;
  }
 catch (  SQLException se) {
    throw new DataReadException("String_Node_Str" + colIndex + "String_Node_Str",se);
  }
catch (  ParseException pe) {
    throw new DataReadException(pe.getMessage());
  }
}
Program: 25030
Project: 25030
Buggy source:
/** 
 * <p>Tells whether this type is a geometrical region.</p> <p><i>Concerned types:  {@link DBDatatype#POINT POINT} and {@link DBDatatype#REGION REGION}. </i></p> <p><i><b>Important note</b>: Since   {@link DBDatatype#UNKNOWN UNKNOWN} is an unresolved type, it can potentially be anything.That's why, this function will also returned <code>true</code> if the type is {@link DBDatatype#UNKNOWN UNKNOWN}. </i></p>
 * @return	<code>true</code> if this type is a geometry, <code>false</code> otherwise.
 */
public boolean isGeometry(){
  return (type == DBDatatype.POINT || type == DBDatatype.REGION || type == DBDatatype.UNKNOWN);
}

Fixed version (ground truth):
/** 
 * <p>Tells whether this type is a geometrical region.</p> <p><i>Concerned types:  {@link DBDatatype#POINT POINT} and {@link DBDatatype#REGION REGION}. </i></p> <p><i><b>Important note</b>: Since   {@link DBDatatype#UNKNOWN UNKNOWN} is an unresolved type, it can potentially be anything.But, in order to avoid incorrect operation while expecting a geometry although the type is unknown and is in fact not really a geometry, this function will return <code>false</code> if the type is {@link DBDatatype#UNKNOWN UNKNOWN}. </i></p>
 * @return	<code>true</code> if this type is a geometry, <code>false</code> otherwise.
 */
public boolean isGeometry(){
  return (type == DBDatatype.POINT || type == DBDatatype.REGION);
}
Program: 25031
Project: 25031
Buggy source:
/** 
 * <p>Tells whether this type is a numeric.</p> <p><i>Concerned types:  {@link DBDatatype#SMALLINT SMALLINT},   {@link DBDatatype#INTEGER INTEGER},   {@link DBDatatype#BIGINT BIGINT},  {@link DBDatatype#REAL REAL},   {@link DBDatatype#DOUBLE DOUBLE},   {@link DBDatatype#BINARY BINARY},  {@link DBDatatype#VARBINARY VARBINARY} and {@link DBDatatype#BLOB BLOB}. </i></p> <p><i><b>Important note</b>: Since   {@link DBDatatype#UNKNOWN UNKNOWN} is an unresolved type, it can potentially be anything.That's why, this function will also returned <code>true</code> if the type is {@link DBDatatype#UNKNOWN UNKNOWN}. </i></p>
 * @return	<code>true</code> if this type is a numeric, <code>false</code> otherwise.
 */
public boolean isNumeric(){
switch (type) {
case SMALLINT:
case INTEGER:
case BIGINT:
case REAL:
case DOUBLE:
case BINARY:
case VARBINARY:
case BLOB:
case UNKNOWN:
    return true;
default :
  return false;
}
}

Fixed version (ground truth):
/** 
 * <p>Tells whether this type is a numeric.</p> <p><i>Concerned types:  {@link DBDatatype#SMALLINT SMALLINT},   {@link DBDatatype#INTEGER INTEGER},   {@link DBDatatype#BIGINT BIGINT},  {@link DBDatatype#REAL REAL},   {@link DBDatatype#DOUBLE DOUBLE},   {@link DBDatatype#BINARY BINARY},  {@link DBDatatype#VARBINARY VARBINARY} and {@link DBDatatype#BLOB BLOB}. </i></p> <p><i><b>Important note</b>: Since   {@link DBDatatype#UNKNOWN UNKNOWN} is an unresolved type, it can potentially be anything.But, in order to avoid incorrect operation while expecting a numeric although the type is unknown and is in fact not really a numeric, this function will return <code>false</code> if the type is {@link DBDatatype#UNKNOWN UNKNOWN}. </i></p>
 * @return	<code>true</code> if this type is a numeric, <code>false</code> otherwise.
 */
public boolean isNumeric(){
switch (type) {
case SMALLINT:
case INTEGER:
case BIGINT:
case REAL:
case DOUBLE:
case BINARY:
case VARBINARY:
case BLOB:
    return true;
default :
  return false;
}
}
Program: 25032
Project: 25032
Buggy source:
/** 
 * <p>Tells whether this type is a list of bytes.</p> <p><i>Concerned types:  {@link DBDatatype#BINARY BINARY},   {@link DBDatatype#VARBINARY VARBINARY} and {@link DBDatatype#BLOB BLOB}. </i></p> <p><i><b>Important note</b>: Since   {@link DBDatatype#UNKNOWN UNKNOWN} is an unresolved type, it can potentially be anything.That's why, this function will also returned <code>true</code> if the type is {@link DBDatatype#UNKNOWN UNKNOWN}. </i></p>
 * @return	<code>true</code> if this type is a binary, <code>false</code> otherwise.
 */
public boolean isBinary(){
switch (type) {
case BINARY:
case VARBINARY:
case BLOB:
case UNKNOWN:
    return true;
default :
  return false;
}
}

Fixed version (ground truth):
/** 
 * <p>Tells whether this type is a list of bytes.</p> <p><i>Concerned types:  {@link DBDatatype#BINARY BINARY},   {@link DBDatatype#VARBINARY VARBINARY} and {@link DBDatatype#BLOB BLOB}. </i></p> <p><i><b>Important note</b>: Since   {@link DBDatatype#UNKNOWN UNKNOWN} is an unresolved type, it can potentially be anything.But, in order to avoid incorrect operation while expecting a binary although the type is unknown and is in fact not really a binary, this function will return <code>false</code> if the type is {@link DBDatatype#UNKNOWN UNKNOWN}. </i></p>
 * @return	<code>true</code> if this type is a binary, <code>false</code> otherwise.
 */
public boolean isBinary(){
switch (type) {
case BINARY:
case VARBINARY:
case BLOB:
    return true;
default :
  return false;
}
}
Program: 25033
Project: 25033
Buggy source:
/** 
 * <p>Tells whether this type is about characters.</p> <p><i>Concerned types:  {@link DBDatatype#CHAR CHAR},   {@link DBDatatype#VARCHAR VARCHAR},   {@link DBDatatype#CLOB CLOB}and   {@link DBDatatype#TIMESTAMP TIMESTAMP}. </i></p> <p><i><b>Important note</b>: Since   {@link DBDatatype#UNKNOWN UNKNOWN} is an unresolved type, it can potentially be anything.That's why, this function will also returned <code>true</code> if the type is {@link DBDatatype#UNKNOWN UNKNOWN}. </i></p>
 * @return	<code>true</code> if this type is a string, <code>false</code> otherwise.
 */
public boolean isString(){
switch (type) {
case CHAR:
case VARCHAR:
case CLOB:
case TIMESTAMP:
case UNKNOWN:
    return true;
default :
  return false;
}
}

Fixed version (ground truth):
/** 
 * <p>Tells whether this type is about characters.</p> <p><i>Concerned types:  {@link DBDatatype#CHAR CHAR},   {@link DBDatatype#VARCHAR VARCHAR},   {@link DBDatatype#CLOB CLOB}and   {@link DBDatatype#TIMESTAMP TIMESTAMP}. </i></p> <p><i><b>Important note</b>: Since   {@link DBDatatype#UNKNOWN UNKNOWN} is an unresolved type, it can potentially be anything.But, in order to avoid incorrect operation while expecting a string although the type is unknown and is in fact not really a string, this function will return <code>false</code> if the type is {@link DBDatatype#UNKNOWN UNKNOWN}. </i></p>
 * @return	<code>true</code> if this type is a string, <code>false</code> otherwise.
 */
public boolean isString(){
switch (type) {
case CHAR:
case VARCHAR:
case CLOB:
case TIMESTAMP:
    return true;
default :
  return false;
}
}
Program: 25034
Project: 25034
Buggy source:
public FunctionDef(final String fctName,final DBType returnType,final FunctionParam[] params){
  if (fctName == null)   throw new NullPointerException("String_Node_Str");
  this.name=fctName;
  this.params=(params == null || params.length == 0) ? null : params;
  this.nbParams=(params == null) ? 0 : params.length;
  this.returnType=(returnType != null) ? returnType : new DBType(DBDatatype.UNKNOWN);
  isUnknown=this.returnType.isUnknown();
  isNumeric=isUnknown || this.returnType.isNumeric();
  isString=isUnknown || this.returnType.isString();
  isGeometry=isUnknown || this.returnType.isGeometry();
  StringBuffer bufSer=new StringBuffer(name), bufCmp=new StringBuffer(name.toLowerCase());
  bufSer.append('(');
  for (int i=0; i < nbParams; i++) {
    bufSer.append(params[i].name).append(' ').append(params[i].type);
    bufCmp.append(params[i].type.isNumeric() ? '1' : '0').append(params[i].type.isString() ? '1' : '0').append(params[i].type.isGeometry() ? '1' : '0');
    if (i + 1 < nbParams)     bufSer.append("String_Node_Str");
  }
  bufSer.append(')');
  if (returnType != null)   bufSer.append("String_Node_Str").append(returnType);
  serializedForm=bufSer.toString();
  compareForm=bufCmp.toString();
}

Fixed version (ground truth):
public FunctionDef(final String fctName,final DBType returnType,final FunctionParam[] params){
  if (fctName == null)   throw new NullPointerException("String_Node_Str");
  this.name=fctName;
  this.params=(params == null || params.length == 0) ? null : params;
  this.nbParams=(params == null) ? 0 : params.length;
  this.returnType=(returnType != null) ? returnType : new DBType(DBDatatype.UNKNOWN);
  isUnknown=this.returnType.isUnknown();
  isNumeric=this.returnType.isNumeric();
  isString=this.returnType.isString();
  isGeometry=this.returnType.isGeometry();
  StringBuffer bufSer=new StringBuffer(name), bufCmp=new StringBuffer(name.toLowerCase());
  bufSer.append('(');
  for (int i=0; i < nbParams; i++) {
    bufSer.append(params[i].name).append(' ').append(params[i].type);
    bufCmp.append(params[i].type.isNumeric() ? '1' : '0').append(params[i].type.isString() ? '1' : '0').append(params[i].type.isGeometry() ? '1' : '0');
    if (i + 1 < nbParams)     bufSer.append("String_Node_Str");
  }
  bufSer.append(')');
  if (returnType != null)   bufSer.append("String_Node_Str").append(returnType);
  serializedForm=bufSer.toString();
  compareForm=bufCmp.toString();
}
Program: 25036
Project: 25036
Buggy source:
@Override public boolean isGeometry(){
  return (dbLink == null || dbLink.getDatatype() == null || dbLink.getDatatype().isGeometry());
}

Fixed version (ground truth):
@Override public boolean isGeometry(){
  return (dbLink == null || dbLink.getDatatype() == null || dbLink.getDatatype().isUnknown() || dbLink.getDatatype().isGeometry());
}
Program: 25037
Project: 25037
Buggy source:
@Override public boolean isString(){
  return (dbLink == null || dbLink.getDatatype() == null || dbLink.getDatatype().isString());
}

Fixed version (ground truth):
@Override public boolean isString(){
  return (dbLink == null || dbLink.getDatatype() == null || dbLink.getDatatype().isUnknown() || dbLink.getDatatype().isString());
}
Program: 25038
Project: 25038
Buggy source:
@Override public boolean isNumeric(){
  return (dbLink == null || dbLink.getDatatype() == null || dbLink.getDatatype().isNumeric());
}

Fixed version (ground truth):
@Override public boolean isNumeric(){
  return (dbLink == null || dbLink.getDatatype() == null || dbLink.getDatatype().isUnknown() || dbLink.getDatatype().isNumeric());
}
Program: 25039
Project: 25039
Buggy source:
/** 
 * Try to get or otherwise to build appropriate metadata using those extracted from the ADQL query and those extracted from the result.
 * @param typeFromQuery		Metadata extracted/guessed from the ADQL query.
 * @param typeFromResult	Metadata extracted/guessed from the result.
 * @return	The most appropriate metadata.
 */
protected TAPColumn getValidColMeta(final DBColumn typeFromQuery,final TAPColumn typeFromResult){
  if (typeFromQuery != null && typeFromQuery instanceof TAPColumn) {
    TAPColumn colMeta=(TAPColumn)typeFromQuery;
    if (colMeta.getDatatype().type == DBDatatype.UNKNOWN && typeFromResult != null && typeFromResult.getDatatype().type != DBDatatype.UNKNOWN)     colMeta.setDatatype(typeFromResult.getDatatype());
    return colMeta;
  }
 else   if (typeFromResult != null) {
    if (typeFromQuery != null)     return (TAPColumn)typeFromResult.copy(typeFromQuery.getDBName(),typeFromQuery.getADQLName(),null);
 else     return (TAPColumn)typeFromResult.copy();
  }
 else   return new TAPColumn((typeFromQuery != null) ? typeFromQuery.getADQLName() : "String_Node_Str",new DBType(DBDatatype.VARCHAR),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Try to get or otherwise to build appropriate metadata using those extracted from the ADQL query and those extracted from the result.
 * @param typeFromQuery		Metadata extracted/guessed from the ADQL query.
 * @param typeFromResult	Metadata extracted/guessed from the result.
 * @return	The most appropriate metadata.
 */
protected TAPColumn getValidColMeta(final DBColumn typeFromQuery,final TAPColumn typeFromResult){
  if (typeFromQuery != null && typeFromQuery instanceof TAPColumn) {
    TAPColumn colMeta=(TAPColumn)typeFromQuery;
    if (colMeta.getDatatype().isUnknown() && typeFromResult != null && !typeFromResult.getDatatype().isUnknown())     colMeta.setDatatype(typeFromResult.getDatatype());
    return colMeta;
  }
 else   if (typeFromResult != null) {
    if (typeFromQuery != null)     return (TAPColumn)typeFromResult.copy(typeFromQuery.getDBName(),typeFromQuery.getADQLName(),null);
 else     return (TAPColumn)typeFromResult.copy();
  }
 else   return new TAPColumn((typeFromQuery != null) ? typeFromQuery.getADQLName() : "String_Node_Str",new DBType(DBDatatype.VARCHAR),"String_Node_Str");
}