nus-yam/ex-repair huggingface dataset:
Program: 65296
Project: 65296
Buggy source:
/** 
 * Validates the encapsulated expression of the given <code><b>LOCATE</b></code> expression. The test to perform is: <ul> <li>If the encapsulated expression is a path expression, validation makes sure it is a basic mapping, an association field is not allowed.</li> <li>If the encapsulated expression is not a path expression, validation will be redirected to that expression but the returned status will not be changed.</li> </ul>
 * @param expression The {@link LocateExpression} to validate by validating its encapsulated expression
 * @return TODO
 */
protected int validateLocateExpression(LocateExpression expression){
  int result=0;
  if (expression.hasFirstExpression()) {
    Expression firstExpression=expression.getFirstExpression();
    StateFieldPathExpression pathExpression=getStateFieldPathExpression(firstExpression);
    if (pathExpression != null) {
      boolean valid=validateStateFieldPathExpression(pathExpression,false);
      updateStatus(result,0,valid);
    }
 else {
      firstExpression.accept(this);
    }
  }
  expression.getSecondExpression().accept(this);
  expression.getThirdExpression().accept(this);
  return result;
}

Fixed version (ground truth):
/** 
 * Validates the encapsulated expression of the given <code><b>LOCATE</b></code> expression. The test to perform is: <ul> <li>If the encapsulated expression is a path expression, validation makes sure it is a basic mapping, an association field is not allowed.</li> <li>If the encapsulated expression is not a path expression, validation will be redirected to that expression but the returned status will not be changed.</li> </ul>
 * @param expression The {@link LocateExpression} to validate by validating its encapsulated expression
 * @return TODO
 */
protected int validateLocateExpression(LocateExpression expression){
  int result=0;
  if (expression.hasFirstExpression()) {
    Expression firstExpression=expression.getFirstExpression();
    StateFieldPathExpression pathExpression=getStateFieldPathExpression(firstExpression);
    if (pathExpression != null) {
      boolean valid=validateStateFieldPathExpression(pathExpression,PathType.BASIC_FIELD_ONLY);
      updateStatus(result,0,valid);
    }
 else {
      firstExpression.accept(this);
    }
  }
  expression.getSecondExpression().accept(this);
  expression.getThirdExpression().accept(this);
  return result;
}
Program: 65297
Project: 65297
Buggy source:
/** 
 * Validates the arithmetic factor expression. The test to perform is: <ul> <li>If the arithmetic factor is a path expression, validation makes sure it is a basic mapping, an association field is not allowed.</li> </ul>
 * @param expression The {@link ArithmeticFactor} to validate
 * @return <code>false</code> if the arithmetic factor expression was validated and is invalid;<code>true</code> otherwise
 */
protected boolean validateArithmeticExpression(ArithmeticFactor expression){
  boolean valid=true;
  if (expression.hasExpression()) {
    Expression factor=expression.getExpression();
    StateFieldPathExpression pathExpression=getStateFieldPathExpression(factor);
    if (pathExpression != null) {
      valid=validateStateFieldPathExpression(pathExpression,false);
    }
 else {
      factor.accept(this);
    }
  }
  return valid;
}

Fixed version (ground truth):
/** 
 * Validates the arithmetic factor expression. The test to perform is: <ul> <li>If the arithmetic factor is a path expression, validation makes sure it is a basic mapping, an association field is not allowed.</li> </ul>
 * @param expression The {@link ArithmeticFactor} to validate
 * @return <code>false</code> if the arithmetic factor expression was validated and is invalid;<code>true</code> otherwise
 */
protected boolean validateArithmeticExpression(ArithmeticFactor expression){
  boolean valid=true;
  if (expression.hasExpression()) {
    Expression factor=expression.getExpression();
    StateFieldPathExpression pathExpression=getStateFieldPathExpression(factor);
    if (pathExpression != null) {
      valid=validateStateFieldPathExpression(pathExpression,PathType.BASIC_FIELD_ONLY);
    }
 else {
      factor.accept(this);
    }
  }
  return valid;
}
Program: 65298
Project: 65298
Buggy source:
/** 
 * Validates the left and right expressions of the given comparison expression. The test to perform is: <ul> <li>If left or the right expressions are compared with [<, <=, >, >=] and it is a path expression, validation makes sure it is a basic mapping, an association field is not allowed.</li> </ul>
 * @param expression The {@link ConcatExpression} to validate by validating its left and rightexpressions
 * @return A number indicating the validation result:<ul> <li>0: Both expressions are valid or were not validated;</li> <li>1: Only the left expression is invalid;</li> <li>2: Only the right expression is invalid;</li> <li>3: Both expressions are invalid.</li> </ul>
 */
protected int validateComparisonExpression(ComparisonExpression expression){
  int result=0;
  if (expression.hasLeftExpression() && expression.hasRightExpression()) {
    String comparison=expression.getComparisonOperator();
    if (comparison == Expression.LOWER_THAN || comparison == Expression.GREATER_THAN || comparison == Expression.LOWER_THAN_OR_EQUAL || comparison == Expression.GREATER_THAN_OR_EQUAL) {
      result=validateFunctionPathExpression(expression);
    }
  }
  if (isValid(result,0)) {
    expression.getLeftExpression().accept(this);
  }
  if (isValid(result,1)) {
    expression.getRightExpression().accept(this);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Validates the left and right expressions of the given comparison expression. The test to perform is: <ul> <li>If left or the right expressions are compared with [<, <=, >, >=] and it is a path expression, validation makes sure it is a basic mapping, an association field is not allowed.</li> </ul>
 * @param expression The {@link ConcatExpression} to validate by validating its left and rightexpressions
 * @return A number indicating the validation result:<ul> <li>0: Both expressions are valid or were not validated;</li> <li>1: Only the left expression is invalid;</li> <li>2: Only the right expression is invalid;</li> <li>3: Both expressions are invalid.</li> </ul>
 */
protected int validateComparisonExpression(ComparisonExpression expression){
  int result=0;
  if (expression.hasLeftExpression() && expression.hasRightExpression()) {
    String comparison=expression.getComparisonOperator();
    if (comparison == Expression.LOWER_THAN || comparison == Expression.GREATER_THAN || comparison == Expression.LOWER_THAN_OR_EQUAL || comparison == Expression.GREATER_THAN_OR_EQUAL) {
      result=validateFunctionPathExpression(expression,PathType.ANY_FIELD);
    }
  }
  if (isValid(result,0)) {
    expression.getLeftExpression().accept(this);
  }
  if (isValid(result,1)) {
    expression.getRightExpression().accept(this);
  }
  return result;
}
Program: 65299
Project: 65299
Buggy source:
/** 
 * Validates the string expression of the given <code><b>LIKE</b></code> expression. The test to perform is: <ul> <li>If the string expression is a path expression, validation makes sure it is a basic mapping, an association field is not allowed.</li> <li>If the encapsulated expression is not a path expression, validation will be redirected to that expression but the returned status will not be changed.</li> </ul>
 * @param expression The {@link LengthExpression} to validate by validating its string expression
 * @return <code>false</code> if the encapsulated expression was validated and is invalid;<code>true</code> otherwise
 */
protected int validateLikeExpression(LikeExpression expression){
  int result=0;
  if (expression.hasStringExpression()) {
    Expression stringExpression=expression.getStringExpression();
    StateFieldPathExpression pathExpression=getStateFieldPathExpression(stringExpression);
    if (pathExpression != null) {
      boolean valid=validateStateFieldPathExpression(pathExpression,false);
      updateStatus(result,0,valid);
    }
 else {
      stringExpression.accept(this);
    }
  }
  expression.getPatternValue().accept(this);
  expression.getEscapeCharacter().accept(this);
  return result;
}

Fixed version (ground truth):
/** 
 * Validates the string expression of the given <code><b>LIKE</b></code> expression. The test to perform is: <ul> <li>If the string expression is a path expression, validation makes sure it is a basic mapping, an association field is not allowed.</li> <li>If the encapsulated expression is not a path expression, validation will be redirected to that expression but the returned status will not be changed.</li> </ul>
 * @param expression The {@link LengthExpression} to validate by validating its string expression
 * @return <code>false</code> if the encapsulated expression was validated and is invalid;<code>true</code> otherwise
 */
protected int validateLikeExpression(LikeExpression expression){
  int result=0;
  if (expression.hasStringExpression()) {
    Expression stringExpression=expression.getStringExpression();
    StateFieldPathExpression pathExpression=getStateFieldPathExpression(stringExpression);
    if (pathExpression != null) {
      boolean valid=validateStateFieldPathExpression(pathExpression,PathType.BASIC_FIELD_ONLY);
      updateStatus(result,0,valid);
    }
 else {
      stringExpression.accept(this);
    }
  }
  expression.getPatternValue().accept(this);
  expression.getEscapeCharacter().accept(this);
  return result;
}
Program: 65300
Project: 65300
Buggy source:
/** 
 * Validates the given   {@link CollectionMemberExpression}. Only the collection-valued path expression is validated.
 * @param expression The {@link CollectionMemberExpression} to validate
 * @return TODO
 */
protected int validateCollectionMemberExpression(CollectionMemberExpression expression){
  int result=0;
  if (expression.hasEntityExpression()) {
    Expression entityExpression=expression.getEntityExpression();
    StateFieldPathExpression pathExpression=getStateFieldPathExpression(entityExpression);
    if (pathExpression != null) {
      boolean valid=validateStateFieldPathExpression(pathExpression,true);
      updateStatus(result,0,valid);
    }
 else {
      entityExpression.accept(this);
    }
  }
  boolean valid=validateCollectionValuedPathExpression(expression.getCollectionValuedPathExpression(),true);
  updateStatus(result,1,valid);
  return result;
}

Fixed version (ground truth):
/** 
 * Validates the given   {@link CollectionMemberExpression}. Only the collection-valued path expression is validated.
 * @param expression The {@link CollectionMemberExpression} to validate
 * @return TODO
 */
protected int validateCollectionMemberExpression(CollectionMemberExpression expression){
  int result=0;
  if (expression.hasEntityExpression()) {
    Expression entityExpression=expression.getEntityExpression();
    StateFieldPathExpression pathExpression=getStateFieldPathExpression(entityExpression);
    if (pathExpression != null) {
      boolean valid=validateStateFieldPathExpression(pathExpression,PathType.ASSOCIATION_FIELD_ONLY);
      updateStatus(result,0,valid);
    }
 else {
      entityExpression.accept(this);
    }
  }
  boolean valid=validateCollectionValuedPathExpression(expression.getCollectionValuedPathExpression(),true);
  updateStatus(result,1,valid);
  return result;
}
Program: 65301
Project: 65301
Buggy source:
/** 
 * Validates the left and right expressions of the given compound expression. The test to perform is: <ul> <li>If the left or the right expression is a path expression, validation makes sure it is a basic mapping, an association field is not allowed.</li> </ul>
 * @param expression The {@link CompoundExpression} to validate by validating its left and rightexpressions
 * @return A number indicating the validation result:<ul> <li>0: Both expressions are valid or were not validated;</li> <li>1: Only the left expression is invalid;</li> <li>2: Only the right expression is invalid;</li> <li>3: Both expressions are invalid.</li> </ul>
 */
protected int validateFunctionPathExpression(CompoundExpression expression){
  int result=0;
  if (expression.hasLeftExpression()) {
    StateFieldPathExpression pathExpression=getStateFieldPathExpression(expression.getLeftExpression());
    if (pathExpression != null) {
      boolean valid=validateStateFieldPathExpression(pathExpression,false);
      updateStatus(result,0,valid);
    }
  }
  if (expression.hasRightExpression()) {
    StateFieldPathExpression pathExpression=getStateFieldPathExpression(expression.getRightExpression());
    if (pathExpression != null) {
      boolean valid=validateStateFieldPathExpression(pathExpression,false);
      updateStatus(result,1,valid);
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Validates the left and right expressions of the given compound expression. The test to perform is: <ul> <li>If the left or the right expression is a path expression, validation makes sure it is a basic mapping, an association field is not allowed.</li> </ul>
 * @param expression The {@link CompoundExpression} to validate by validating its left and rightexpressions
 * @return A number indicating the validation result:<ul> <li>0: Both expressions are valid or were not validated;</li> <li>1: Only the left expression is invalid;</li> <li>2: Only the right expression is invalid;</li> <li>3: Both expressions are invalid.</li> </ul>
 */
protected int validateFunctionPathExpression(CompoundExpression expression,PathType pathType){
  int result=0;
  if (expression.hasLeftExpression()) {
    StateFieldPathExpression pathExpression=getStateFieldPathExpression(expression.getLeftExpression());
    if (pathExpression != null) {
      boolean valid=validateStateFieldPathExpression(pathExpression,pathType);
      updateStatus(result,0,valid);
    }
  }
  if (expression.hasRightExpression()) {
    StateFieldPathExpression pathExpression=getStateFieldPathExpression(expression.getRightExpression());
    if (pathExpression != null) {
      boolean valid=validateStateFieldPathExpression(pathExpression,pathType);
      updateStatus(result,1,valid);
    }
  }
  return result;
}
Program: 65302
Project: 65302
Buggy source:
/** 
 * Validates the encapsulated expression of the given <code><b>MOD</b></code> expression. The test to perform is: <ul> <li>If the encapsulated expression is a path expression, validation makes sure it is a basic mapping, an association field is not allowed.</li> <li>If the encapsulated expression is not a path expression, validation will be redirected to that expression but the returned status will not be changed.</li> </ul>
 * @param expression The {@link ModExpression} to validate by validating its encapsulated expression
 * @return TODO
 */
protected int validateModExpression(ModExpression expression){
  int result=0;
  if (expression.hasFirstExpression()) {
    Expression firstExpression=expression.getFirstExpression();
    StateFieldPathExpression pathExpression=getStateFieldPathExpression(firstExpression);
    if (pathExpression != null) {
      boolean valid=validateStateFieldPathExpression(pathExpression,false);
      updateStatus(result,0,valid);
    }
 else {
      firstExpression.accept(this);
    }
  }
  expression.getSecondExpression().accept(this);
  return result;
}

Fixed version (ground truth):
/** 
 * Validates the encapsulated expression of the given <code><b>MOD</b></code> expression. The test to perform is: <ul> <li>If the encapsulated expression is a path expression, validation makes sure it is a basic mapping, an association field is not allowed.</li> <li>If the encapsulated expression is not a path expression, validation will be redirected to that expression but the returned status will not be changed.</li> </ul>
 * @param expression The {@link ModExpression} to validate by validating its encapsulated expression
 * @return TODO
 */
protected int validateModExpression(ModExpression expression){
  int result=0;
  if (expression.hasFirstExpression()) {
    Expression firstExpression=expression.getFirstExpression();
    StateFieldPathExpression pathExpression=getStateFieldPathExpression(firstExpression);
    if (pathExpression != null) {
      boolean valid=validateStateFieldPathExpression(pathExpression,PathType.BASIC_FIELD_ONLY);
      updateStatus(result,0,valid);
    }
 else {
      firstExpression.accept(this);
    }
  }
  expression.getSecondExpression().accept(this);
  return result;
}
Program: 65304
Project: 65304
Buggy source:
public void testSchemaGenTransient() throws Exception {
  JAXBException e=null;
  try {
    JAXBContext jaxbContext=JAXBContext.newInstance(TransientCar.class,Mazda.class);
  }
 catch (  javax.xml.bind.JAXBException ex) {
    e=(JAXBException)ex.getCause();
    assertTrue("String_Node_Str" + ex.getMessage(),e.getErrorCode() == JAXBException.DUPLICATE_PROPERTY_NAME);
  }
  if (e == null) {
    fail("String_Node_Str");
  }
}

Fixed version (ground truth):
public void testSchemaGenTransient() throws Exception {
  JAXBException e=null;
  try {
    JAXBContext jaxbContext=JAXBContext.newInstance(TransientCar.class,Mazda.class);
  }
 catch (  javax.xml.bind.JAXBException ex) {
    e=(JAXBException)ex.getCause();
    fail("String_Node_Str");
  }
}
Program: 65306
Project: 65306
Buggy source:
/** 
 * Put a Property in the Map of Properties for this TypeInfo. Here, the original property is put in the originalProperties map, the  properties map, and the propertyList list.  It is assumed that the originalProperties map will remain unchanged during processing.
 */
public void addProperty(String name,Property property){
  if (originalProperties.get(name) != null) {
    Property existingProperty=originalProperties.get(name);
    if (existingProperty.isTransient() && property.isTransient()) {
      if (this.getXmlAccessType().equals(XmlAccessType.FIELD)) {
        if (!property.isMethodProperty()) {
          propertyList.remove(existingProperty);
        }
 else {
          return;
        }
      }
 else {
        if (property.isMethodProperty()) {
          propertyList.remove(existingProperty);
        }
 else {
          return;
        }
      }
    }
 else     if (existingProperty.isTransient()) {
      propertyList.remove(existingProperty);
    }
 else     if (property.isTransient()) {
      return;
    }
 else {
      throw org.eclipse.persistence.exceptions.JAXBException.duplicatePropertyName(name,this.getJavaClassName());
    }
  }
  originalProperties.put(name,property);
  properties.put(name,property);
  propertyNames.add(name);
  propertyList.add(property);
}

Fixed version (ground truth):
/** 
 * Put a Property in the Map of Properties for this TypeInfo. Here, the original property is put in the originalProperties map, the  properties map, and the propertyList list.  It is assumed that the originalProperties map will remain unchanged during processing.
 */
public void addProperty(String name,Property property){
  if (originalProperties.get(name) != null) {
    Property existingProperty=originalProperties.get(name);
    if (existingProperty.isTransient() && property.isTransient()) {
      if (this.getXmlAccessType().equals(XmlAccessType.FIELD)) {
        if (!property.isMethodProperty()) {
          propertyList.remove(existingProperty);
          propertyNames.remove(name);
        }
 else {
          return;
        }
      }
 else {
        if (property.isMethodProperty()) {
          propertyList.remove(existingProperty);
          propertyNames.remove(name);
        }
 else {
          return;
        }
      }
    }
 else     if (existingProperty.isTransient() || existingProperty.isSuperClassProperty()) {
      propertyList.remove(existingProperty);
      propertyNames.remove(name);
    }
 else     if (property.isTransient()) {
      return;
    }
 else {
      throw org.eclipse.persistence.exceptions.JAXBException.duplicatePropertyName(name,this.getJavaClassName());
    }
  }
  originalProperties.put(name,property);
  properties.put(name,property);
  propertyNames.add(name);
  propertyList.add(property);
}
Program: 65307
Project: 65307
Buggy source:
/** 
 * This method will append the union clause to the end of the select statement.
 */
public void appendUnionClauseToWriter(ExpressionSQLPrinter printer) throws IOException {
  if (!hasUnionExpressions()) {
    return;
  }
  for (Iterator expressionsEnum=getUnionExpressions().iterator(); expressionsEnum.hasNext(); ) {
    Expression expression=(Expression)expressionsEnum.next();
    printer.getWriter().write("String_Node_Str");
    expression.printSQL(printer);
  }
}

Fixed version (ground truth):
/** 
 * This method will append the union clause to the end of the select statement.
 */
public void appendUnionClauseToWriter(ExpressionSQLPrinter printer) throws IOException {
  if (!hasUnionExpressions()) {
    return;
  }
  for (Iterator expressionsEnum=getUnionExpressions().iterator(); expressionsEnum.hasNext(); ) {
    Expression expression=(Expression)expressionsEnum.next();
    printer.getWriter().write("String_Node_Str");
    expression.printSQL(printer);
    printer.printString("String_Node_Str");
  }
}
Program: 65310
Project: 65310
Buggy source:
/** 
 * INTERNAL: Return true if the query uses default properties. This is used to determine if this query is cacheable. i.e. does not use any properties that may conflict with another query with the same JPQL or selection criteria.
 */
@Override public boolean isDefaultPropertiesQuery(){
  return super.isDefaultPropertiesQuery() && (!this.isResultSetOptimizedQuery) && (isDefaultLock())&& (!isDistinctComputed())&& (!hasAdditionalFields())&& (!hasPartialAttributeExpressions())&& (!hasUnionExpressions())&& (!hasNonFetchJoinedAttributeExpressions())&& (this.fetchGroup == null)&& (this.fetchGroupName == null)&& (this.shouldUseDefaultFetchGroup);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return true if the query uses default properties. This is used to determine if this query is cacheable. i.e. does not use any properties that may conflict with another query with the same JPQL or selection criteria.
 */
@Override public boolean isDefaultPropertiesQuery(){
  return super.isDefaultPropertiesQuery() && (!this.isResultSetOptimizedQuery) && (isDefaultLock())&& (!hasAdditionalFields())&& (!hasPartialAttributeExpressions())&& (!hasUnionExpressions())&& (!hasNonFetchJoinedAttributeExpressions())&& (this.fetchGroup == null)&& (this.fetchGroupName == null)&& (this.shouldUseDefaultFetchGroup);
}
Program: 65311
Project: 65311
Buggy source:
/** 
 * INTERNAL: Copy all setting from the query. This is used to morph queries from one type to the other. By default this calls prepareFromQuery, but additional properties may be required to be copied as prepareFromQuery only copies properties that affect the SQL.
 */
@Override public void copyFromQuery(DatabaseQuery query){
  super.copyFromQuery(query);
  if (query.isObjectLevelReadQuery()) {
    ObjectLevelReadQuery readQuery=(ObjectLevelReadQuery)query;
    this.cacheUsage=readQuery.cacheUsage;
    this.isReadOnly=readQuery.isReadOnly;
    this.isResultSetOptimizedQuery=readQuery.isResultSetOptimizedQuery;
    this.shouldIncludeData=readQuery.shouldIncludeData;
    this.inMemoryQueryIndirectionPolicy=readQuery.inMemoryQueryIndirectionPolicy;
    this.lockModeType=readQuery.lockModeType;
    this.defaultBuilder=readQuery.defaultBuilder;
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Copy all setting from the query. This is used to morph queries from one type to the other. By default this calls prepareFromQuery, but additional properties may be required to be copied as prepareFromQuery only copies properties that affect the SQL.
 */
@Override public void copyFromQuery(DatabaseQuery query){
  super.copyFromQuery(query);
  if (query.isObjectLevelReadQuery()) {
    ObjectLevelReadQuery readQuery=(ObjectLevelReadQuery)query;
    this.cacheUsage=readQuery.cacheUsage;
    this.isReadOnly=readQuery.isReadOnly;
    this.isResultSetOptimizedQuery=readQuery.isResultSetOptimizedQuery;
    this.shouldIncludeData=readQuery.shouldIncludeData;
    this.inMemoryQueryIndirectionPolicy=readQuery.inMemoryQueryIndirectionPolicy;
    this.lockModeType=readQuery.lockModeType;
    this.defaultBuilder=readQuery.defaultBuilder;
    this.distinctState=readQuery.distinctState;
  }
}
Program: 65312
Project: 65312
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  return suite;
}
Program: 65317
Project: 65317
Buggy source:
public void buildOROXProjects(NamingConventionTransformer nct);

Fixed version (ground truth):
public void buildOROXProjects(NamingConventionTransformer nct,List<CompositeDatabaseType> types);
Program: 65318
Project: 65318
Buggy source:
/** 
 * Indicates if a given ArgumentType is considered 'complex', i.e. it has a data type that is one of PLSQLRecordType, PLSQLCollectionType, VArrayType, ObjectType, or NestedTableType
 */
public static boolean isArgComplex(ArgumentType argument){
  DatabaseType argType=argument.getEnclosedType();
  return argType.isPLSQLType() || (argType.isPLSQLCursorType() && !((PLSQLCursorType)argType).isWeaklyTyped()) || argType.isVArrayType()|| argType.isObjectType()|| argType.isObjectTableType();
}

Fixed version (ground truth):
/** 
 * Indicates if a given ArgumentType is considered 'complex', i.e. it has a data type that is one of PLSQLRecordType, PLSQLCollectionType, VArrayType, ObjectType, or NestedTableType
 */
public static boolean isArgComplex(ArgumentType argument){
  return isTypeComplex(argument.getEnclosedType());
}
Program: 65320
Project: 65320
Buggy source:
private void addSimpleAttribute(List attributes,String uri,String attributeLocalName,Tree childValueTree){
switch (childValueTree.getType()) {
case JSONLexer.STRING:
{
      String stringValue=childValueTree.getChild(0).getText();
      attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,stringValue.substring(1,stringValue.length() - 1)));
      break;
    }
case JSONLexer.NUMBER:
{
    attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,childValueTree.getChild(0).getText()));
    break;
  }
case JSONLexer.TRUE:
{
  attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,TRUE));
  break;
}
case JSONLexer.FALSE:
{
attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,FALSE));
break;
}
case JSONLexer.NULL:
{
attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,XMLConstants.EMPTY_STRING));
break;
}
}
}

Fixed version (ground truth):
private void addSimpleAttribute(List attributes,String uri,String attributeLocalName,Tree childValueTree){
switch (childValueTree.getType()) {
case JSONLexer.STRING:
{
      String stringValue=JSONReader.string(childValueTree.getChild(0).getText());
      attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,stringValue));
      break;
    }
case JSONLexer.NUMBER:
{
    attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,childValueTree.getChild(0).getText()));
    break;
  }
case JSONLexer.TRUE:
{
  attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,TRUE));
  break;
}
case JSONLexer.FALSE:
{
attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,FALSE));
break;
}
case JSONLexer.NULL:
{
attributes.add(new Attribute(uri,attributeLocalName,attributeLocalName,XMLConstants.EMPTY_STRING));
break;
}
}
}
Program: 65321
Project: 65321
Buggy source:
private String string(String string){
  string=string.substring(1,string.length() - 1);
  String returnString="String_Node_Str";
  int slashIndex=string.indexOf('\\');
  if (slashIndex == -1) {
    return string;
  }
  int position=0;
  while (slashIndex > -1) {
    String subString=string.substring(position,slashIndex);
    returnString+=subString;
    position=slashIndex;
    char nextChar=string.charAt(slashIndex + 1);
switch (nextChar) {
case 'b':
{
        position+=2;
        returnString+='\b';
        break;
      }
case 'r':
{
      position+=2;
      returnString+='\r';
      break;
    }
case 'f':
{
    position+=2;
    returnString+='\f';
    break;
  }
case 'n':
{
  position+=2;
  returnString+='\n';
  break;
}
case 't':
{
position+=2;
returnString+='\t';
break;
}
case '"':
{
position+=2;
returnString+='"';
break;
}
case '\\':
{
position+=2;
returnString+='\\';
break;
}
case '/':
{
position+=2;
returnString+='/';
break;
}
case 'u':
{
position+=6;
String hexValue=string.substring(slashIndex + 2,slashIndex + 6);
returnString+=Character.toString((char)Integer.parseInt(hexValue,16));
break;
}
}
slashIndex=string.indexOf('\\',position);
}
if (position < string.length()) {
String subString=string.substring(position,string.length());
returnString+=subString;
}
return returnString;
}

Fixed version (ground truth):
private static String string(String string){
  string=string.substring(1,string.length() - 1);
  String returnString="String_Node_Str";
  int slashIndex=string.indexOf('\\');
  if (slashIndex == -1) {
    return string;
  }
  int position=0;
  while (slashIndex > -1) {
    String subString=string.substring(position,slashIndex);
    returnString+=subString;
    position=slashIndex;
    char nextChar=string.charAt(slashIndex + 1);
switch (nextChar) {
case 'b':
{
        position+=2;
        returnString+='\b';
        break;
      }
case 'r':
{
      position+=2;
      returnString+='\r';
      break;
    }
case 'f':
{
    position+=2;
    returnString+='\f';
    break;
  }
case 'n':
{
  position+=2;
  returnString+='\n';
  break;
}
case 't':
{
position+=2;
returnString+='\t';
break;
}
case '"':
{
position+=2;
returnString+='"';
break;
}
case '\\':
{
position+=2;
returnString+='\\';
break;
}
case '/':
{
position+=2;
returnString+='/';
break;
}
case 'u':
{
position+=6;
String hexValue=string.substring(slashIndex + 2,slashIndex + 6);
returnString+=Character.toString((char)Integer.parseInt(hexValue,16));
break;
}
}
slashIndex=string.indexOf('\\',position);
}
if (position < string.length()) {
String subString=string.substring(position,string.length());
returnString+=subString;
}
return returnString;
}
Program: 65322
Project: 65322
Buggy source:
public JSONReader(String attrPrefix,NamespaceResolver nr,boolean namespaceAware,boolean includeRoot,char namespaceSeparator){
  this.attributePrefix=attrPrefix;
  if (attributePrefix == XMLConstants.EMPTY_STRING) {
    attributePrefix=null;
  }
  namespaces=nr;
  this.namespaceAware=namespaceAware;
  this.namespaceSeparator=namespaceSeparator;
  this.includeRoot=includeRoot;
}

Fixed version (ground truth):
private JSONReader(String attrPrefix,NamespaceResolver nr,boolean namespaceAware,boolean includeRoot,char namespaceSeparator,ErrorHandler errorHandler){
  this.attributePrefix=attrPrefix;
  if (attributePrefix == XMLConstants.EMPTY_STRING) {
    attributePrefix=null;
  }
  namespaces=nr;
  this.namespaceAware=namespaceAware;
  this.namespaceSeparator=namespaceSeparator;
  this.includeRoot=includeRoot;
  this.setErrorHandler(errorHandler);
}
Program: 65327
Project: 65327
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(DateAndTimeTestCases.class);
  suite.addTestSuite(QNameTestCases.class);
  suite.addTestSuite(Base64TestCases.class);
  suite.addTestSuite(ListTestCases.class);
  suite.addTestSuite(DoubleToBigDecimalTestCases.class);
  suite.addTestSuite(XMLGregorianCalendarTestCases.class);
  suite.addTestSuite(NumberTestCases.class);
  suite.addTestSuite(BooleanTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(DateAndTimeTestCases.class);
  suite.addTestSuite(QNameTestCases.class);
  suite.addTestSuite(Base64TestCases.class);
  suite.addTestSuite(ListTestCases.class);
  suite.addTestSuite(DoubleToBigDecimalTestCases.class);
  suite.addTestSuite(XMLGregorianCalendarTestCases.class);
  suite.addTestSuite(NumberTestCases.class);
  suite.addTestSuite(BooleanTestCases.class);
  suite.addTestSuite(UrlTestCases.class);
  return suite;
}
Program: 65329
Project: 65329
Buggy source:
/** 
 * Build and return a Result instance based on a given ProcedureType and return type name.
 */
protected Result buildResultForStoredFunction(ProcedureType storedProcedure,String returnType){
  Result result=null;
  FunctionType storedFunction=(FunctionType)storedProcedure;
  ArgumentType rarg=storedFunction.getReturnArgument();
  DatabaseType rargDataType=rarg.getEnclosedType();
  if (rarg.getTypeName().contains(CURSOR_STR)) {
    result=new CollectionResult();
    result.setType(SXF_QNAME_CURSOR);
  }
 else {
    result=new Result();
    int rargJdbcType=OTHER;
    if (rargDataType.isComposite()) {
      if (rargDataType.isObjectType()) {
        rargJdbcType=STRUCT;
      }
 else       if (rargDataType.isVArrayType() || rargDataType.isObjectTableType()) {
        rargJdbcType=ARRAY;
      }
    }
 else {
      rargJdbcType=Util.getJDBCTypeFromTypeName(rarg.getTypeName());
    }
switch (rargJdbcType) {
case OTHER:
      if (returnType == null) {
        returnType=rarg.getTypeName();
      }
    String packageName=storedProcedure.getCatalogName();
  String returnTypeName=(packageName != null && packageName.length() > 0) ? packageName + UNDERSCORE + returnType : returnType;
result.setType(buildCustomQName(returnTypeName,dbwsBuilder));
break;
case STRUCT:
case ARRAY:
if (returnType != null) {
result.setType(buildCustomQName(returnType,dbwsBuilder));
}
 else {
result.setType(ANY_QNAME);
}
break;
default :
result.setType(getXMLTypeFromJDBCType(rargJdbcType));
break;
}
}
return result;
}

Fixed version (ground truth):
/** 
 * Build and return a Result instance based on a given ProcedureType and return type name.
 */
protected Result buildResultForStoredFunction(ProcedureType storedProcedure,String returnType){
  Result result=null;
  FunctionType storedFunction=(FunctionType)storedProcedure;
  ArgumentType rarg=storedFunction.getReturnArgument();
  DatabaseType rargDataType=rarg.getEnclosedType();
  if (rarg.getTypeName().contains(CURSOR_STR)) {
    result=new CollectionResult();
    result.setType(SXF_QNAME_CURSOR);
  }
 else {
    result=new Result();
    int rargJdbcType=OTHER;
    if (rargDataType.isComposite()) {
      if (rargDataType.isObjectType()) {
        rargJdbcType=STRUCT;
      }
 else       if (rargDataType.isVArrayType() || rargDataType.isObjectTableType()) {
        rargJdbcType=ARRAY;
      }
    }
 else {
      rargJdbcType=Util.getJDBCTypeFromTypeName(rarg.getTypeName());
    }
switch (rargJdbcType) {
case OTHER:
      if (returnType == null || returnType.length() == 0) {
        returnType=rargDataType.getTypeName();
      }
    String packageName=storedProcedure.getCatalogName();
  String returnTypeName=(packageName != null && packageName.length() > 0) ? packageName + UNDERSCORE + returnType : returnType;
result.setType(buildCustomQName(returnTypeName,dbwsBuilder));
break;
case STRUCT:
case ARRAY:
if (returnType == null || returnType.length() == 0) {
returnType=rargDataType.getTypeName().toLowerCase().concat(TYPE_STR);
}
result.setType(buildCustomQName(returnType,dbwsBuilder));
break;
default :
result.setType(getXMLTypeFromJDBCType(rargJdbcType));
break;
}
}
return result;
}
Program: 65330
Project: 65330
Buggy source:
/** 
 * INTERNAL:
 */
protected void writeValue(String value,boolean isAttribute,Writer writer){
  CharacterEscapeHandler escapeHandler=null;
  if (marshaller != null) {
    escapeHandler=marshaller.getCharacterEscapeHandler();
  }
  if (escapeHandler != null) {
    try {
      escapeHandler.escape(value.toCharArray(),0,value.length(),isAttribute,writer);
    }
 catch (    IOException e) {
      throw XMLMarshalException.marshalException(e);
    }
    return;
  }
  try {
    if (encoder.maxBytesPerChar() < 4 || value.indexOf('"') > -1 || value.indexOf('&') > -1 || value.indexOf('<') > -1) {
      char[] chars=value.toCharArray();
      for (int x=0, charsSize=chars.length; x < charsSize; x++) {
        char character=chars[x];
switch (character) {
case '&':
{
            writer.write("String_Node_Str");
            break;
          }
case '<':
{
          writer.write("String_Node_Str");
          break;
        }
case '"':
{
        writer.write("String_Node_Str");
        break;
      }
default :
    if (encoder.canEncode(character)) {
      writer.write(character);
    }
 else {
      writer.write("String_Node_Str");
      writer.write(String.valueOf((int)character));
      writer.write(';');
    }
}
}
}
 else {
writer.write(value);
}
}
 catch (IOException e) {
throw XMLMarshalException.marshalException(e);
}
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
protected void writeValue(String value,boolean isAttribute,Writer writer){
  CharacterEscapeHandler escapeHandler=null;
  if (marshaller != null) {
    escapeHandler=marshaller.getCharacterEscapeHandler();
  }
  if (escapeHandler != null) {
    try {
      escapeHandler.escape(value.toCharArray(),0,value.length(),isAttribute,writer);
    }
 catch (    IOException e) {
      throw XMLMarshalException.marshalException(e);
    }
    return;
  }
  try {
    if ((null != encoder && encoder.maxBytesPerChar() < 4) || value.indexOf('"') > -1 || value.indexOf('&') > -1 || value.indexOf('<') > -1) {
      char[] chars=value.toCharArray();
      for (int x=0, charsSize=chars.length; x < charsSize; x++) {
        char character=chars[x];
switch (character) {
case '&':
{
            writer.write("String_Node_Str");
            break;
          }
case '<':
{
          writer.write("String_Node_Str");
          break;
        }
case '"':
{
        writer.write("String_Node_Str");
        break;
      }
default :
    if (encoder.canEncode(character)) {
      writer.write(character);
    }
 else {
      writer.write("String_Node_Str");
      writer.write(String.valueOf((int)character));
      writer.write(';');
    }
}
}
}
 else {
writer.write(value);
}
}
 catch (IOException e) {
throw XMLMarshalException.marshalException(e);
}
}
Program: 65332
Project: 65332
Buggy source:
public void setName(int name){
  this.id=name;
}

Fixed version (ground truth):
@XmlElement public void setName(int name){
  this.id=name;
}
Program: 65333
Project: 65333
Buggy source:
public int getId(){
  return this.id;
}

Fixed version (ground truth):
@XmlElement public int getId(){
  return this.id;
}
Program: 65334
Project: 65334
Buggy source:
protected Object getControlObject(){
  Employee emp=new Employee(0);
  emp.firstName="String_Node_Str";
  emp.lastName="String_Node_Str";
  return emp;
}

Fixed version (ground truth):
protected Object getControlObject(){
  Employee emp=new Employee(666);
  emp.firstName="String_Node_Str";
  emp.lastName="String_Node_Str";
  return emp;
}
Program: 65335
Project: 65335
Buggy source:
protected Object getControlObject(){
  Employee emp=new Employee(0);
  return emp;
}

Fixed version (ground truth):
protected Object getControlObject(){
  Employee emp=new Employee(66);
  return emp;
}
Program: 65336
Project: 65336
Buggy source:
protected Object getControlObject(){
  Employee emp=new Employee(0);
  emp.firstName="String_Node_Str";
  emp.lastName="String_Node_Str";
  return emp;
}

Fixed version (ground truth):
protected Object getControlObject(){
  Employee emp=new Employee(666);
  emp.firstName="String_Node_Str";
  emp.lastName="String_Node_Str";
  return emp;
}
Program: 65337
Project: 65337
Buggy source:
public void setReadOnlyString(String string){
  this.readOnlyString=string;
}

Fixed version (ground truth):
@XmlElement public void setReadOnlyString(String string){
  this.readOnlyString=string;
}
Program: 65338
Project: 65338
Buggy source:
public String getWriteOnlyString(){
  return writeOnlyString;
}

Fixed version (ground truth):
@XmlElement public String getWriteOnlyString(){
  return writeOnlyString;
}
Program: 65339
Project: 65339
Buggy source:
public void setReadOnlyStringArray(String[] array){
  this.readOnlyStringArray=array;
}

Fixed version (ground truth):
@XmlElement public void setReadOnlyStringArray(String[] array){
  this.readOnlyStringArray=array;
}
Program: 65340
Project: 65340
Buggy source:
public String[] getWriteOnlyStringArray(){
  return writeOnlyStringArray;
}

Fixed version (ground truth):
@XmlElement public String[] getWriteOnlyStringArray(){
  return writeOnlyStringArray;
}
Program: 65342
Project: 65342
Buggy source:
/** 
 * Returns
 * @return
 */
Collection<IdentificationVariable> getResultVariables(){
  if (parent != null) {
    return parent.getResultVariables();
  }
  if (resultVariables == null) {
    resultVariables=new HashSet<IdentificationVariable>();
    ResultVariableVisitor visitor=new ResultVariableVisitor();
    queryContext.getJPQLExpression().accept(visitor);
  }
  return resultVariables;
}

Fixed version (ground truth):
/** 
 * Returns the variables that got defined in the select expression. This only applies to JPQL queries built for JPA 2.0 or later.
 * @return The variables identifying the select expressions, if any was defined or an empty setif none were defined
 */
Collection<IdentificationVariable> getResultVariables(){
  if (parent != null) {
    return parent.getResultVariables();
  }
  if (resultVariables == null) {
    resultVariables=new HashSet<IdentificationVariable>();
    ResultVariableVisitor visitor=new ResultVariableVisitor();
    queryContext.getJPQLExpression().accept(visitor);
  }
  return resultVariables;
}
Program: 65343
Project: 65343
Buggy source:
private void visitInExpression(InExpression expression,Expression stateFieldPathExpression){
  InExpressionBuilder visitor=inExpressionBuilder();
  try {
    visitor.hasNot=expression.hasNot();
    visitor.singleInputParameter=!expression.hasLeftParenthesis();
    visitor.stateFieldPathExpression=stateFieldPathExpression;
    expression.getInItems().accept(visitor);
  }
  finally {
    visitor.hasNot=false;
    visitor.singleInputParameter=false;
    visitor.stateFieldPathExpression=null;
  }
}

Fixed version (ground truth):
private void visitInExpression(InExpression expression,Expression stateFieldPathExpression){
  InExpressionBuilder visitor=inExpressionBuilder();
  try {
    visitor.hasNot=expression.hasNot();
    visitor.singleInputParameter=expression.isSingleInputParameter();
    visitor.stateFieldPathExpression=stateFieldPathExpression;
    expression.getInItems().accept(visitor);
  }
  finally {
    visitor.hasNot=false;
    visitor.singleInputParameter=false;
    visitor.stateFieldPathExpression=null;
  }
}
Program: 65344
Project: 65344
Buggy source:
private JPQLGrammar jpqlGrammar(){
  if (JPAQueryBuilderManager.systemQueryBuilderValidationLevel == ParserValidationType.EclipseLink) {
    return DefaultEclipseLinkJPQLGrammar.instance();
  }
 else   if (JPAQueryBuilderManager.systemQueryBuilderValidationLevel == ParserValidationType.JPA10) {
    return JPQLGrammar1_0.instance();
  }
 else   if (JPAQueryBuilderManager.systemQueryBuilderValidationLevel == ParserValidationType.JPA20) {
    return JPQLGrammar2_0.instance();
  }
 else   if (JPAQueryBuilderManager.systemQueryBuilderValidationLevel == ParserValidationType.JPA21) {
    return JPQLGrammar2_1.instance();
  }
 else {
    return DefaultEclipseLinkJPQLGrammar.instance();
  }
}

Fixed version (ground truth):
private JPQLGrammar jpqlGrammar(){
  if (JPAQueryBuilderManager.systemQueryBuilderValidationLevel == ParserValidationType.EclipseLink) {
    return DefaultEclipseLinkJPQLGrammar.instance();
  }
  if (JPAQueryBuilderManager.systemQueryBuilderValidationLevel == ParserValidationType.JPA10) {
    return JPQLGrammar1_0.instance();
  }
  if (JPAQueryBuilderManager.systemQueryBuilderValidationLevel == ParserValidationType.JPA20) {
    return JPQLGrammar2_0.instance();
  }
  if (JPAQueryBuilderManager.systemQueryBuilderValidationLevel == ParserValidationType.JPA21) {
    return JPQLGrammar2_1.instance();
  }
  return DefaultEclipseLinkJPQLGrammar.instance();
}
Program: 65345
Project: 65345
Buggy source:
/** 
 * Converts the given   {@link org.eclipse.persistence.jpa.query.parser.Expression JPQL Expression}into an   {@link Expression}.
 * @param expression The {@link org.eclipse.persistence.jpa.query.parser.Expression JPQL Expression}to visit and to convert into an   {@link Expression}
 * @param type The given array will be used to store the type of the given expression
 * @return The {@link Expression} representing the given parsed expression
 */
Expression buildExpression(org.eclipse.persistence.jpa.jpql.parser.Expression expression,Class<?>[] type){
  return expressionBuilder().buildExpression(expression,type);
}

Fixed version (ground truth):
/** 
 * Converts the given   {@link org.eclipse.persistence.jpa.jpql.parser.Expression JPQL Expression}into an   {@link Expression}.
 * @param expression The {@link org.eclipse.persistence.jpa.jpql.parser.Expression JPQL Expression}to visit and to convert into an   {@link Expression}
 * @param type The given array will be used to store the type of the given expression
 * @return The {@link Expression} representing the given parsed expression
 */
Expression buildExpression(org.eclipse.persistence.jpa.jpql.parser.Expression expression,Class<?>[] type){
  return expressionBuilder().buildExpression(expression,type);
}
Program: 65346
Project: 65346
Buggy source:
/** 
 * Returns the type of the given   {@link QueryKey}, which is the persistent field type.
 * @param mapping The {@link QueryKey} to retrieve its persistent field type
 * @return The persistent field type
 */
Class<?> calculateQueryKeyType(QueryKey queryKey){
  return typeResolver().calculateQueryKeyType(queryKey);
}

Fixed version (ground truth):
/** 
 * Returns the type of the given   {@link QueryKey}, which is the persistent field type.
 * @param queryKey The {@link QueryKey} to retrieve its persistent field type
 * @return The persistent field type
 */
Class<?> calculateQueryKeyType(QueryKey queryKey){
  return typeResolver().calculateQueryKeyType(queryKey);
}
Program: 65347
Project: 65347
Buggy source:
/** 
 * Retrieves the external class for the given fully qualified class name.
 * @param name The fully qualified class name of the class to retrieve
 * @return The external form of the class to retrieve
 */
Class<?> getType(String typeName){
  return loadTypeImp(typeName);
}

Fixed version (ground truth):
/** 
 * Retrieves the external class for the given fully qualified class name.
 * @param typeName The fully qualified class name of the class to retrieve
 * @return The external form of the class to retrieve
 */
Class<?> getType(String typeName){
  return loadTypeImp(typeName);
}