Program: 31557
Project: 31557
Buggy source:
@SuppressFBWarnings({"String_Node_Str","String_Node_Str"}) private RecordSource<? extends Record> createRecordSource(QueryModel model) throws JournalException, ParserException {
  ExprNode readerNode=model.getJournalName();
  if (readerNode.type != ExprNode.NodeType.LITERAL && readerNode.type != ExprNode.NodeType.CONSTANT) {
    throw new ParserException(readerNode.position,"String_Node_Str");
  }
  JournalConfiguration configuration=factory.getConfiguration();
  String reader=Chars.stripQuotes(readerNode.token);
  if (configuration.exists(reader) == JournalConfiguration.JournalExistenceCheck.DOES_NOT_EXIST) {
    throw new ParserException(readerNode.position,"String_Node_Str");
  }
  if (configuration.exists(reader) == JournalConfiguration.JournalExistenceCheck.EXISTS_FOREIGN) {
    throw new ParserException(readerNode.position,"String_Node_Str");
  }
  JournalMetadata metadata=factory.getOrCreateMetadata(new JournalKey<>(reader));
  PartitionSource ps=new JournalPartitionSource(metadata,true);
  RowSource rs=null;
  String latestByCol=null;
  ColumnMetadata latestByMetadata=null;
  ExprNode latestByNode=null;
  if (model.getLatestBy() != null) {
    latestByNode=model.getLatestBy();
    if (latestByNode.type != ExprNode.NodeType.LITERAL) {
      throw new ParserException(latestByNode.position,"String_Node_Str");
    }
    if (metadata.invalidColumn(latestByNode.token)) {
      throw new InvalidColumnException(latestByNode.position);
    }
    latestByMetadata=metadata.getColumn(latestByNode.token);
    if (latestByMetadata.type != ColumnType.SYMBOL && latestByMetadata.type != ColumnType.STRING) {
      throw new ParserException(latestByNode.position,"String_Node_Str" + latestByMetadata.type);
    }
    if (!latestByMetadata.indexed) {
      throw new ParserException(latestByNode.position,"String_Node_Str");
    }
    latestByCol=latestByNode.token;
  }
  ExprNode where=model.getWhereClause();
  if (where != null) {
    IntrinsicModel im=intrinsicExtractor.extract(where,metadata,latestByCol);
    VirtualColumn filter=im.filter != null ? createVirtualColumn(im.filter,metadata) : null;
    if (filter != null) {
      if (filter.getType() != ColumnType.BOOLEAN) {
        throw new ParserException(im.filter.position,"String_Node_Str");
      }
      if (filter.isConstant()) {
        if (filter.getBool(null)) {
          filter=null;
        }
 else {
          im.intrinsicValue=IntrinsicValue.FALSE;
        }
      }
    }
    if (im.intrinsicValue == IntrinsicValue.FALSE) {
      ps=new NoOpJournalPartitionSource(metadata);
    }
 else {
      if (im.intervalHi < Long.MAX_VALUE || im.intervalLo > Long.MIN_VALUE) {
        ps=new MultiIntervalPartitionSource(ps,new SingleIntervalSource(new Interval(im.intervalLo,im.intervalHi)));
      }
      if (im.intervalSource != null) {
        ps=new MultiIntervalPartitionSource(ps,im.intervalSource);
      }
      if (latestByCol == null) {
        if (im.keyColumn != null) {
switch (metadata.getColumn(im.keyColumn).type) {
case SYMBOL:
            rs=createRecordSourceForSym(im);
          break;
case STRING:
        rs=createRecordSourceForStr(im);
      break;
  }
}
if (filter != null) {
  rs=new FilteredRowSource(rs == null ? new AllRowSource() : rs,filter);
}
}
 else {
switch (latestByMetadata.type) {
case SYMBOL:
  if (im.keyColumn != null) {
    rs=new KvIndexSymListHeadRowSource(latestByCol,im.keyValues,filter);
  }
 else {
    rs=new KvIndexAllSymHeadRowSource(latestByCol,filter);
  }
break;
case STRING:
if (im.keyColumn != null) {
rs=new KvIndexStrListHeadRowSource(latestByCol,im.keyValues,filter);
}
 else {
throw new ParserException(latestByNode.position,"String_Node_Str");
}
break;
}
}
}
}
 else if (latestByCol != null) {
switch (latestByMetadata.type) {
case SYMBOL:
rs=new KvIndexAllSymHeadRowSource(latestByCol,null);
break;
case STRING:
throw new ParserException(latestByNode.position,"String_Node_Str");
}
}
return new JournalSource(ps,rs == null ? new AllRowSource() : rs);
}

Fixed version (ground truth):
@SuppressFBWarnings({"String_Node_Str","String_Node_Str"}) private RecordSource<? extends Record> createRecordSource(QueryModel model,JournalReaderFactory factory) throws JournalException, ParserException {
  ExprNode readerNode=model.getJournalName();
  if (readerNode.type != ExprNode.NodeType.LITERAL && readerNode.type != ExprNode.NodeType.CONSTANT) {
    throw new ParserException(readerNode.position,"String_Node_Str");
  }
  JournalConfiguration configuration=factory.getConfiguration();
  String reader=Chars.stripQuotes(readerNode.token);
  if (configuration.exists(reader) == JournalConfiguration.JournalExistenceCheck.DOES_NOT_EXIST) {
    throw new ParserException(readerNode.position,"String_Node_Str");
  }
  if (configuration.exists(reader) == JournalConfiguration.JournalExistenceCheck.EXISTS_FOREIGN) {
    throw new ParserException(readerNode.position,"String_Node_Str");
  }
  JournalMetadata metadata=factory.getOrCreateMetadata(new JournalKey<>(reader));
  PartitionSource ps=new JournalPartitionSource(metadata,true);
  RowSource rs=null;
  String latestByCol=null;
  ColumnMetadata latestByMetadata=null;
  ExprNode latestByNode=null;
  if (model.getLatestBy() != null) {
    latestByNode=model.getLatestBy();
    if (latestByNode.type != ExprNode.NodeType.LITERAL) {
      throw new ParserException(latestByNode.position,"String_Node_Str");
    }
    if (metadata.invalidColumn(latestByNode.token)) {
      throw new InvalidColumnException(latestByNode.position);
    }
    latestByMetadata=metadata.getColumn(latestByNode.token);
    if (latestByMetadata.type != ColumnType.SYMBOL && latestByMetadata.type != ColumnType.STRING) {
      throw new ParserException(latestByNode.position,"String_Node_Str" + latestByMetadata.type);
    }
    if (!latestByMetadata.indexed) {
      throw new ParserException(latestByNode.position,"String_Node_Str");
    }
    latestByCol=latestByNode.token;
  }
  ExprNode where=model.getWhereClause();
  if (where != null) {
    IntrinsicModel im=intrinsicExtractor.extract(where,metadata,latestByCol);
    VirtualColumn filter=im.filter != null ? createVirtualColumn(im.filter,metadata) : null;
    if (filter != null) {
      if (filter.getType() != ColumnType.BOOLEAN) {
        throw new ParserException(im.filter.position,"String_Node_Str");
      }
      if (filter.isConstant()) {
        if (filter.getBool(null)) {
          filter=null;
        }
 else {
          im.intrinsicValue=IntrinsicValue.FALSE;
        }
      }
    }
    if (im.intrinsicValue == IntrinsicValue.FALSE) {
      ps=new NoOpJournalPartitionSource(metadata);
    }
 else {
      if (im.intervalHi < Long.MAX_VALUE || im.intervalLo > Long.MIN_VALUE) {
        ps=new MultiIntervalPartitionSource(ps,new SingleIntervalSource(new Interval(im.intervalLo,im.intervalHi)));
      }
      if (im.intervalSource != null) {
        ps=new MultiIntervalPartitionSource(ps,im.intervalSource);
      }
      if (latestByCol == null) {
        if (im.keyColumn != null) {
switch (metadata.getColumn(im.keyColumn).type) {
case SYMBOL:
            rs=createRecordSourceForSym(im);
          break;
case STRING:
        rs=createRecordSourceForStr(im);
      break;
  }
}
if (filter != null) {
  rs=new FilteredRowSource(rs == null ? new AllRowSource() : rs,filter);
}
}
 else {
switch (latestByMetadata.type) {
case SYMBOL:
  if (im.keyColumn != null) {
    rs=new KvIndexSymListHeadRowSource(latestByCol,im.keyValues,filter);
  }
 else {
    rs=new KvIndexAllSymHeadRowSource(latestByCol,filter);
  }
break;
case STRING:
if (im.keyColumn != null) {
rs=new KvIndexStrListHeadRowSource(latestByCol,im.keyValues,filter);
}
 else {
throw new ParserException(latestByNode.position,"String_Node_Str");
}
break;
}
}
}
}
 else if (latestByCol != null) {
switch (latestByMetadata.type) {
case SYMBOL:
rs=new KvIndexAllSymHeadRowSource(latestByCol,null);
break;
case STRING:
throw new ParserException(latestByNode.position,"String_Node_Str");
}
}
return new JournalSource(ps,rs == null ? new AllRowSource() : rs);
}