nus-yam/ex-repair huggingface dataset:
Program: 31466
Project: 31466
Buggy source:
@Override public void onMetadata(ObjList<ImportedColumnMetadata> metadata){
  if (writer == null) {
    try {
      writer=factory.bulkWriter(new JournalStructure(location,this.metadata=metadata));
    }
 catch (    JournalException e) {
      throw new JournalRuntimeException(e);
    }
  }
}

Fixed version (ground truth):
@Override public void onMetadata(ObjList<ImportedColumnMetadata> metadata){
  if (writer == null) {
    try {
      writer=factory.bulkWriter(new JournalStructure(location,this.metadata=metadata));
      errors.seed(metadata.size(),0);
    }
 catch (    JournalException e) {
      throw new JournalRuntimeException(e);
    }
  }
}
Program: 31467
Project: 31467
Buggy source:
public Response(int headerBufferSize,int contentBufferSize){
  if (headerBufferSize <= 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (contentBufferSize <= 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int sz=Numbers.ceilPow2(contentBufferSize);
  this.out=ByteBuffer.allocateDirect(sz);
  this.hb=new ResponseHeaderBuffer(headerBufferSize);
  this.chunkHeader=ByteBuffer.allocateDirect(8 + 2 * EOL.length());
  this.chunkSink=new DirectUnboundedAnsiSink(((DirectBuffer)chunkHeader).address());
  this.chunkSink.put(EOL);
  this.outPtr=this._wptr=((DirectBuffer)out).address();
  this.limit=outPtr + sz;
}

Fixed version (ground truth):
public Response(int headerBufferSize,int contentBufferSize){
  if (headerBufferSize <= 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (contentBufferSize <= 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int sz=Numbers.ceilPow2(contentBufferSize);
  this.out=ByteBuffer.allocateDirect(sz);
  this.hb=new ResponseHeaderBuffer(headerBufferSize);
  this.chunkHeader=ByteBuffer.allocateDirect(8 + 2 * EOL.length());
  this.chunkSink=new DirectUnboundedAnsiSink(((DirectBuffer)chunkHeader).address());
  this.chunkSink.put(EOL);
  this.outPtr=this._wPtr=((DirectBuffer)out).address();
  this.limit=outPtr + sz;
}
Program: 31468
Project: 31468
Buggy source:
public void flush() throws IOException {
  int lim=(int)(_wptr - outPtr);
  if (lim > 0) {
    chunk(lim);
    out.limit(lim);
    channel.write(out);
    out.clear();
    _wptr=outPtr;
  }
}

Fixed version (ground truth):
public void flush() throws IOException {
  int lim=(int)(_wPtr - outPtr);
  if (lim > 0) {
    chunk(lim);
    out.limit(lim);
    channel.write(out);
    out.clear();
    _wPtr=outPtr;
  }
}
Program: 31469
Project: 31469
Buggy source:
@Override public void clear(){
  out.clear();
  hb.clear();
  this._wptr=outPtr;
}

Fixed version (ground truth):
@Override public void clear(){
  out.clear();
  hb.clear();
  this._wPtr=outPtr;
}
Program: 31470
Project: 31470
Buggy source:
public void end() throws IOException {
  flush();
  chunk(0);
  put(EOL);
  int lim=(int)(_wptr - outPtr);
  out.limit(lim);
  channel.write(out);
  out.clear();
  _wptr=outPtr;
}

Fixed version (ground truth):
public void end() throws IOException {
  flush();
  chunk(0);
  put(EOL);
  int lim=(int)(_wPtr - outPtr);
  out.limit(lim);
  channel.write(out);
  out.clear();
  _wPtr=outPtr;
}
Program: 31471
Project: 31471
Buggy source:
@Override public CharSink put(char c){
  if (_wptr < limit) {
    Unsafe.getUnsafe().putByte(_wptr++,(byte)c);
    return this;
  }
  throw ResponseHeaderBufferTooSmallException.INSTANCE;
}

Fixed version (ground truth):
@Override public CharSink put(char c){
  if (_wPtr < limit) {
    Unsafe.getUnsafe().putByte(_wPtr++,(byte)c);
    return this;
  }
  throw ResponseHeaderBufferTooSmallException.INSTANCE;
}
Program: 31472
Project: 31472
Buggy source:
private void analyseColumns(IOContext context,long address,int len){
  int sampleSize=1000;
  MetadataExtractorListener lsnr=(MetadataExtractorListener)context.threadContext.getCache().get(IOWorkerContextKey.ME.name());
  if (lsnr == null) {
    lsnr=new MetadataExtractorListener();
    context.threadContext.getCache().put(IOWorkerContextKey.ME.name(),lsnr);
  }
  context.textParser.parse(address,len,sampleSize,lsnr);
  lsnr.onLineCount(context.textParser.getLineCount());
  context.importer.onMetadata(lsnr.getMetadata());
  context.textParser.setHeader(lsnr.isHeader());
  context.textParser.restart();
  context.analysed=true;
}

Fixed version (ground truth):
private void analyseColumns(IOContext context,long address,int len){
  int sampleSize=100;
  MetadataExtractorListener lsnr=(MetadataExtractorListener)context.threadContext.getCache().get(IOWorkerContextKey.ME.name());
  if (lsnr == null) {
    lsnr=new MetadataExtractorListener();
    context.threadContext.getCache().put(IOWorkerContextKey.ME.name(),lsnr);
  }
  context.textParser.parse(address,len,sampleSize,lsnr);
  lsnr.onLineCount(context.textParser.getLineCount());
  context.importer.onMetadata(lsnr.getMetadata());
  context.textParser.setHeader(lsnr.isHeader());
  context.textParser.restart();
  context.analysed=true;
}
Program: 31473
Project: 31473
Buggy source:
@Override protected void onPartEnd(IOContext context) throws IOException {
  if (context.textParser != null) {
    context.textParser.close();
    context.textParser=null;
    context.importer.close();
  }
}

Fixed version (ground truth):
@Override protected void onPartEnd(IOContext context) throws IOException {
  if (context.textParser != null) {
    context.textParser.parseLast();
    context.textParser.close();
    context.textParser=null;
    context.importer.close();
  }
}
Program: 31474
Project: 31474
Buggy source:
@Test public void testCsv() throws Exception {
  open("String_Node_Str");
  p.of(this.address,this.len);
  Assert.assertEquals(TextFileFormat.CSV,p.getFormat());
  Assert.assertEquals(0d,p.getStdDev(),0.0000001d);
  Assert.assertEquals(105,p.getAvgRecLen());
}

Fixed version (ground truth):
@Test public void testCsv() throws Exception {
  open("String_Node_Str");
  p.of(this.address,this.len);
  Assert.assertEquals(TextFileFormat.CSV,p.getFormat());
  Assert.assertEquals(0d,p.getStdDev(),0.0000001d);
  Assert.assertEquals(104,p.getAvgRecLen());
}
Program: 31475
Project: 31475
Buggy source:
private static void upload(File file,String url) throws IOException {
  String charset="String_Node_Str";
  String param="String_Node_Str";
  String boundary=Long.toHexString(System.currentTimeMillis());
  String CRLF="String_Node_Str";
  URLConnection connection=new URL(url).openConnection();
  connection.setDoOutput(true);
  connection.setRequestProperty("String_Node_Str","String_Node_Str" + boundary);
  try (OutputStream output=connection.getOutputStream();PrintWriter writer=new PrintWriter(new OutputStreamWriter(output,charset),true)){
    writer.append("String_Node_Str").append(boundary).append(CRLF);
    writer.append("String_Node_Str").append(CRLF);
    writer.append("String_Node_Str").append(charset).append(CRLF);
    writer.append(CRLF).append(param).append(CRLF).flush();
    writer.append("String_Node_Str").append(boundary).append(CRLF);
    writer.append("String_Node_Str").append(file.getName()).append("String_Node_Str").append(CRLF);
    writer.append("String_Node_Str").append(charset).append(CRLF);
    writer.append(CRLF).flush();
    Files.copy(file.toPath(),output);
    output.flush();
    writer.append(CRLF).flush();
    writer.append("String_Node_Str").append(boundary).append("String_Node_Str").append(CRLF).flush();
  }
   System.out.println(((HttpURLConnection)connection).getResponseCode());
}

Fixed version (ground truth):
private static void upload(File file,String url) throws IOException {
  String charset="String_Node_Str";
  String param="String_Node_Str";
  String boundary=Long.toHexString(System.currentTimeMillis());
  String CRLF="String_Node_Str";
  URLConnection connection=new URL(url).openConnection();
  connection.setDoOutput(true);
  connection.setRequestProperty("String_Node_Str","String_Node_Str" + boundary);
  try (OutputStream output=connection.getOutputStream();PrintWriter writer=new PrintWriter(new OutputStreamWriter(output,charset),true)){
    writer.append("String_Node_Str").append(boundary).append(CRLF);
    writer.append("String_Node_Str").append(CRLF);
    writer.append("String_Node_Str").append(charset).append(CRLF);
    writer.append(CRLF).append(param).append(CRLF).flush();
    writer.append("String_Node_Str").append(boundary).append(CRLF);
    writer.append("String_Node_Str").append(file.getName()).append("String_Node_Str").append(CRLF);
    writer.append("String_Node_Str").append(charset).append(CRLF);
    writer.append(CRLF).flush();
    Files.copy(file.toPath(),output);
    output.flush();
    writer.append(CRLF).flush();
    writer.append("String_Node_Str").append(boundary).append("String_Node_Str").append(CRLF).flush();
  }
   Assert.assertEquals(200,((HttpURLConnection)connection).getResponseCode());
}
Program: 31476
Project: 31476
Buggy source:
@Override protected void _run(){
  try {
    processRegistrations();
    selector.select(1L);
    Set<SelectionKey> keys=selector.selectedKeys();
    for (    SelectionKey key : keys) {
      try {
        if (serverKey.equals(key)) {
          configure(((ServerSocketChannel)key.channel()).accept());
          continue;
        }
        if (key.isReadable()) {
          long cursor=ioSequence.nextBully();
          IOEvent evt=ioQueue.get(cursor);
          evt.channel=(SocketChannel)key.channel();
          evt.op=SelectionKey.OP_READ;
          evt.context=(IOContext)key.attachment();
          ioSequence.done(cursor);
          key.cancel();
        }
      }
 catch (      CancelledKeyException e) {
        key.channel().close();
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override protected void _run(){
  try {
    processRegistrations();
    selector.select(1L);
    Set<SelectionKey> keys=selector.selectedKeys();
    for (    SelectionKey key : keys) {
      try {
        if (serverKey.equals(key)) {
          configure(((ServerSocketChannel)key.channel()).accept());
          continue;
        }
        if (key.isReadable()) {
          long cursor=ioSequence.nextBully();
          IOEvent evt=ioQueue.get(cursor);
          evt.channel=(SocketChannel)key.channel();
          evt.op=SelectionKey.OP_READ;
          evt.context=(IOContext)key.attachment();
          ioSequence.done(cursor);
          key.cancel();
        }
      }
 catch (      CancelledKeyException e) {
        key.channel().close();
      }
    }
    keys.clear();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 31478
Project: 31478
Buggy source:
private void parseContentType() throws UnsupportedContentTypeException {
  CharSequence seq=hb.get("String_Node_Str");
  if (seq == null) {
    return;
  }
  long p=((DirectByteCharSequence)seq).getLo();
  long _lo=p;
  long hi=((DirectByteCharSequence)seq).getHi();
  DirectByteCharSequence name=null;
  boolean contentType=true;
  boolean swallowSpace=true;
  while (p <= hi) {
    char b=(char)Unsafe.getUnsafe().getByte(p++);
    if (b == ' ' && swallowSpace) {
      _lo=p;
      continue;
    }
    if (p > hi || b == ';') {
      if (contentType) {
        this.contentType=pool.next().of(_lo,p - 1);
        _lo=p;
        contentType=false;
        continue;
      }
      if (name == null) {
        throw UnsupportedContentTypeException.INSTANCE;
      }
      if (Chars.equals("String_Node_Str",name)) {
        encoding=pool.next().of(_lo,p - 1);
        _lo=p;
        continue;
      }
      if (Chars.equals("String_Node_Str",name)) {
        boundary=pool.next().of(_lo,p - 1);
        _lo=p;
        continue;
      }
      if (p > hi) {
        break;
      }
    }
 else {
      name=name == null ? pool.next().of(_lo,p - 1) : name.of(_lo,p - 1);
      _lo=p;
      swallowSpace=false;
    }
  }
}

Fixed version (ground truth):
private void parseContentType() throws UnsupportedContentTypeException {
  CharSequence seq=hb.get("String_Node_Str");
  if (seq == null) {
    return;
  }
  long p=((DirectByteCharSequence)seq).getLo();
  long _lo=p;
  long hi=((DirectByteCharSequence)seq).getHi();
  DirectByteCharSequence name=null;
  boolean contentType=true;
  boolean swallowSpace=true;
  while (p <= hi) {
    char b=(char)Unsafe.getUnsafe().getByte(p++);
    if (b == ' ' && swallowSpace) {
      _lo=p;
      continue;
    }
    if (p > hi || b == ';') {
      if (contentType) {
        this.contentType=pool.next().of(_lo,p - 1);
        _lo=p;
        contentType=false;
        continue;
      }
      if (name == null) {
        throw UnsupportedContentTypeException.INSTANCE;
      }
      if (Chars.equals("String_Node_Str",name)) {
        encoding=pool.next().of(_lo,p - 1);
        _lo=p;
        continue;
      }
      if (Chars.equals("String_Node_Str",name)) {
        boundary=pool.next().of(_lo,p - 1);
        _lo=p;
        continue;
      }
      if (p > hi) {
        break;
      }
    }
 else     if (b == '=') {
      name=name == null ? pool.next().of(_lo,p - 1) : name.of(_lo,p - 1);
      _lo=p;
      swallowSpace=false;
    }
  }
}
Program: 31479
Project: 31479
Buggy source:
public ResponseHeaderBuffer(int size){
  int sz=Numbers.ceilPow2(size);
  this.headers=ByteBuffer.allocateDirect(sz);
  this.headerPtr=((DirectBuffer)headers).address();
  this.limit=headerPtr + sz;
}

Fixed version (ground truth):
public ResponseHeaderBuffer(int size){
  int sz=Numbers.ceilPow2(size);
  this.headers=ByteBuffer.allocateDirect(sz);
  this.headerPtr=_wptr=((DirectBuffer)headers).address();
  this.limit=headerPtr + sz;
}
Program: 31480
Project: 31480
Buggy source:
public FixRecordHolder(RecordMetadata metadata){
  super(metadata);
  int cc=metadata.getColumnCount();
  this.types=new ObjList<>(cc);
  this.offsets=new IntList(cc);
  int offset=0;
  for (int i=0; i < cc; i++) {
    ColumnType type=metadata.getColumnQuick(i).getType();
    types.add(type);
    offsets.add(offset);
switch (type) {
case INT:
case FLOAT:
case SYMBOL:
      offset+=4;
    break;
case LONG:
case DOUBLE:
case DATE:
  offset+=8;
break;
case BOOLEAN:
case BYTE:
offset++;
break;
case SHORT:
offset+=2;
break;
}
}
address=Unsafe.getUnsafe().allocateMemory(offset);
}

Fixed version (ground truth):
public FixRecordHolder(RecordMetadata metadata){
  super(metadata);
  int cc=metadata.getColumnCount();
  this.types=new ObjList<>(cc);
  this.offsets=new IntList(cc);
  int size=0;
  for (int i=0; i < cc; i++) {
    ColumnType type=metadata.getColumnQuick(i).getType();
    types.add(type);
    offsets.add(size);
switch (type) {
case INT:
case FLOAT:
case SYMBOL:
      size+=4;
    break;
case LONG:
case DOUBLE:
case DATE:
  size+=8;
break;
case BOOLEAN:
case BYTE:
size++;
break;
case SHORT:
size+=2;
break;
}
}
address=Unsafe.getUnsafe().allocateMemory(size);
}
Program: 31481
Project: 31481
Buggy source:
@Override public void close(){
  Unsafe.getUnsafe().freeMemory(address);
}

Fixed version (ground truth):
@Override public void close(){
  if (address != 0) {
    Unsafe.getUnsafe().freeMemory(address);
    address=0;
  }
}
Program: 31482
Project: 31482
Buggy source:
@Override public void close(){
  if (address != 0) {
    Unsafe.getUnsafe().freeMemory(address);
  }
}

Fixed version (ground truth):
@Override public void close(){
  if (address != 0) {
    Unsafe.getUnsafe().freeMemory(address);
    address=0;
    size=0;
  }
}
Program: 31483
Project: 31483
Buggy source:
@Override public void close() throws IOException {
  Misc.free(map);
  Misc.free(holder);
  Misc.free(master);
  Misc.free(slave);
}

Fixed version (ground truth):
@Override public void close() throws IOException {
  if (!closed) {
    Misc.free(map);
    Misc.free(holder);
    Misc.free(master);
    Misc.free(slave);
    closed=true;
  }
}
Program: 31485
Project: 31485
Buggy source:
private void splitAggregates(@Transient ExprNode node,ObjList<QueryColumn> aggregateColumns) throws ParserException {
  this.splitAggregatorsStack.clear();
  this.aggregateColumnSequence=0;
  while (!splitAggregatorsStack.isEmpty() || node != null) {
    if (node != null) {
      if (node.rhs != null) {
        ExprNode n=replaceIfAggregate(node.rhs,aggregateColumns);
        if (node.rhs == n) {
          splitAggregatorsStack.push(node.rhs);
        }
 else {
          node.rhs=n;
        }
      }
      ExprNode n=replaceIfAggregate(node.lhs,aggregateColumns);
      if (n == node.lhs) {
        node=node.lhs;
      }
 else {
        node.lhs=n;
        node=null;
      }
    }
 else {
      node=splitAggregatorsStack.poll();
    }
  }
}

Fixed version (ground truth):
private void splitAggregates(@Transient ExprNode node,ObjList<QueryColumn> aggregateColumns) throws ParserException {
  this.exprNodeStack.clear();
  this.aggregateColumnSequence=0;
  while (!this.exprNodeStack.isEmpty() || node != null) {
    if (node != null) {
      if (node.rhs != null) {
        ExprNode n=replaceIfAggregate(node.rhs,aggregateColumns);
        if (node.rhs == n) {
          this.exprNodeStack.push(node.rhs);
        }
 else {
          node.rhs=n;
        }
      }
      ExprNode n=replaceIfAggregate(node.lhs,aggregateColumns);
      if (n == node.lhs) {
        node=node.lhs;
      }
 else {
        node.lhs=n;
        node=null;
      }
    }
 else {
      node=this.exprNodeStack.poll();
    }
  }
}
Program: 31486
Project: 31486
Buggy source:
private QueryCompiler optimise(QueryModel parent,JournalReaderFactory factory) throws JournalException, ParserException {
  ObjList<QueryModel> joinModels=parent.getJoinModels();
  int n=joinModels.size();
  if (n > 1) {
    for (int i=0; i < n; i++) {
      resolveJoinMetadata(parent,i,factory);
    }
    emittedJoinClauses=joinClausesSwap1;
    ExprNode where=parent.getWhereClause();
    parent.setWhereClause(null);
    processAndConditions(parent,where);
    for (int i=1; i < n; i++) {
      processAndConditions(parent,joinModels.getQuick(i).getJoinCriteria());
    }
    if (emittedJoinClauses.size() > 0) {
      processEmittedJoinClauses(parent);
    }
    createImpliedDependencies(parent);
    reorderJournals(parent);
    homogenizeCrossJoins(parent);
    assignFilters(parent);
    alignJoinClauses(parent);
    addTransitiveFilters(parent);
  }
  return this;
}

Fixed version (ground truth):
private QueryCompiler optimise(QueryModel parent,JournalReaderFactory factory) throws JournalException, ParserException {
  ObjList<QueryModel> joinModels=parent.getJoinModels();
  int n=joinModels.size();
  if (n > 1) {
    for (int i=0; i < n; i++) {
      resolveJoinMetadata(parent,i,factory);
    }
    emittedJoinClauses=joinClausesSwap1;
    ExprNode where=parent.getWhereClause();
    parent.setWhereClause(null);
    processAndConditions(parent,where);
    for (int i=1; i < n; i++) {
      processAndConditions(parent,joinModels.getQuick(i).getJoinCriteria());
    }
    if (emittedJoinClauses.size() > 0) {
      processEmittedJoinClauses(parent);
    }
    createImpliedDependencies(parent);
    reorderJournals(parent);
    homogenizeCrossJoins(parent);
    assignFilters(parent);
    alignJoinClauses(parent);
    addTransitiveFilters(parent);
    rewriteColumnsRemovedByJoins(parent);
  }
  return this;
}
Program: 31487
Project: 31487
Buggy source:
/** 
 * Splits "where" clauses into "and" concatenated list of boolean expressions.
 * @param node expression node
 * @throws ParserException
 */
private void processAndConditions(QueryModel parent,ExprNode node) throws ParserException {
  andConditionStack.clear();
  while (!andConditionStack.isEmpty() || node != null) {
    if (node != null) {
switch (node.token) {
case "String_Node_Str":
        if (node.rhs != null) {
          andConditionStack.push(node.rhs);
        }
      node=node.lhs;
    break;
case "String_Node_Str":
  analyseEquals(parent,node);
node=null;
break;
case "String_Node_Str":
processOrConditions(parent,node);
node=null;
break;
case "String_Node_Str":
analyseRegex(parent,node);
default :
parent.addParsedWhereNode(node);
node=null;
break;
}
}
 else {
node=andConditionStack.poll();
}
}
}

Fixed version (ground truth):
/** 
 * Splits "where" clauses into "and" concatenated list of boolean expressions.
 * @param node expression node
 * @throws ParserException
 */
private void processAndConditions(QueryModel parent,ExprNode node) throws ParserException {
  exprNodeStack.clear();
  while (!exprNodeStack.isEmpty() || node != null) {
    if (node != null) {
switch (node.token) {
case "String_Node_Str":
        if (node.rhs != null) {
          exprNodeStack.push(node.rhs);
        }
      node=node.lhs;
    break;
case "String_Node_Str":
  analyseEquals(parent,node);
node=null;
break;
case "String_Node_Str":
processOrConditions(parent,node);
node=null;
break;
case "String_Node_Str":
analyseRegex(parent,node);
default :
parent.addParsedWhereNode(node);
node=null;
break;
}
}
 else {
node=exprNodeStack.poll();
}
}
}
Program: 31488
Project: 31488
Buggy source:
private RecordSource<? extends Record> selectColumns(RecordSource<? extends Record> rs,QueryModel model) throws ParserException {
  return model.getColumns().size() == 0 ? rs : selectColumns01(rs,model);
}

Fixed version (ground truth):
private RecordSource<? extends Record> selectColumns(RecordSource<? extends Record> rs,QueryModel model) throws ParserException {
  return model.getColumns().size() == 0 ? rs : selectColumns0(rs,model);
}
Program: 31489
Project: 31489
Buggy source:
private VirtualColumn lookupFunction(ExprNode node,Signature sig,ObjList<VirtualColumn> args) throws ParserException {
  FunctionFactory factory=FunctionFactories.find(sig,args);
  if (factory == null) {
    throw new ParserException(node.position,"String_Node_Str" + sig.userReadable());
  }
  Function f=factory.newInstance(args);
  if (args != null) {
    int n=node.paramCount;
    for (int i=0; i < n; i++) {
      f.setArg(i,args.getQuick(i));
    }
  }
  return f.isConstant() ? processConstantExpression(f) : f;
}

Fixed version (ground truth):
private VirtualColumn lookupFunction(ExprNode node,Signature sig,ObjList<VirtualColumn> args) throws ParserException {
  if (node.type == ExprNode.NodeType.LAMBDA) {
    throw new ParserException(node.position,"String_Node_Str");
  }
  FunctionFactory factory=FunctionFactories.find(sig,args);
  if (factory == null) {
    throw new ParserException(node.position,"String_Node_Str" + sig.userReadable());
  }
  Function f=factory.newInstance(args);
  if (args != null) {
    int n=node.paramCount;
    for (int i=0; i < n; i++) {
      f.setArg(i,args.getQuick(i));
    }
  }
  return f.isConstant() ? processConstantExpression(f) : f;
}
Program: 31490
Project: 31490
Buggy source:
public NoSuchColumnException(String message,Object... args){
  super(message,args);
}

Fixed version (ground truth):
public NoSuchColumnException(CharSequence name){
  super("String_Node_Str",name);
}
Program: 31491
Project: 31491
Buggy source:
@Override public RecordColumnMetadata getColumn(CharSequence name){
  return getColumnQuick(getColumnIndex(name));
}

Fixed version (ground truth):
@Override public final RecordColumnMetadata getColumn(CharSequence name){
  return getColumnQuick(getColumnIndex(name));
}
Program: 31492
Project: 31492
Buggy source:
@Override public int getColumnIndex(CharSequence columnName){
  int index=getColumnIndexQuiet(columnName);
  if (index == -1) {
    throw new NoSuchColumnException("String_Node_Str",columnName);
  }
  return index;
}

Fixed version (ground truth):
@Override public final int getColumnIndex(CharSequence columnName){
  int index=getColumnIndexQuiet(columnName);
  if (index == -1) {
    throw new NoSuchColumnException(columnName);
  }
  return index;
}
Program: 31493
Project: 31493
Buggy source:
int getColumnIndexQuiet(CharSequence name);

Fixed version (ground truth):
int getColumnIndexQuiet(ColumnName name);
Program: 31495
Project: 31495
Buggy source:
@SuppressFBWarnings({"String_Node_Str"}) public JournalSource(PartitionSource partitionSource,RowSource rowSource){
  this.metadata=partitionSource.getMetadata();
  this.partitionSource=partitionSource;
  rowSource.configure(partitionSource.getMetadata());
  this.rowSource=rowSource;
}

Fixed version (ground truth):
@SuppressFBWarnings({"String_Node_Str"}) public JournalSource(PartitionSource partitionSource,RowSource rowSource){
  this.metadata=partitionSource.getMetadata();
  this.rec=new JournalRecord(this.metadata);
  this.partitionSource=partitionSource;
  rowSource.configure(partitionSource.getMetadata());
  this.rowSource=rowSource;
}
Program: 31496
Project: 31496
Buggy source:
@Override public RecordMetadata getMetadata(){
  return this;
}

Fixed version (ground truth):
@Override public RecordMetadata getMetadata(){
  return metadata;
}
Program: 31497
Project: 31497
Buggy source:
public RowIdHolderRecord(){
  super(new AbstractRecordMetadata(){
    @Override public RecordColumnMetadata getColumn(    int index){
      if (index == 0) {
        return LongMetadata.INSTANCE;
      }
      throw new JournalRuntimeException("String_Node_Str",index);
    }
    @Override public int getColumnCount(){
      return 1;
    }
    @Override public int getColumnIndexQuiet(    CharSequence columnName){
      return Chars.equals(RowIdHolderRecord.name,columnName) ? 0 : -1;
    }
    @Override public RecordColumnMetadata getColumnQuick(    int index){
      return LongMetadata.INSTANCE;
    }
    @Override public RecordColumnMetadata getTimestampMetadata(){
      return null;
    }
  }
);
}

Fixed version (ground truth):
public RowIdHolderRecord(){
  super(new AbstractRecordMetadata(){
    @Override public RecordColumnMetadata getColumn(    int index){
      if (index == 0) {
        return LongMetadata.INSTANCE;
      }
      throw new JournalRuntimeException("String_Node_Str",index);
    }
    @Override public int getColumnCount(){
      return 1;
    }
    @Override public RecordColumnMetadata getColumnQuick(    int index){
      return LongMetadata.INSTANCE;
    }
    @Override public RecordColumnMetadata getTimestampMetadata(){
      return null;
    }
    @Override protected int getLocalColumnIndex(    CharSequence name){
      return Chars.equals(RowIdHolderRecord.name,name) ? 0 : -1;
    }
  }
);
}
Program: 31498
Project: 31498
Buggy source:
public int getColumnIndexQuiet(ColumnName columnName){
  int index;
  if (columnName.alias().length() == 0) {
    index=a.getColumnIndexQuiet(columnName.name());
    if (index == -1) {
      index=b.getColumnIndexQuiet(columnName.name());
      return index == -1 ? index : index + split;
    }
 else {
      return index;
    }
  }
 else {
    if (a instanceof SplitRecordMetadata) {
      index=((SplitRecordMetadata)a).getColumnIndexQuiet(columnName);
    }
 else {
      if (a.getAlias() != null && Chars.equals(a.getAlias(),columnName.alias())) {
        index=a.getColumnIndexQuiet(columnName.name());
      }
 else {
        index=-1;
      }
    }
    if (index > -1) {
      return index;
    }
    if (b instanceof SplitRecordMetadata) {
      index=((SplitRecordMetadata)b).getColumnIndexQuiet(columnName);
    }
 else {
      if (b.getAlias() != null && Chars.equals(b.getAlias(),columnName.alias())) {
        index=b.getColumnIndexQuiet(columnName.name());
      }
 else {
        index=-1;
      }
    }
    return index == -1 ? index : index + split;
  }
}

Fixed version (ground truth):
public int getColumnIndexQuiet(ColumnName columnName){
  int index=a.getColumnIndexQuiet(columnName);
  if (index == -1) {
    index=b.getColumnIndexQuiet(columnName);
    if (index == -1) {
      return index;
    }
 else {
      return index + split;
    }
  }
 else {
    return index;
  }
}
Program: 31500
Project: 31500
Buggy source:
private RecordSource<? extends Record> compileJoins(QueryModel model,JournalReaderFactory factory) throws JournalException, ParserException {
  ObjList<QueryModel> joinModels=model.getJoinModels();
  IntList ordered=model.getOrderedJoinModels();
  RecordSource<? extends Record> master=null;
  boolean collectColumnNameFrequency=model.getColumns().size() > 0;
  for (int i=0, n=ordered.size(); i < n; i++) {
    int index=ordered.getQuick(i);
    QueryModel m=joinModels.getQuick(index);
    RecordSource<? extends Record> slave=m.getRecordSource();
    if (slave == null) {
      slave=compileSingleOrSubQuery(m,factory);
    }
    if (collectColumnNameFrequency) {
      collectColumnNameFrequency(model,slave);
    }
    if (master == null) {
      master=slave;
    }
 else {
switch (m.getJoinType()) {
case CROSS:
        master=new CrossJoinRecordSource(master,slave);
      break;
case ASOF:
    master=createAsOfJoin(model.getTimestamp(),m,master,slave);
  break;
default :
master=createHashJoin(m,master,slave);
break;
}
}
ExprNode filter=m.getPostJoinWhereClause();
if (filter != null) {
master=new FilteredJournalRecordSource(master,createVirtualColumn(filter,master.getMetadata(),model.getColumnNameHistogram()));
}
}
if (joinModelIsFalse(model)) {
return new NoOpJournalRecordSource(master);
}
return master;
}

Fixed version (ground truth):
private RecordSource<? extends Record> compileJoins(QueryModel model,JournalReaderFactory factory) throws JournalException, ParserException {
  ObjList<QueryModel> joinModels=model.getJoinModels();
  IntList ordered=model.getOrderedJoinModels();
  RecordSource<? extends Record> master=null;
  boolean collectColumnNameFrequency=model.getColumns().size() > 0;
  for (int i=0, n=ordered.size(); i < n; i++) {
    int index=ordered.getQuick(i);
    QueryModel m=joinModels.getQuick(index);
    RecordSource<? extends Record> slave=m.getRecordSource();
    if (slave == null) {
      slave=compileSingleOrSubQuery(m,factory);
      if (m.getAlias() != null) {
        slave.getMetadata().setAlias(m.getAlias().token);
      }
    }
    if (collectColumnNameFrequency) {
      collectColumnNameFrequency(model,slave);
    }
    if (master == null) {
      master=slave;
    }
 else {
switch (m.getJoinType()) {
case CROSS:
        master=new CrossJoinRecordSource(master,slave);
      break;
case ASOF:
    master=createAsOfJoin(model.getTimestamp(),m,master,slave);
  break;
default :
master=createHashJoin(m,master,slave);
break;
}
}
ExprNode filter=m.getPostJoinWhereClause();
if (filter != null) {
master=new FilteredJournalRecordSource(master,createVirtualColumn(filter,master.getMetadata(),model.getColumnNameHistogram()));
}
}
if (joinModelIsFalse(model)) {
return new NoOpJournalRecordSource(master);
}
return master;
}
Program: 31501
Project: 31501
Buggy source:
private int resolveJournalIndex(QueryModel parent,CharSequence alias,CharSequence column,int position) throws ParserException {
  ObjList<QueryModel> joinModels=parent.getJoinModels();
  int index=-1;
  if (alias == null) {
    for (int i=0, n=joinModels.size(); i < n; i++) {
      RecordMetadata m=joinModels.getQuick(i).getMetadata();
      if (m.getColumnIndexQuiet(column) == -1) {
        continue;
      }
      if (index > -1) {
        throw new ParserException(position,"String_Node_Str");
      }
      index=i;
    }
    if (index == -1) {
      throw new InvalidColumnException(position);
    }
    return index;
  }
 else {
    index=parent.getAliasIndex(alias);
    if (index == -1) {
      throw new ParserException(position,"String_Node_Str");
    }
    RecordMetadata m=joinModels.getQuick(index).getMetadata();
    if (m.getColumnIndexQuiet(column) == -1) {
      throw new InvalidColumnException(position);
    }
    return index;
  }
}

Fixed version (ground truth):
private int resolveJournalIndex(QueryModel parent,@Transient CharSequence alias,CharSequence column,int position) throws ParserException {
  ObjList<QueryModel> joinModels=parent.getJoinModels();
  int index=-1;
  if (alias == null) {
    for (int i=0, n=joinModels.size(); i < n; i++) {
      RecordMetadata m=joinModels.getQuick(i).getMetadata();
      if (m.getColumnIndexQuiet(column) == -1) {
        continue;
      }
      if (index > -1) {
        throw new ParserException(position,"String_Node_Str");
      }
      index=i;
    }
    if (index == -1) {
      throw new InvalidColumnException(position);
    }
    return index;
  }
 else {
    index=parent.getAliasIndex(alias);
    if (index == -1) {
      throw new ParserException(position,"String_Node_Str");
    }
    RecordMetadata m=joinModels.getQuick(index).getMetadata();
    if (m.getColumnIndexQuiet(column) == -1) {
      throw new InvalidColumnException(position);
    }
    return index;
  }
}
Program: 31503
Project: 31503
Buggy source:
@Override protected SymbolTable getSymbolTable(int col){
  return storageFacade.getSymbolTable(symTableRemap.get(col));
}

Fixed version (ground truth):
@Override protected SymbolTable getSymbolTable(int col){
  return storageFacade.getSymbolTable(col);
}
Program: 31504
Project: 31504
Buggy source:
public void setSlaveCursor(RecordCursor<? extends Record> cursor){
  this.storageFacade=cursor.getStorageFacade();
  for (int i=0, n=slaveValueTypes.size(); i < n; i++) {
    if (slaveValueTypes.getQuick(i) == ColumnType.SYMBOL) {
      symTableRemap.put(i,slaveValueIndexes.getQuick(i));
    }
  }
}

Fixed version (ground truth):
@Override public void setSlaveCursor(RecordCursor<? extends Record> cursor){
  this.storageFacade.of(cursor.getStorageFacade());
}
Program: 31505
Project: 31505
Buggy source:
public LastRowIdRecordMap(RecordMetadata masterMetadata,RecordMetadata slaveMetadata,CharSequenceHashSet masterKeyColumns,CharSequenceHashSet slaveKeyColumns){
  final int ksz=masterKeyColumns.size();
  this.masterKeyTypes=new ObjList<>(ksz);
  this.slaveKeyTypes=new ObjList<>(ksz);
  this.masterKeyIndexes=new IntHashSet(ksz);
  this.slaveKeyIndexes=new IntHashSet(ksz);
  ObjList<RecordColumnMetadata> keyCols=new ObjList<>(ksz);
  for (int i=0; i < ksz; i++) {
    int idx;
    idx=masterMetadata.getColumnIndex(masterKeyColumns.get(i));
    masterKeyTypes.add(masterMetadata.getColumnQuick(idx).getType());
    masterKeyIndexes.add(idx);
    idx=slaveMetadata.getColumnIndex(slaveKeyColumns.get(i));
    slaveKeyIndexes.add(idx);
    slaveKeyTypes.add(slaveMetadata.getColumnQuick(idx).getType());
    keyCols.add(slaveMetadata.getColumnQuick(idx));
  }
  ObjList<CharSequence> slaveColumnNames=new ObjList<>();
  for (int i=0, n=slaveMetadata.getColumnCount(); i < n; i++) {
    if (slaveKeyIndexes.contains(i)) {
      continue;
    }
    slaveColumnNames.add(slaveMetadata.getColumnQuick(i).getName());
  }
  this.map=new MultiMap(valueMetadata,keyCols,null);
  this.metadata=new SelectedColumnsMetadata(slaveMetadata,slaveColumnNames);
  this.record=new SelectedColumnsRecord(slaveMetadata,slaveColumnNames);
}

Fixed version (ground truth):
public LastRowIdRecordMap(RecordMetadata masterMetadata,RecordMetadata slaveMetadata,CharSequenceHashSet masterKeyColumns,CharSequenceHashSet slaveKeyColumns){
  final int ksz=masterKeyColumns.size();
  this.masterKeyTypes=new ObjList<>(ksz);
  this.slaveKeyTypes=new ObjList<>(ksz);
  this.masterKeyIndexes=new IntHashSet(ksz);
  this.slaveKeyIndexes=new IntHashSet(ksz);
  ObjList<RecordColumnMetadata> keyCols=new ObjList<>(ksz);
  for (int i=0; i < ksz; i++) {
    int idx;
    idx=masterMetadata.getColumnIndex(masterKeyColumns.get(i));
    masterKeyTypes.add(masterMetadata.getColumnQuick(idx).getType());
    masterKeyIndexes.add(idx);
    idx=slaveMetadata.getColumnIndex(slaveKeyColumns.get(i));
    slaveKeyIndexes.add(idx);
    slaveKeyTypes.add(slaveMetadata.getColumnQuick(idx).getType());
    keyCols.add(slaveMetadata.getColumnQuick(idx));
  }
  ObjList<CharSequence> slaveColumnNames=new ObjList<>();
  for (int i=0, n=slaveMetadata.getColumnCount(); i < n; i++) {
    if (slaveKeyIndexes.contains(i)) {
      continue;
    }
    slaveColumnNames.add(slaveMetadata.getColumnQuick(i).getName());
  }
  this.map=new MultiMap(valueMetadata,keyCols,null);
  this.metadata=new SelectedColumnsMetadata(slaveMetadata,slaveColumnNames);
  this.record=new SelectedColumnsRecord(slaveMetadata,slaveColumnNames);
  this.storageFacade=new SelectedColumnsStorageFacade(slaveMetadata,this.metadata,slaveColumnNames);
}
Program: 31506
Project: 31506
Buggy source:
public void setSlaveCursor(RecordCursor<? extends Record> cursor){
  this.slaveCursor=cursor;
}

Fixed version (ground truth):
public void setSlaveCursor(RecordCursor<? extends Record> cursor){
  this.slaveCursor=cursor;
  this.storageFacade.of(cursor.getStorageFacade());
}
Program: 31507
Project: 31507
Buggy source:
@Override protected SymbolTable getSymbolTable(int col){
  return storageFacade.getSymbolTable(symTableRemap.get(col));
}

Fixed version (ground truth):
@Override protected SymbolTable getSymbolTable(int col){
  return storageFacade.getSymbolTable(col);
}
Program: 31508
Project: 31508
Buggy source:
@Override public void setSlaveCursor(RecordCursor<? extends Record> cursor){
  this.storageFacade=cursor.getStorageFacade();
  for (int i=0, n=slaveValueTypes.size(); i < n; i++) {
    if (slaveValueTypes.getQuick(i) == ColumnType.SYMBOL) {
      symTableRemap.put(i,slaveValueIndexes.getQuick(i));
    }
  }
}

Fixed version (ground truth):
@Override public void setSlaveCursor(RecordCursor<? extends Record> cursor){
  this.storageFacade.of(cursor.getStorageFacade());
}
Program: 31509
Project: 31509
Buggy source:
@Override public RecordCursor<Record> prepareCursor(JournalReaderFactory factory) throws JournalException {
  this.masterCursor=master.prepareCursor(factory);
  this.slaveCursor=slave.prepareCursor(factory);
  this.recordHolder.setCursor(slaveCursor);
  this.delayedHolder.setCursor(slaveCursor);
  return this;
}

Fixed version (ground truth):
@Override public RecordCursor<Record> prepareCursor(JournalReaderFactory factory) throws JournalException {
  this.masterCursor=master.prepareCursor(factory);
  this.slaveCursor=slave.prepareCursor(factory);
  this.recordHolder.setCursor(slaveCursor);
  this.delayedHolder.setCursor(slaveCursor);
  this.storageFacade.prepare(factory,masterCursor.getStorageFacade(),slaveCursor.getStorageFacade());
  return this;
}
Program: 31510
Project: 31510
Buggy source:
public AsOfJoinRecordSource(RecordSource<? extends Record> master,int masterTimestampIndex,RecordSource<? extends Record> slave,int slaveTimestampIndex){
  this.master=master;
  this.masterTimestampIndex=masterTimestampIndex;
  this.slave=slave;
  this.slaveTimestampIndex=slaveTimestampIndex;
  this.metadata=new SplitRecordMetadata(master.getMetadata(),slave.getMetadata());
  this.record=new SplitRecord(this.metadata,master.getMetadata().getColumnCount());
  if (slave.supportsRowIdAccess()) {
    this.recordHolder=new RowidRecordHolder();
    this.delayedHolder=new RowidRecordHolder();
  }
 else {
    boolean var=false;
    OUT:     for (int i=0, n=slave.getMetadata().getColumnCount(); i < n; i++) {
switch (slave.getMetadata().getColumnQuick(i).getType()) {
case BINARY:
        throw new JournalRuntimeException("String_Node_Str");
case STRING:
      var=true;
    break OUT;
}
}
if (var) {
this.recordHolder=new VarRecordHolder(slave.getMetadata());
this.delayedHolder=new VarRecordHolder(slave.getMetadata());
}
 else {
this.recordHolder=new FixRecordHolder(slave.getMetadata());
this.delayedHolder=new FixRecordHolder(slave.getMetadata());
}
}
}

Fixed version (ground truth):
public AsOfJoinRecordSource(RecordSource<? extends Record> master,int masterTimestampIndex,RecordSource<? extends Record> slave,int slaveTimestampIndex){
  this.master=master;
  this.masterTimestampIndex=masterTimestampIndex;
  this.slave=slave;
  this.slaveTimestampIndex=slaveTimestampIndex;
  this.metadata=new SplitRecordMetadata(master.getMetadata(),slave.getMetadata());
  this.record=new SplitRecord(this.metadata,master.getMetadata().getColumnCount());
  if (slave.supportsRowIdAccess()) {
    this.recordHolder=new RowidRecordHolder();
    this.delayedHolder=new RowidRecordHolder();
  }
 else {
    boolean var=false;
    OUT:     for (int i=0, n=slave.getMetadata().getColumnCount(); i < n; i++) {
switch (slave.getMetadata().getColumnQuick(i).getType()) {
case BINARY:
        throw new JournalRuntimeException("String_Node_Str");
case STRING:
      var=true;
    break OUT;
}
}
if (var) {
this.recordHolder=new VarRecordHolder(slave.getMetadata());
this.delayedHolder=new VarRecordHolder(slave.getMetadata());
}
 else {
this.recordHolder=new FixRecordHolder(slave.getMetadata());
this.delayedHolder=new FixRecordHolder(slave.getMetadata());
}
}
this.storageFacade=new SplitRecordStorageFacade(this.metadata,master.getMetadata().getColumnCount());
}
Program: 31511
Project: 31511
Buggy source:
@Override public StorageFacade getStorageFacade(){
  return null;
}

Fixed version (ground truth):
@Override public StorageFacade getStorageFacade(){
  return storageFacade;
}
Program: 31512
Project: 31512
Buggy source:
@Override public RecordCursor<Record> prepareCursor(JournalReaderFactory factory) throws JournalException {
  this.masterCursor=master.prepareCursor(factory);
  this.slaveCursor=slave.prepareCursor(factory);
  map.setSlaveCursor(slaveCursor);
  holder.setCursor(slaveCursor);
  return this;
}

Fixed version (ground truth):
@Override public RecordCursor<Record> prepareCursor(JournalReaderFactory factory) throws JournalException {
  this.masterCursor=master.prepareCursor(factory);
  this.slaveCursor=slave.prepareCursor(factory);
  map.setSlaveCursor(slaveCursor);
  holder.setCursor(slaveCursor);
  storageFacade.prepare(factory,masterCursor.getStorageFacade(),map.getStorageFacade());
  return this;
}
Program: 31513
Project: 31513
Buggy source:
public AsOfPartitionedJoinRecordSource(RecordSource<? extends Record> master,int masterTimestampIndex,RecordSource<? extends Record> slave,int slaveTimestampIndex,CharSequenceHashSet masterKeyColumns,CharSequenceHashSet slaveKeyColumns,int pageSize){
  this.master=master;
  this.masterTimestampIndex=masterTimestampIndex;
  this.slave=slave;
  this.slaveTimestampIndex=slaveTimestampIndex;
  if (slave.supportsRowIdAccess()) {
    map=new LastRowIdRecordMap(master.getMetadata(),slave.getMetadata(),masterKeyColumns,slaveKeyColumns);
    holder=new RowidRecordHolder();
  }
 else {
    boolean var=false;
    OUT:     for (int i=0, n=slave.getMetadata().getColumnCount(); i < n; i++) {
switch (slave.getMetadata().getColumnQuick(i).getType()) {
case BINARY:
        throw new JournalRuntimeException("String_Node_Str");
case STRING:
      if (!masterKeyColumns.contains(slave.getMetadata().getColumnQuick(i).getName())) {
        var=true;
      }
    break OUT;
}
}
if (var) {
this.map=new LastVarRecordMap(master.getMetadata(),slave.getMetadata(),masterKeyColumns,slaveKeyColumns,pageSize);
this.holder=new VarRecordHolder(slave.getMetadata());
}
 else {
this.map=new LastFixRecordMap(master.getMetadata(),slave.getMetadata(),masterKeyColumns,slaveKeyColumns,pageSize);
this.holder=new FixRecordHolder(slave.getMetadata());
}
}
this.metadata=new SplitRecordMetadata(master.getMetadata(),map.getMetadata());
this.record=new SplitRecord(this.metadata,master.getMetadata().getColumnCount());
}

Fixed version (ground truth):
public AsOfPartitionedJoinRecordSource(RecordSource<? extends Record> master,int masterTimestampIndex,RecordSource<? extends Record> slave,int slaveTimestampIndex,CharSequenceHashSet masterKeyColumns,CharSequenceHashSet slaveKeyColumns,int pageSize){
  this.master=master;
  this.masterTimestampIndex=masterTimestampIndex;
  this.slave=slave;
  this.slaveTimestampIndex=slaveTimestampIndex;
  if (slave.supportsRowIdAccess()) {
    map=new LastRowIdRecordMap(master.getMetadata(),slave.getMetadata(),masterKeyColumns,slaveKeyColumns);
    holder=new RowidRecordHolder();
  }
 else {
    boolean var=false;
    OUT:     for (int i=0, n=slave.getMetadata().getColumnCount(); i < n; i++) {
switch (slave.getMetadata().getColumnQuick(i).getType()) {
case BINARY:
        throw new JournalRuntimeException("String_Node_Str");
case STRING:
      if (!masterKeyColumns.contains(slave.getMetadata().getColumnQuick(i).getName())) {
        var=true;
      }
    break OUT;
}
}
if (var) {
this.map=new LastVarRecordMap(master.getMetadata(),slave.getMetadata(),masterKeyColumns,slaveKeyColumns,pageSize);
this.holder=new VarRecordHolder(slave.getMetadata());
}
 else {
this.map=new LastFixRecordMap(master.getMetadata(),slave.getMetadata(),masterKeyColumns,slaveKeyColumns,pageSize);
this.holder=new FixRecordHolder(slave.getMetadata());
}
}
this.metadata=new SplitRecordMetadata(master.getMetadata(),map.getMetadata());
this.record=new SplitRecord(this.metadata,master.getMetadata().getColumnCount());
this.storageFacade=new SplitRecordStorageFacade(this.metadata,master.getMetadata().getColumnCount());
}
Program: 31514
Project: 31514
Buggy source:
@SuppressFBWarnings({"String_Node_Str"}) public HashJoinRecordSource(RecordSource<? extends Record> master,IntList masterColIndices,RecordSource<? extends Record> slave,IntList slaveColIndices,boolean outer){
  this.master=master;
  this.slave=slave;
  this.metadata=new SplitRecordMetadata(master.getMetadata(),slave.getMetadata());
  this.currentRecord=new SplitRecord(metadata,master.getMetadata().getColumnCount());
  this.byRowId=slave.supportsRowIdAccess();
  this.masterColIndex=masterColIndices;
  this.slaveColIndex=slaveColIndices;
  this.recordMap=createRecordMap(master,slave);
  this.outer=outer;
  this.nullRecord=new NullRecord(slave.getMetadata());
}

Fixed version (ground truth):
@SuppressFBWarnings({"String_Node_Str"}) public HashJoinRecordSource(RecordSource<? extends Record> master,IntList masterColIndices,RecordSource<? extends Record> slave,IntList slaveColIndices,boolean outer){
  this.master=master;
  this.slave=slave;
  this.metadata=new SplitRecordMetadata(master.getMetadata(),slave.getMetadata());
  this.currentRecord=new SplitRecord(metadata,master.getMetadata().getColumnCount());
  this.byRowId=slave.supportsRowIdAccess();
  this.masterColIndex=masterColIndices;
  this.slaveColIndex=slaveColIndices;
  this.recordMap=createRecordMap(master,slave);
  this.outer=outer;
  this.nullRecord=new NullRecord(slave.getMetadata());
  this.storageFacade=new SplitRecordStorageFacade(metadata,master.getMetadata().getColumnCount());
}
Program: 31515
Project: 31515
Buggy source:
@Override public StorageFacade getStorageFacade(){
  return null;
}

Fixed version (ground truth):
@Override public StorageFacade getStorageFacade(){
  return storageFacade;
}
Program: 31516
Project: 31516
Buggy source:
@Override public RecordCursor<Record> prepareCursor(JournalReaderFactory factory) throws JournalException {
  this.slaveCursor=slave.prepareCursor(factory);
  this.masterCursor=master.prepareCursor(factory);
  buildHashTable();
  recordMap.setStorageFacade(slaveCursor.getStorageFacade());
  return this;
}

Fixed version (ground truth):
@Override public RecordCursor<Record> prepareCursor(JournalReaderFactory factory) throws JournalException {
  this.slaveCursor=slave.prepareCursor(factory);
  this.masterCursor=master.prepareCursor(factory);
  buildHashTable();
  recordMap.setStorageFacade(slaveCursor.getStorageFacade());
  storageFacade.prepare(factory,masterCursor.getStorageFacade(),slaveCursor.getStorageFacade());
  return this;
}
Program: 31517
Project: 31517
Buggy source:
@Override public RecordCursor<Record> prepareCursor(JournalReaderFactory factory) throws JournalException {
  this.recordCursor=recordSource.prepareCursor(factory);
  this.storageFacade.setDelegate(recordCursor.getStorageFacade());
  return this;
}

Fixed version (ground truth):
@Override public RecordCursor<Record> prepareCursor(JournalReaderFactory factory) throws JournalException {
  this.recordCursor=recordSource.prepareCursor(factory);
  this.storageFacade.of(recordCursor.getStorageFacade());
  return this;
}
Program: 31518
Project: 31518
Buggy source:
@Override public RecordCursor<Record> prepareCursor(JournalReaderFactory factory) throws JournalException {
  this.slaveCursor=slave.prepareCursor(factory);
  this.masterCursor=master.prepareCursor(factory);
  buildHashTable();
  return this;
}

Fixed version (ground truth):
@Override public RecordCursor<Record> prepareCursor(JournalReaderFactory factory) throws JournalException {
  this.slaveCursor=slave.prepareCursor(factory);
  this.masterCursor=master.prepareCursor(factory);
  buildHashTable();
  recordMap.setStorageFacade(slaveCursor.getStorageFacade());
  return this;
}
Program: 31519
Project: 31519
Buggy source:
@Override public String getSym(int col){
  return getStr(col).toString();
}

Fixed version (ground truth):
@Override public String getSym(int col){
  return storageFacade.getSymbolTable(col).value(getInt(col));
}