nus-yam/ex-repair huggingface dataset:
Program: 168841
Project: 168841
Buggy source:
@Test public void testSelectNestedAggregatePaginated(){
  PaginatedCriteriaBuilder<Tuple> cb=cbf.create(em,Tuple.class).from(Document.class,"String_Node_Str").selectCase().when("String_Node_Str").gtExpression("String_Node_Str").thenExpression("String_Node_Str").otherwiseExpression("String_Node_Str").select("String_Node_Str").orderByDesc("String_Node_Str").page(0,10);
  String countQuery="String_Node_Str" + countPaginated("String_Node_Str",false) + "String_Node_Str";
  String idQuery="String_Node_Str" + groupBy("String_Node_Str",renderNullPrecedenceGroupBy("String_Node_Str")) + "String_Node_Str"+ renderNullPrecedence("String_Node_Str","String_Node_Str","String_Node_Str");
  String objectQuery="String_Node_Str" + "String_Node_Str" + groupBy("String_Node_Str","String_Node_Str","String_Node_Str",renderNullPrecedenceGroupBy("String_Node_Str")) + "String_Node_Str"+ renderNullPrecedence("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(countQuery,cb.getPageCountQueryString());
  assertEquals(idQuery,cb.getPageIdQueryString());
  assertEquals(objectQuery,cb.getQueryString());
  cb.getResultList();
}

Fixed version (ground truth):
@Test public void testSelectNestedAggregatePaginated(){
  PaginatedCriteriaBuilder<Tuple> cb=cbf.create(em,Tuple.class).from(Document.class,"String_Node_Str").selectCase().when("String_Node_Str").gtExpression("String_Node_Str").thenExpression("String_Node_Str").otherwiseExpression("String_Node_Str").select("String_Node_Str").orderByDesc("String_Node_Str").page(0,10);
  String countQuery="String_Node_Str" + countPaginated("String_Node_Str",false) + "String_Node_Str";
  String idQuery="String_Node_Str" + groupBy("String_Node_Str",renderNullPrecedenceGroupBy("String_Node_Str")) + "String_Node_Str"+ renderNullPrecedence("String_Node_Str","String_Node_Str","String_Node_Str");
  String objectQuery="String_Node_Str" + "String_Node_Str" + groupBy("String_Node_Str","String_Node_Str",renderNullPrecedenceGroupBy("String_Node_Str")) + "String_Node_Str"+ renderNullPrecedence("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(countQuery,cb.getPageCountQueryString());
  assertEquals(idQuery,cb.getPageIdQueryString());
  assertEquals(objectQuery,cb.getQueryString());
  cb.getResultList();
}
Program: 168842
Project: 168842
Buggy source:
@Test public void testSelectNestedAggregate(){
  CriteriaBuilder<Tuple> cb=cbf.create(em,Tuple.class).from(Document.class,"String_Node_Str").selectCase().when("String_Node_Str").gtExpression("String_Node_Str").thenExpression("String_Node_Str").otherwiseExpression("String_Node_Str").select("String_Node_Str").orderByDesc("String_Node_Str");
  String objectQuery="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + groupBy("String_Node_Str","String_Node_Str","String_Node_Str",renderNullPrecedenceGroupBy("String_Node_Str")) + "String_Node_Str"+ renderNullPrecedence("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(objectQuery,cb.getQueryString());
  cb.getResultList();
}

Fixed version (ground truth):
@Test public void testSelectNestedAggregate(){
  CriteriaBuilder<Tuple> cb=cbf.create(em,Tuple.class).from(Document.class,"String_Node_Str").selectCase().when("String_Node_Str").gtExpression("String_Node_Str").thenExpression("String_Node_Str").otherwiseExpression("String_Node_Str").select("String_Node_Str").orderByDesc("String_Node_Str");
  String objectQuery="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + groupBy("String_Node_Str","String_Node_Str",renderNullPrecedenceGroupBy("String_Node_Str")) + "String_Node_Str"+ renderNullPrecedence("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(objectQuery,cb.getQueryString());
  cb.getResultList();
}
Program: 168843
Project: 168843
Buggy source:
@Test public void testSelectAggregateEntitySelectPaginated(){
  PaginatedCriteriaBuilder<Tuple> cb=cbf.create(em,Tuple.class).from(Document.class,"String_Node_Str").selectCase().when("String_Node_Str").gtExpression("String_Node_Str").thenExpression("String_Node_Str").otherwiseExpression("String_Node_Str").select("String_Node_Str").orderByDesc("String_Node_Str").page(0,10);
  String countQuery="String_Node_Str" + countPaginated("String_Node_Str",false) + "String_Node_Str";
  String idQuery="String_Node_Str" + groupBy("String_Node_Str",renderNullPrecedenceGroupBy("String_Node_Str")) + "String_Node_Str"+ renderNullPrecedence("String_Node_Str","String_Node_Str","String_Node_Str");
  String objectQuery="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + groupBy("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",renderNullPrecedenceGroupBy("String_Node_Str")) + "String_Node_Str"+ renderNullPrecedence("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(countQuery,cb.getPageCountQueryString());
  assertEquals(idQuery,cb.getPageIdQueryString());
  assertEquals(objectQuery,cb.getQueryString());
  cb.getResultList();
}

Fixed version (ground truth):
@Test public void testSelectAggregateEntitySelectPaginated(){
  PaginatedCriteriaBuilder<Tuple> cb=cbf.create(em,Tuple.class).from(Document.class,"String_Node_Str").selectCase().when("String_Node_Str").gtExpression("String_Node_Str").thenExpression("String_Node_Str").otherwiseExpression("String_Node_Str").select("String_Node_Str").orderByDesc("String_Node_Str").page(0,10);
  String countQuery="String_Node_Str" + countPaginated("String_Node_Str",false) + "String_Node_Str";
  String idQuery="String_Node_Str" + groupBy("String_Node_Str",renderNullPrecedenceGroupBy("String_Node_Str")) + "String_Node_Str"+ renderNullPrecedence("String_Node_Str","String_Node_Str","String_Node_Str");
  String objectQuery="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + groupBy("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",renderNullPrecedenceGroupBy("String_Node_Str")) + "String_Node_Str"+ renderNullPrecedence("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(countQuery,cb.getPageCountQueryString());
  assertEquals(idQuery,cb.getPageIdQueryString());
  assertEquals(objectQuery,cb.getQueryString());
  cb.getResultList();
}
Program: 168844
Project: 168844
Buggy source:
@Override public String[] getColumnTypes(EntityManager em,EntityType<?> entityType,String attributeName){
  SessionImplementor session=em.unwrap(SessionImplementor.class);
  SessionFactoryImplementor sfi=session.getFactory();
  AbstractEntityPersister entityPersister=(AbstractEntityPersister)sfi.getClassMetadata(entityType.getJavaType());
  String[] columnNames=entityPersister.getPropertyColumnNames(attributeName);
  Database database=sfi.getServiceRegistry().locateServiceBinding(Database.class).getService();
  Table table=database.getTable(entityPersister.getTableName());
  String[] columnTypes=new String[columnNames.length];
  for (int i=0; i < columnNames.length; i++) {
    Column column=table.getColumn(new Column(columnNames[i]));
    columnTypes[i]=column.getSqlType();
  }
  return columnTypes;
}

Fixed version (ground truth):
@Override public String[] getColumnTypes(EntityManager em,EntityType<?> entityType,String attributeName){
  SessionImplementor session=em.unwrap(SessionImplementor.class);
  SessionFactoryImplementor sfi=session.getFactory();
  AbstractEntityPersister entityPersister=(AbstractEntityPersister)sfi.getClassMetadata(entityType.getJavaType());
  String[] columnNames=entityPersister.getPropertyColumnNames(attributeName);
  Database database=sfi.getServiceRegistry().locateServiceBinding(Database.class).getService();
  Table[] tables;
  if (entityPersister instanceof JoinedSubclassEntityPersister) {
    tables=new Table[((JoinedSubclassEntityPersister)entityPersister).getTableSpan()];
    for (int i=0; i < tables.length; i++) {
      tables[i]=database.getTable(entityPersister.getSubclassTableName(i));
    }
  }
 else {
    tables=new Table[]{database.getTable(entityPersister.getTableName())};
  }
  String[] columnTypes=new String[columnNames.length];
  for (int i=0; i < columnNames.length; i++) {
    Column column=null;
    for (int j=0; j < tables.length; j++) {
      column=tables[j].getColumn(new Column(columnNames[i]));
      if (column != null) {
        break;
      }
    }
    if (column == null) {
      throw new IllegalArgumentException("String_Node_Str" + columnNames[i] + "String_Node_Str"+ entityType.getName());
    }
    columnTypes[i]=column.getSqlType();
  }
  return columnTypes;
}
Program: 168845
Project: 168845
Buggy source:
@Override @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public FinalSetOperationCTECriteriaBuilder<T> endSet(){
  subListener.verifyBuilderEnded();
  listener.onBuilderEnded(this);
  prepareAndCheck();
  return (FinalSetOperationCTECriteriaBuilder<T>)(FinalSetOperationCTECriteriaBuilder)finalSetOperationBuilder;
}

Fixed version (ground truth):
@Override @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public FinalSetOperationCTECriteriaBuilder<T> endSet(){
  subListener.verifyBuilderEnded();
  listener.onBuilderEnded(this);
  if (!isEmpty()) {
    prepareAndCheck();
  }
  return (FinalSetOperationCTECriteriaBuilder<T>)(FinalSetOperationCTECriteriaBuilder)finalSetOperationBuilder;
}
Program: 168846
Project: 168846
Buggy source:
@Override @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public FinalSetOperationCriteriaBuilder<T> endSet(){
  subListener.verifyBuilderEnded();
  listener.onBuilderEnded(this);
  prepareAndCheck();
  return (FinalSetOperationCriteriaBuilder<T>)(FinalSetOperationCriteriaBuilder)finalSetOperationBuilder;
}

Fixed version (ground truth):
@Override @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public FinalSetOperationCriteriaBuilder<T> endSet(){
  subListener.verifyBuilderEnded();
  listener.onBuilderEnded(this);
  if (!isEmpty()) {
    prepareAndCheck();
  }
  return (FinalSetOperationCriteriaBuilder<T>)(FinalSetOperationCriteriaBuilder)finalSetOperationBuilder;
}
Program: 168847
Project: 168847
Buggy source:
@Override @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public FinalSetOperationSubqueryBuilder<T> endSet(){
  subListener.verifySubqueryBuilderEnded();
  listener.onBuilderEnded(this);
  prepareAndCheck();
  return (FinalSetOperationSubqueryBuilder<T>)(FinalSetOperationSubqueryBuilder)finalSetOperationBuilder;
}

Fixed version (ground truth):
@Override @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public FinalSetOperationSubqueryBuilder<T> endSet(){
  subListener.verifySubqueryBuilderEnded();
  listener.onBuilderEnded(this);
  if (!isEmpty()) {
    prepareAndCheck();
  }
  return (FinalSetOperationSubqueryBuilder<T>)(FinalSetOperationSubqueryBuilder)finalSetOperationBuilder;
}
Program: 168848
Project: 168848
Buggy source:
public void bind(Query query,Collection<Object> value){
  Iterator<Object> iterator=value.iterator();
  for (int i=0; i < parameterNames.length; i++) {
    if (iterator.hasNext()) {
      Object element=iterator.next();
      for (int j=0; j < parameterNames[i].length; j++) {
        query.setParameter(parameterNames[i][j],pathExpressions[j].getValue(element));
      }
    }
 else {
      for (int j=0; j < parameterNames[i].length; j++) {
        query.setParameter(parameterNames[i][j],null);
      }
    }
  }
}

Fixed version (ground truth):
public void bind(Query query,Collection<Object> value){
  Iterator<Object> iterator=value.iterator();
  for (int i=0; i < parameterNames.length; i++) {
    Object element;
    if (iterator.hasNext() && (element=iterator.next()) != null) {
      for (int j=0; j < parameterNames[i].length; j++) {
        query.setParameter(parameterNames[i][j],pathExpressions[j].getValue(element));
      }
    }
 else {
      for (int j=0; j < parameterNames[i].length; j++) {
        query.setParameter(parameterNames[i][j],null);
      }
    }
  }
}
Program: 168849
Project: 168849
Buggy source:
public void setParameters(Query query,Object viewRootId){
  if (viewRootExpression != null) {
    query.setParameter(viewRootExpression,viewRootId);
    return;
  }
  if (viewRootParamName != null) {
    if (viewRootId instanceof Collection) {
      Collection<Object> paramCollection=(Collection<Object>)viewRootId;
      List<Object> viewRootEntities=new ArrayList<Object>(paramCollection.size());
      for (      Object paramValue : paramCollection) {
        if (paramValue != null) {
          viewRootEntities.add(criteriaBuilder.getEntityManager().getReference(viewRootEntityType,paramValue));
        }
      }
      query.setParameter(viewRootParamName,viewRootEntities);
    }
 else {
      Object viewRootEntity=criteriaBuilder.getEntityManager().getReference(viewRootEntityType,viewRootId);
      query.setParameter(viewRootParamName,viewRootEntity);
    }
  }
  if (viewRootIdParamName != null) {
    query.setParameter(viewRootIdParamName,viewRootId);
  }
}

Fixed version (ground truth):
public void setParameters(Query query,Object viewRootId){
  if (viewRootExpression != null) {
    query.setParameter(viewRootExpression,viewRootId);
    return;
  }
  if (viewRootParamName != null) {
    EntityManager em=criteriaBuilder.getEntityManager();
    if (viewRootId instanceof Collection) {
      Collection<Object> paramCollection=(Collection<Object>)viewRootId;
      List<Object> viewRootEntities=new ArrayList<Object>(paramCollection.size());
      for (      Object paramValue : paramCollection) {
        if (paramValue != null) {
          viewRootEntities.add(em.getReference(viewRootEntityType,paramValue));
        }
      }
      query.setParameter(viewRootParamName,viewRootEntities);
    }
 else {
      Object viewRootEntity=em.getReference(viewRootEntityType,viewRootId);
      query.setParameter(viewRootParamName,viewRootEntity);
    }
  }
  if (viewRootIdParamName != null) {
    query.setParameter(viewRootIdParamName,viewRootId);
  }
}
Program: 168851
Project: 168851
Buggy source:
JoinManager(MainQuery mainQuery,ResolvingQueryGenerator queryGenerator,AliasManager aliasManager,JoinManager parent,ExpressionFactory expressionFactory){
  super(queryGenerator,mainQuery.parameterManager,null);
  this.mainQuery=mainQuery;
  this.aliasManager=aliasManager;
  this.metamodel=mainQuery.metamodel;
  this.parent=parent;
  this.joinRestrictionKeyword="String_Node_Str" + mainQuery.jpaProvider.getOnClause() + "String_Node_Str";
  this.joinOnBuilderListener=new JoinOnBuilderEndedListener();
  this.subqueryInitFactory=new SubqueryInitiatorFactory(mainQuery,aliasManager,this);
  this.expressionFactory=expressionFactory;
}

Fixed version (ground truth):
JoinManager(MainQuery mainQuery,ResolvingQueryGenerator queryGenerator,AliasManager aliasManager,JoinManager parent,ExpressionFactory expressionFactory,JpaProvider jpaProvider){
  super(queryGenerator,mainQuery.parameterManager,null);
  this.mainQuery=mainQuery;
  this.aliasManager=aliasManager;
  this.metamodel=mainQuery.metamodel;
  this.parent=parent;
  this.joinRestrictionKeyword="String_Node_Str" + mainQuery.jpaProvider.getOnClause() + "String_Node_Str";
  this.joinOnBuilderListener=new JoinOnBuilderEndedListener();
  this.subqueryInitFactory=new SubqueryInitiatorFactory(mainQuery,aliasManager,this);
  this.expressionFactory=expressionFactory;
  this.jpaProvider=jpaProvider;
}
Program: 168852
Project: 168852
Buggy source:
@Override public EntityManagerFactory registerFunctions(EntityManagerFactory entityManagerFactory,Map<String,JpqlFunctionGroup> dbmsFunctions){
  DatabasePlatform platform=entityManagerFactory.unwrap(JpaEntityManagerFactory.class).getDatabaseSession().getPlatform();
  @SuppressWarnings("String_Node_Str") Map<Integer,ExpressionOperator> platformOperators=platform.getPlatformOperators();
  String dbms;
  if (platform.isMySQL()) {
    dbms="String_Node_Str";
  }
 else   if (platform.isOracle()) {
    dbms="String_Node_Str";
  }
 else   if (platform.isSQLServer()) {
    dbms="String_Node_Str";
  }
 else   if (platform.isSybase()) {
    dbms="String_Node_Str";
  }
 else {
    dbms=null;
  }
  for (  Map.Entry<String,JpqlFunctionGroup> functionEntry : dbmsFunctions.entrySet()) {
    String functionName=functionEntry.getKey();
    JpqlFunctionGroup dbmsFunctionMap=functionEntry.getValue();
    JpqlFunction function=dbmsFunctionMap.get(dbms);
    if (function == null) {
      function=dbmsFunctionMap.get(null);
    }
    if (function == null) {
      LOG.warning("String_Node_Str" + functionName + "String_Node_Str"+ dbms+ "String_Node_Str");
    }
 else {
      addFunction(platformOperators,functionName,function);
    }
  }
  return entityManagerFactory;
}

Fixed version (ground truth):
@Override public EntityManagerFactory registerFunctions(EntityManagerFactory entityManagerFactory,Map<String,JpqlFunctionGroup> dbmsFunctions){
  DatabasePlatform platform=entityManagerFactory.unwrap(JpaEntityManagerFactory.class).getDatabaseSession().getPlatform();
  @SuppressWarnings("String_Node_Str") Map<Integer,ExpressionOperator> platformOperators=platform.getPlatformOperators();
  String dbms;
  final String countStarName="String_Node_Str";
  if (!dbmsFunctions.containsKey(countStarName)) {
    JpqlFunctionGroup jpqlFunctionGroup=new JpqlFunctionGroup(countStarName,true);
    jpqlFunctionGroup.add(null,new CountStarFunction());
    dbmsFunctions.put(countStarName,jpqlFunctionGroup);
  }
  if (platform.isMySQL()) {
    dbms="String_Node_Str";
  }
 else   if (platform.isOracle()) {
    dbms="String_Node_Str";
  }
 else   if (platform.isSQLServer()) {
    dbms="String_Node_Str";
  }
 else   if (platform.isSybase()) {
    dbms="String_Node_Str";
  }
 else {
    dbms=null;
  }
  for (  Map.Entry<String,JpqlFunctionGroup> functionEntry : dbmsFunctions.entrySet()) {
    String functionName=functionEntry.getKey();
    JpqlFunctionGroup dbmsFunctionMap=functionEntry.getValue();
    JpqlFunction function=dbmsFunctionMap.get(dbms);
    if (function == null) {
      function=dbmsFunctionMap.get(null);
    }
    if (function == null) {
      LOG.warning("String_Node_Str" + functionName + "String_Node_Str"+ dbms+ "String_Node_Str");
    }
 else {
      addFunction(platformOperators,functionName,function);
    }
  }
  return entityManagerFactory;
}
Program: 168853
Project: 168853
Buggy source:
private void addFunction(Map<Integer,ExpressionOperator> platformOperators,String name,JpqlFunction function){
  ExpressionOperator operator=createOperator(name,function);
  ExpressionOperator.registerOperator(operator.getSelector(),name);
  ExpressionOperator.addOperator(operator);
  platformOperators.put(Integer.valueOf(operator.getSelector()),operator);
}

Fixed version (ground truth):
private void addFunction(Map<Integer,ExpressionOperator> platformOperators,String name,JpqlFunction function){
  ExpressionOperator operator=createOperator(name,function);
  ExpressionOperator.registerOperator(operator.getSelector(),operator.getName());
  ExpressionOperator.addOperator(operator);
  platformOperators.put(Integer.valueOf(operator.getSelector()),operator);
}
Program: 168854
Project: 168854
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private void prepare(List<Expression> items){
  EclipseLinkFunctionRenderContext context=new EclipseLinkFunctionRenderContext(items);
  function.render(context);
  setArgumentIndices(context.getArgumentIndices());
  printsAs(new Vector(context.getChunks()));
  if (context.isChunkFirst()) {
    bePrefix();
  }
 else {
    bePostfix();
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private void prepare(List<Expression> items){
  EclipseLinkFunctionRenderContext context;
  if (function.hasArguments()) {
    context=new EclipseLinkFunctionRenderContext(items);
  }
 else {
    if (items.size() > 1) {
      throw new IllegalStateException("String_Node_Str" + function.getClass() + "String_Node_Str"+ items.size()+ "String_Node_Str");
    }
    context=new EclipseLinkFunctionRenderContext(Collections.<Expression>emptyList());
  }
  function.render(context);
  setArgumentIndices(context.getArgumentIndices());
  printsAs(new Vector(context.getChunks()));
  if (context.isChunkFirst()) {
    bePrefix();
  }
 else {
    bePostfix();
  }
}
Program: 168855
Project: 168855
Buggy source:
@ManyToMany @CollectionTable(name="String_Node_Str",joinColumns={@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str")}) @MapKeyColumn(nullable=false,length=20) public Map<String,IntIdEntity> getManyToMany(){
  return manyToMany;
}

Fixed version (ground truth):
@ManyToMany @CollectionTable(name="String_Node_Str",joinColumns={@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str")}) @MapKeyColumn(name="String_Node_Str",nullable=false,length=20) public Map<String,IntIdEntity> getManyToMany(){
  return manyToMany;
}
Program: 168856
Project: 168856
Buggy source:
@Column(nullable=false,length=10) public String getSomeValue(){
  return someValue;
}

Fixed version (ground truth):
@Column(name="String_Node_Str",nullable=false,length=10) public String getSomeValue(){
  return someValue;
}
Program: 168857
Project: 168857
Buggy source:
@ManyToMany @MapKeyColumn(nullable=false,length=20) public Map<String,IntIdEntity> getManyToMany(){
  return manyToMany;
}

Fixed version (ground truth):
@ManyToMany @CollectionTable(name="String_Node_Str",joinColumns={@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str")}) @MapKeyColumn(name="String_Node_Str",nullable=false,length=20) public Map<String,IntIdEntity> getManyToMany(){
  return manyToMany;
}
Program: 168858
Project: 168858
Buggy source:
@ElementCollection @MapKeyColumn(nullable=false,length=20) public Map<String,NameObject> getElementCollection(){
  return elementCollection;
}

Fixed version (ground truth):
@ElementCollection @CollectionTable(name="String_Node_Str",joinColumns={@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str")}) @MapKeyColumn(name="String_Node_Str",nullable=false,length=20) public Map<String,NameObject> getElementCollection(){
  return elementCollection;
}
Program: 168859
Project: 168859
Buggy source:
@ManyToOne(fetch=FetchType.LAZY) public EmbeddableIdTestEntity getManyToOne(){
  return manyToOne;
}

Fixed version (ground truth):
@JoinColumns({@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str")}) @ManyToOne(fetch=FetchType.LAZY) public EmbeddableIdTestEntity getManyToOne(){
  return manyToOne;
}
Program: 168860
Project: 168860
Buggy source:
@ManyToOne(fetch=FetchType.LAZY,optional=false) public IntIdEntity getIntIdEntity(){
  return intIdEntity;
}

Fixed version (ground truth):
@ManyToOne(fetch=FetchType.LAZY,optional=false) @JoinColumn(name="String_Node_Str",nullable=false) public IntIdEntity getIntIdEntity(){
  return intIdEntity;
}
Program: 168861
Project: 168861
Buggy source:
@OneToMany public Set<EmbeddableIdTestEntity> getNestedOneToMany(){
  return nestedOneToMany;
}

Fixed version (ground truth):
@OneToMany @CollectionTable(name="String_Node_Str",joinColumns={@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str")}) public Set<EmbeddableIdTestEntity> getNestedOneToMany(){
  return nestedOneToMany;
}
Program: 168862
Project: 168862
Buggy source:
@ManyToOne(optional=false) public Person getOwner(){
  return owner;
}

Fixed version (ground truth):
@ManyToOne(optional=false,fetch=FetchType.LAZY) public Person getOwner(){
  return owner;
}
Program: 168863
Project: 168863
Buggy source:
@Test public void testSubqueryLimit(){
  CriteriaBuilder<Person> cb=cbf.create(em,Person.class,"String_Node_Str");
  cb.where("String_Node_Str").in().from(Person.class,"String_Node_Str").select("String_Node_Str").orderByAsc("String_Node_Str").setMaxResults(1).end().setMaxResults(1);
  String expected="String_Node_Str" + function("String_Node_Str","String_Node_Str" + renderNullPrecedence("String_Node_Str","String_Node_Str","String_Node_Str") + "String_Node_Str","String_Node_Str") + "String_Node_Str";
  assertEquals(expected,cb.getQueryString());
  List<Person> result=cb.getResultList();
  assertEquals(1,result.size());
  assertEquals("String_Node_Str",result.get(0).getName());
}

Fixed version (ground truth):
@Test public void testSubqueryLimit(){
  CriteriaBuilder<Person> cb=cbf.create(em,Person.class,"String_Node_Str");
  cb.where("String_Node_Str").in().from(Person.class,"String_Node_Str").select("String_Node_Str").orderByAsc("String_Node_Str").setMaxResults(1).end();
  String expected="String_Node_Str" + function("String_Node_Str","String_Node_Str" + renderNullPrecedence("String_Node_Str","String_Node_Str","String_Node_Str") + "String_Node_Str","String_Node_Str") + "String_Node_Str";
  assertEquals(expected,cb.getQueryString());
  List<Person> result=cb.getResultList();
  assertEquals(1,result.size());
  assertEquals("String_Node_Str",result.get(0).getName());
}
Program: 168864
Project: 168864
Buggy source:
@OneToMany @CollectionTable(name="String_Node_Str",joinColumns={@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str")}) public Set<EmbeddableTestEntity> getNestedOneToMany(){
  return nestedOneToMany;
}

Fixed version (ground truth):
@OneToMany @JoinTable(name="String_Node_Str",joinColumns={@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str")},inverseJoinColumns={@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str")}) public Set<EmbeddableTestEntity> getNestedOneToMany(){
  return nestedOneToMany;
}
Program: 168865
Project: 168865
Buggy source:
public Integer getNumber(){
  return number;
}

Fixed version (ground truth):
@Column(name="String_Node_Str") public Integer getNumber(){
  return number;
}
Program: 168866
Project: 168866
Buggy source:
public Integer getNumber(){
  return number;
}

Fixed version (ground truth):
@Column(name="String_Node_Str") public Integer getNumber(){
  return number;
}
Program: 168867
Project: 168867
Buggy source:
@OneToMany @CollectionTable(name="String_Node_Str",joinColumns={@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str")}) public Set<EmbeddableIdTestEntity> getNestedOneToMany(){
  return nestedOneToMany;
}

Fixed version (ground truth):
@OneToMany @JoinTable(name="String_Node_Str",joinColumns={@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str")},inverseJoinColumns={@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str"),@JoinColumn(name="String_Node_Str",referencedColumnName="String_Node_Str")}) public Set<EmbeddableIdTestEntity> getNestedOneToMany(){
  return nestedOneToMany;
}
Program: 168868
Project: 168868
Buggy source:
/** 
 * Returns the query roots.
 * @return The roots of this query
 * @since 1.2.0
 */
public Set<Root> getRoots();

Fixed version (ground truth):
/** 
 * Returns the query roots.
 * @return The roots of this query
 * @since 1.2.0
 */
public Set<From> getRoots();
Program: 168869
Project: 168869
Buggy source:
/** 
 * Returns the query root.
 * @return The root of this query
 * @since 1.2.0
 */
public Root getRoot();

Fixed version (ground truth):
/** 
 * Returns the query root.
 * @return The root of this query
 * @since 1.2.0
 */
public From getRoot();
Program: 168870
Project: 168870
Buggy source:
public Set<Root> getRoots(){
  return new LinkedHashSet<Root>(joinManager.getRoots());
}

Fixed version (ground truth):
public Set<From> getRoots(){
  return new LinkedHashSet<From>(joinManager.getRoots());
}
Program: 168871
Project: 168871
Buggy source:
public Root getRoot(){
  return joinManager.getRootNodeOrFail("String_Node_Str");
}

Fixed version (ground truth):
public From getRoot(){
  return joinManager.getRootNodeOrFail("String_Node_Str");
}
Program: 168873
Project: 168873
Buggy source:
private static Map.Entry<Root,String> findRoot(Set<Root> roots,String entityViewRoot){
  if (entityViewRoot == null || entityViewRoot.isEmpty()) {
    if (roots.size() > 1) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    return new AbstractMap.SimpleEntry<Root,String>(roots.iterator().next(),null);
  }
  if (roots.size() == 1) {
    Root r=roots.iterator().next();
    String alias=r.getAlias();
    if (entityViewRoot.startsWith(alias) && (entityViewRoot.length() == alias.length() || entityViewRoot.charAt(alias.length()) == '.')) {
      return new AbstractMap.SimpleEntry<Root,String>(r,entityViewRoot);
    }
 else {
      return new AbstractMap.SimpleEntry<Root,String>(r,alias + '.' + entityViewRoot);
    }
  }
  for (  Root r : roots) {
    String alias=r.getAlias();
    if (entityViewRoot.startsWith(alias) && (entityViewRoot.length() == alias.length() || entityViewRoot.charAt(alias.length()) == '.')) {
      return new AbstractMap.SimpleEntry<Root,String>(r,entityViewRoot);
    }
  }
  throw new IllegalArgumentException("String_Node_Str" + entityViewRoot + "String_Node_Str");
}

Fixed version (ground truth):
private static Map.Entry<From,String> findRoot(FullQueryBuilder<?,?> queryBuilder,String entityViewRoot){
  if (entityViewRoot == null || entityViewRoot.isEmpty()) {
    Set<From> roots=queryBuilder.getRoots();
    if (roots.size() > 1) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    return new AbstractMap.SimpleEntry<From,String>(roots.iterator().next(),null);
  }
  From candidate=queryBuilder.getFrom(entityViewRoot);
  if (candidate != null) {
    return new AbstractMap.SimpleEntry<From,String>(candidate,null);
  }
  Set<From> roots=queryBuilder.getRoots();
  if (roots.size() == 1) {
    From r=roots.iterator().next();
    String alias=r.getAlias();
    if (entityViewRoot.startsWith(alias) && (entityViewRoot.length() == alias.length() || entityViewRoot.charAt(alias.length()) == '.')) {
      return new AbstractMap.SimpleEntry<From,String>(r,entityViewRoot);
    }
 else {
      return new AbstractMap.SimpleEntry<From,String>(r,alias + '.' + entityViewRoot);
    }
  }
  for (  From r : roots) {
    String alias=r.getAlias();
    if (entityViewRoot.startsWith(alias) && (entityViewRoot.length() == alias.length() || entityViewRoot.charAt(alias.length()) == '.')) {
      return new AbstractMap.SimpleEntry<From,String>(r,entityViewRoot);
    }
  }
  throw new IllegalArgumentException("String_Node_Str" + entityViewRoot + "String_Node_Str");
}
Program: 168875
Project: 168875
Buggy source:
private String applyAndGetCorrelationRoot(){
  Class<?> viewRootEntityClass=viewRootType.getEntityClass();
  String idAttributePath=getEntityIdName(viewRootEntityClass);
  FullQueryBuilder<?,?> queryBuilder=entityViewConfiguration.getCriteriaBuilder();
  Map<String,Object> optionalParameters=entityViewConfiguration.getOptionalParameters();
  Class<?> correlationBasisEntityType=correlationBasisEntity;
  String viewRootExpression=viewRootAlias;
  this.criteriaBuilder=queryBuilder.copy(Object[].class);
  this.viewRootJpqlMacro=new CorrelatedSubqueryViewRootJpqlMacro(criteriaBuilder,optionalParameters,viewRootEntityClass,idAttributePath,viewRootExpression);
  this.criteriaBuilder.registerMacro("String_Node_Str",viewRootJpqlMacro);
  SubqueryCorrelationBuilder correlationBuilder=new SubqueryCorrelationBuilder(criteriaBuilder,correlationResult,correlationBasisType,correlationBasisEntityType,null,1);
  CorrelationProvider provider=correlationProviderFactory.create(entityViewConfiguration.getCriteriaBuilder(),entityViewConfiguration.getOptionalParameters());
  provider.applyCorrelation(correlationBuilder,correlationKeyExpression);
  return correlationBuilder.getCorrelationRoot();
}

Fixed version (ground truth):
private String applyAndGetCorrelationRoot(){
  Class<?> viewRootEntityClass=viewRootType.getEntityClass();
  String idAttributePath=getEntityIdName(viewRootEntityClass);
  FullQueryBuilder<?,?> queryBuilder=entityViewConfiguration.getCriteriaBuilder();
  Map<String,Object> optionalParameters=entityViewConfiguration.getOptionalParameters();
  Class<?> correlationBasisEntityType=correlationBasisEntity;
  String viewRootExpression=viewRootAlias;
  this.criteriaBuilder=queryBuilder.copy(Object[].class);
  this.viewRootJpqlMacro=new CorrelatedSubqueryViewRootJpqlMacro(criteriaBuilder,optionalParameters,viewRootEntityClass,idAttributePath,viewRootExpression);
  this.criteriaBuilder.registerMacro("String_Node_Str",viewRootJpqlMacro);
  SubqueryCorrelationBuilder correlationBuilder=new SubqueryCorrelationBuilder(criteriaBuilder,correlationResult,correlationBasisType,correlationBasisEntityType,null,1,true);
  CorrelationProvider provider=correlationProviderFactory.create(entityViewConfiguration.getCriteriaBuilder(),entityViewConfiguration.getOptionalParameters());
  provider.applyCorrelation(correlationBuilder,correlationKeyExpression);
  return correlationBuilder.getCorrelationRoot();
}
Program: 168876
Project: 168876
Buggy source:
@Override public JoinOnBuilder<ParameterHolder<?>> correlate(Class<?> entityClass,String alias){
  if (correlationRoot != null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  JoinOnBuilder<ParameterHolder<?>> correlationBuilder;
  if (batchSize > 1) {
    if (correlationBasisEntity != null) {
      criteriaBuilder.fromIdentifiableValues(correlationBasisEntity,correllationKeyAlias,batchSize);
    }
 else {
      criteriaBuilder.fromValues(correlationBasisType,correllationKeyAlias,batchSize);
    }
    correlationBuilder=(JoinOnBuilder<ParameterHolder<?>>)(JoinOnBuilder<?>)criteriaBuilder.innerJoinOn(entityClass,alias);
  }
 else {
    criteriaBuilder.from(entityClass,alias);
    correlationBuilder=criteriaBuilder.getService(JoinOnBuilder.class);
  }
  String correlationRoot;
  if (correlationResult.isEmpty()) {
    correlationRoot=alias;
  }
 else   if (correlationResult.startsWith(alias) && (correlationResult.length() == alias.length() || correlationResult.charAt(alias.length()) == '.')) {
    correlationRoot=correlationResult;
  }
 else {
    correlationRoot=alias + '.' + correlationResult;
  }
  this.correlationRoot=correlationRoot;
  return correlationBuilder;
}

Fixed version (ground truth):
@Override public JoinOnBuilder<ParameterHolder<?>> correlate(Class<?> entityClass,String alias){
  if (correlationRoot != null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  JoinOnBuilder<ParameterHolder<?>> correlationBuilder;
  if (batchSize > 1) {
    if (correlationBasisEntity != null) {
      criteriaBuilder.fromIdentifiableValues(correlationBasisEntity,correllationKeyAlias,batchSize);
    }
 else {
      criteriaBuilder.fromValues(correlationBasisType,correllationKeyAlias,batchSize);
    }
    correlationBuilder=(JoinOnBuilder<ParameterHolder<?>>)(JoinOnBuilder<?>)criteriaBuilder.innerJoinOn(entityClass,alias);
  }
 else {
    if (innerJoin) {
      correlationBuilder=(JoinOnBuilder<ParameterHolder<?>>)(JoinOnBuilder<?>)criteriaBuilder.innerJoinOn(entityClass,alias);
    }
 else {
      criteriaBuilder.from(entityClass,alias);
      correlationBuilder=criteriaBuilder.getService(JoinOnBuilder.class);
    }
  }
  String correlationRoot;
  if (correlationResult.isEmpty()) {
    correlationRoot=alias;
  }
 else   if (correlationResult.startsWith(alias) && (correlationResult.length() == alias.length() || correlationResult.charAt(alias.length()) == '.')) {
    correlationRoot=correlationResult;
  }
 else {
    correlationRoot=alias + '.' + correlationResult;
  }
  this.correlationRoot=correlationRoot;
  return correlationBuilder;
}
Program: 168877
Project: 168877
Buggy source:
public SubqueryCorrelationBuilder(FullQueryBuilder<?,?> criteriaBuilder,String correlationResult,Class<?> correlationBasisType,Class<?> correlationBasisEntity,String correllationKeyAlias,int batchSize){
  this.criteriaBuilder=criteriaBuilder;
  this.correlationResult=correlationResult;
  this.correlationBasisType=correlationBasisType;
  this.correlationBasisEntity=correlationBasisEntity;
  this.correllationKeyAlias=correllationKeyAlias;
  this.batchSize=batchSize;
}

Fixed version (ground truth):
public SubqueryCorrelationBuilder(FullQueryBuilder<?,?> criteriaBuilder,String correlationResult,Class<?> correlationBasisType,Class<?> correlationBasisEntity,String correllationKeyAlias,int batchSize,boolean innerJoin){
  this.criteriaBuilder=criteriaBuilder;
  this.correlationResult=correlationResult;
  this.correlationBasisType=correlationBasisType;
  this.correlationBasisEntity=correlationBasisEntity;
  this.correllationKeyAlias=correllationKeyAlias;
  this.batchSize=batchSize;
  this.innerJoin=innerJoin;
}
Program: 168878
Project: 168878
Buggy source:
@Test @Category({NoHibernate42.class,NoHibernate43.class,NoHibernate50.class,NoDatanucleus4.class,NoDatanucleus.class,NoOpenJPA.class}) public void testSubqueryBatchedCorrelationSize4(){
  testCorrelation(DocumentCorrelationViewSubquery.class,4);
}

Fixed version (ground truth):
@Test @Category({NoHibernate42.class,NoHibernate43.class,NoHibernate50.class,NoDatanucleus.class,NoOpenJPA.class}) public void testSubqueryBatchedCorrelationSize4(){
  testCorrelation(DocumentCorrelationViewSubquery.class,4);
}
Program: 168879
Project: 168879
Buggy source:
@Test public void testSubselectCorrelation(){
  testCorrelation(DocumentCorrelationViewSubselect.class,null);
}

Fixed version (ground truth):
@Test @Category({NoDatanucleus4.class}) public void testSubselectCorrelation(){
  testCorrelation(DocumentCorrelationViewSubselect.class,null);
}
Program: 168880
Project: 168880
Buggy source:
@Test @Category({NoHibernate42.class,NoHibernate43.class,NoHibernate50.class,NoDatanucleus4.class,NoOpenJPA.class}) public void testSubqueryCorrelation(){
  testCorrelation(DocumentCorrelationViewSubquery.class,null);
}

Fixed version (ground truth):
@Test @Category({NoDatanucleus4.class}) public void testSubqueryCorrelation(){
  testCorrelation(DocumentCorrelationViewSubquery.class,null);
}
Program: 168881
Project: 168881
Buggy source:
@Test @Category({NoHibernate42.class,NoHibernate43.class,NoHibernate50.class,NoDatanucleus4.class,NoDatanucleus.class,NoOpenJPA.class}) public void testSubqueryBatchedCorrelationSize20(){
  testCorrelation(DocumentCorrelationViewSubquery.class,20);
}

Fixed version (ground truth):
@Test @Category({NoHibernate42.class,NoHibernate43.class,NoHibernate50.class,NoDatanucleus.class,NoOpenJPA.class}) public void testSubqueryBatchedCorrelationSize20(){
  testCorrelation(DocumentCorrelationViewSubquery.class,20);
}
Program: 168882
Project: 168882
Buggy source:
@Test @Category({NoHibernate42.class,NoHibernate43.class,NoHibernate50.class,NoDatanucleus4.class,NoDatanucleus.class,NoOpenJPA.class}) public void testSubqueryBatchedCorrelationSize2(){
  testCorrelation(DocumentCorrelationViewSubquery.class,2);
}

Fixed version (ground truth):
@Test @Category({NoHibernate42.class,NoHibernate43.class,NoHibernate50.class,NoDatanucleus.class,NoOpenJPA.class}) public void testSubqueryBatchedCorrelationSize2(){
  testCorrelation(DocumentCorrelationViewSubquery.class,2);
}
Program: 168883
Project: 168883
Buggy source:
@ManyToOne(fetch=FetchType.LAZY) public PrimitiveDocument getParent(){
  return parent;
}

Fixed version (ground truth):
@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="String_Node_Str") public PrimitiveDocument getParent(){
  return parent;
}
Program: 168884
Project: 168884
Buggy source:
@OneToMany public Collection<PrimitivePerson> getPeopleCollectionBag(){
  return peopleCollectionBag;
}

Fixed version (ground truth):
@OneToMany @JoinTable(name="String_Node_Str") public Collection<PrimitivePerson> getPeopleCollectionBag(){
  return peopleCollectionBag;
}
Program: 168885
Project: 168885
Buggy source:
@OneToMany public List<PrimitivePerson> getPeopleListBag(){
  return peopleListBag;
}

Fixed version (ground truth):
@OneToMany @JoinTable(name="String_Node_Str") public List<PrimitivePerson> getPeopleListBag(){
  return peopleListBag;
}
Program: 168886
Project: 168886
Buggy source:
@ManyToOne(fetch=FetchType.LAZY) public PrimitiveDocument getPartnerDocument(){
  return partnerDocument;
}

Fixed version (ground truth):
@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="String_Node_Str") public PrimitiveDocument getPartnerDocument(){
  return partnerDocument;
}
Program: 168887
Project: 168887
Buggy source:
/** 
 * Like   {@link DbmsLimitHandler#applySql(String,boolean,Integer,Integer)} but inlines the parameter values.
 * @param sql    the sql query on which to apply
 * @param isSubquery whether the query is a subquery
 * @param limit  the limit or null
 * @param offset the offset or null
 * @return Query statement with LIMIT clause applied.
 */
String applySqlInlined(String sql,boolean isSubquery,Integer limit,Integer offset);

Fixed version (ground truth):
/** 
 * Like   {@link DbmsLimitHandler#applySql(String,boolean,Integer,Integer)} but inlines the parameter values.
 * @param sql    the sql query on which to apply
 * @param isSubquery whether the query is a subquery
 * @param limit  the limit or null
 * @param offset the offset or null
 * @return Query statement with LIMIT clause applied.
 */
public String applySqlInlined(String sql,boolean isSubquery,Integer limit,Integer offset);
Program: 168888
Project: 168888
Buggy source:
/** 
 * Bind parameter values needed by the LIMIT clause before original SELECT statement.
 * @param limit  the limit or null
 * @param offset the offset or null
 * @param statement the statement to which to apply parameters
 * @param index the index on which to bind parameters
 * @return The number of parameter values bound
 * @throws SQLException Indicates problems binding parameter values
 */
int bindLimitParametersAtStartOfQuery(Integer limit,Integer offset,PreparedStatement statement,int index) throws SQLException ;

Fixed version (ground truth):
/** 
 * Bind parameter values needed by the LIMIT clause before original SELECT statement.
 * @param limit  the limit or null
 * @param offset the offset or null
 * @param statement the statement to which to apply parameters
 * @param index the index on which to bind parameters
 * @return The number of parameter values bound
 * @throws SQLException Indicates problems binding parameter values
 */
public int bindLimitParametersAtStartOfQuery(Integer limit,Integer offset,PreparedStatement statement,int index) throws SQLException ;
Program: 168889
Project: 168889
Buggy source:
/** 
 * Bind parameter values needed by the LIMIT clause after original SELECT statement.
 * @param limit  the limit or null
 * @param offset the offset or null
 * @param statement the statement to which to apply parameters
 * @param index the index on which to bind parameters
 * @return The number of parameter values bound
 * @throws SQLException Indicates problems binding parameter values
 */
int bindLimitParametersAtEndOfQuery(Integer limit,Integer offset,PreparedStatement statement,int index) throws SQLException ;

Fixed version (ground truth):
/** 
 * Bind parameter values needed by the LIMIT clause after original SELECT statement.
 * @param limit  the limit or null
 * @param offset the offset or null
 * @param statement the statement to which to apply parameters
 * @param index the index on which to bind parameters
 * @return The number of parameter values bound
 * @throws SQLException Indicates problems binding parameter values
 */
public int bindLimitParametersAtEndOfQuery(Integer limit,Integer offset,PreparedStatement statement,int index) throws SQLException ;
Program: 168890
Project: 168890
Buggy source:
/** 
 * Apply the LIMIT and OFFSET clause on the given SQL
 * @param sqlSb  the string builder containing the sql query on which to apply
 * @param isSubquery whether the query is a subquery
 * @param limit  the limit value or null
 * @param offset the offset value or null
 * @return Query statement with LIMIT clause applied.
 */
void applySql(StringBuilder sqlSb,boolean isSubquery,String limit,String offset);

Fixed version (ground truth):
/** 
 * Apply the LIMIT and OFFSET clause on the given SQL
 * @param sqlSb  the string builder containing the sql query on which to apply
 * @param isSubquery whether the query is a subquery
 * @param limit  the limit value or null
 * @param offset the offset value or null
 * @return Query statement with LIMIT clause applied.
 */
public void applySql(StringBuilder sqlSb,boolean isSubquery,String limit,String offset);
Program: 168891
Project: 168891
Buggy source:
/** 
 * Use JDBC API to limit the number of rows returned by the SQL query. Typically handlers that do not support LIMIT clause should implement this method.
 * @param limit  the limit or null
 * @param offset the offset or null
 * @param statement the statement on which to apply max rows
 * @throws SQLException Indicates problems while limiting maximum rows returned
 */
void setMaxRows(Integer limit,Integer offset,PreparedStatement statement) throws SQLException ;

Fixed version (ground truth):
/** 
 * Use JDBC API to limit the number of rows returned by the SQL query. Typically handlers that do not support LIMIT clause should implement this method.
 * @param limit  the limit or null
 * @param offset the offset or null
 * @param statement the statement on which to apply max rows
 * @throws SQLException Indicates problems while limiting maximum rows returned
 */
public void setMaxRows(Integer limit,Integer offset,PreparedStatement statement) throws SQLException ;
Program: 168892
Project: 168892
Buggy source:
/** 
 * Returns whether the dbms supports OFFSET via SQL.
 * @return True if OFFSET is supported, otherwise false
 */
boolean supportsLimitOffset();

Fixed version (ground truth):
/** 
 * Returns whether the dbms supports OFFSET via SQL.
 * @return True if OFFSET is supported, otherwise false
 */
public boolean supportsLimitOffset();
Program: 168893
Project: 168893
Buggy source:
/** 
 * Returns whether the dbms supports LIMIT via SQL.
 * @return True if LIMIT is supported, otherwise false
 */
boolean supportsLimit();

Fixed version (ground truth):
/** 
 * Returns whether the dbms supports LIMIT via SQL.
 * @return True if LIMIT is supported, otherwise false
 */
public boolean supportsLimit();