nus-yam/ex-repair huggingface dataset:
Program: 177672
Project: 177672
Buggy source:
@Override public Object executeForSingleValue(Query q){
  Log.trace("String_Node_Str" + q);
  demandConnector.requestConnection();
  try {
    SQLiteStatement s=db.prepare(q.getExecutableSql());
    while (s.step()) {
      return s.columnValue(0);
    }
  }
 catch (  SQLiteException e) {
    throwError(e);
  }
  return null;
}

Fixed version (ground truth):
@Override public Object executeForSingleValue(Query q){
  Log.trace("String_Node_Str",q);
  demandConnector.requestConnection();
  try {
    SQLiteStatement s=db.prepare(q.getExecutableSql());
    while (s.step()) {
      return s.columnValue(0);
    }
  }
 catch (  SQLiteException e) {
    throwError(e);
  }
  return null;
}
Program: 177673
Project: 177673
Buggy source:
/** 
 * Only executes the query without obtaining any results. throws   {@link QueryExecutionException} if error occurs.
 */
@Override public void executeOnly(Query q){
  Log.trace("String_Node_Str" + q);
  demandConnector.requestConnection();
  try {
    db.exec(q.getExecutableSql());
  }
 catch (  SQLiteException e) {
    throwError(e);
  }
}

Fixed version (ground truth):
/** 
 * Only executes the query without obtaining any results. throws   {@link QueryExecutionException} if error occurs.
 */
@Override public void executeOnly(Query q){
  Log.trace("String_Node_Str",q);
  demandConnector.requestConnection();
  try {
    db.exec(q.getExecutableSql());
  }
 catch (  SQLiteException e) {
    throwError(e);
  }
}
Program: 177674
Project: 177674
Buggy source:
@Override public ResultList executeForResultList(Query q){
  Log.trace("String_Node_Str" + q);
  try {
    Cursor cur=db.rawQuery(q.getExecutableSql(),null);
    int columnCount=cur.getColumnCount();
    String[] colNames=cur.getColumnNames();
    List<Object[]> result=new ArrayList<Object[]>();
    int rowIndex=0;
    boolean hasRecord=cur.moveToFirst();
    while (hasRecord) {
      Object[] row=new Object[columnCount];
      for (int j=0; j < columnCount; j++) {
        row[j]=cur.getString(j);
      }
      result.add(row);
      ++rowIndex;
      hasRecord=cur.moveToNext();
    }
    if (result.size() > 0) {
      Object[][] resultArr=new Object[result.size()][columnCount];
      int i=0;
      for (      Object[] row : result)       resultArr[i++]=row;
      return new ResultList(colNames,resultArr);
    }
  }
 catch (  SQLiteException ex) {
    throwError(ex);
  }
  return null;
}

Fixed version (ground truth):
@Override public ResultList executeForResultList(Query q){
  Log.trace("String_Node_Str",q);
  try {
    Cursor cur=db.rawQuery(q.getExecutableSql(),null);
    int columnCount=cur.getColumnCount();
    String[] colNames=cur.getColumnNames();
    List<Object[]> result=new ArrayList<Object[]>();
    int rowIndex=0;
    boolean hasRecord=cur.moveToFirst();
    while (hasRecord) {
      Object[] row=new Object[columnCount];
      for (int j=0; j < columnCount; j++) {
        row[j]=cur.getString(j);
      }
      result.add(row);
      ++rowIndex;
      hasRecord=cur.moveToNext();
    }
    cur.close();
    if (result.size() > 0) {
      Object[][] resultArr=new Object[result.size()][columnCount];
      int i=0;
      for (      Object[] row : result)       resultArr[i++]=row;
      return new ResultList(colNames,resultArr);
    }
  }
 catch (  SQLiteException ex) {
    throwError(ex);
  }
  return null;
}
Program: 177675
Project: 177675
Buggy source:
@Override public void executeOnly(Query q){
  Log.trace("String_Node_Str" + q);
  try {
    db.execSQL(q.getExecutableSql());
  }
 catch (  SQLiteException e) {
    throwError(e);
  }
}

Fixed version (ground truth):
@Override public void executeOnly(Query q){
  Log.trace("String_Node_Str",q);
  try {
    db.execSQL(q.getExecutableSql());
  }
 catch (  SQLiteException e) {
    throwError(e);
  }
}
Program: 177676
Project: 177676
Buggy source:
@Override public Object executeForSingleValue(Query q){
  Log.trace("String_Node_Str" + q);
  try {
    Cursor cur=db.rawQuery(q.getExecutableSql(),null);
    if (!cur.moveToNext()) {
      return null;
    }
 else {
      return cur.getString(0);
    }
  }
 catch (  SQLiteException e) {
    throwError(e);
  }
  return null;
}

Fixed version (ground truth):
@Override public Object executeForSingleValue(Query q){
  Log.trace("String_Node_Str",q);
  Cursor cur=null;
  try {
    cur=db.rawQuery(q.getExecutableSql(),null);
    if (!cur.moveToNext()) {
      return null;
    }
 else {
      return cur.getString(0);
    }
  }
 catch (  SQLiteException e) {
    throwError(e);
    return null;
  }
 finally {
    if (cur != null)     cur.close();
  }
}
Program: 177678
Project: 177678
Buggy source:
/** 
 * Set the   {@link Model} flags and hashes using the persistent fields of theentity to detect that object is changed later.
 */
private void makePersistent(){
  List<Field> fields=getEntity().getFields();
  __persistencyFieldHashes=new int[fields.size()];
  for (int i=0; i < __persistencyFieldHashes.length; i++) {
    Field f=fields.get(i);
    Object o=getEntityField(f);
    __persistencyFieldHashes[i]=(o == null || f.isList()) ? DEFAULT_TRANSIENT_HASHCODE : o.hashCode();
  }
  if (getEntity().getAutoIncrementField() != null)   __persistencyId=getEntityId();
  __persistencyHash=this.hashCode();
}

Fixed version (ground truth):
/** 
 * Set the   {@link Model} flags and hashes using the persistent fields of theentity to detect that object is changed later.
 */
protected void makePersistent(){
  List<Field> fields=getEntity().getFields();
  __persistencyFieldHashes=new int[fields.size()];
  for (int i=0; i < __persistencyFieldHashes.length; i++) {
    Field f=fields.get(i);
    Object o=getEntityField(f);
    __persistencyFieldHashes[i]=(o == null || f.isList()) ? DEFAULT_TRANSIENT_HASHCODE : o.hashCode();
  }
  if (getEntity().getAutoIncrementField() != null)   __persistencyId=getEntityId();
  __persistencyHash=this.hashCode();
}
Program: 177679
Project: 177679
Buggy source:
@SuppressWarnings("String_Node_Str") public static <E>E map(ResultRow row,Class<E> type,Entity e){
  E instance=null;
  try {
    instance=(E)e.getDefaultConstructor().newInstance();
  }
 catch (  Exception e1) {
    Log.error(e1.getMessage());
  }
  if (instance != null)   for (  Field f : e.getFields()) {
    if (!f.isList()) {
      Object fieldValue=row.getColumn(f.getGeneratedName());
      fieldValue=smartCasting(fieldValue,f.getClazz());
      fieldValue=makeCardinalityBinding(f,instance,fieldValue);
      if (f.getClazz().isEnum()) {
        Object[] enumConstant=f.getClazz().getEnumConstants();
        try {
          fieldValue=enumConstant[(Integer)fieldValue];
        }
 catch (        Exception ex) {
          Log.error("String_Node_Str",f.getClazz().getName(),fieldValue == null ? null : fieldValue);
          fieldValue=null;
        }
      }
      if (fieldValue != null)       ((Model<?>)instance).setEntityField(f,e,fieldValue);
    }
 else {
      Object fieldValue=makeCardinalityBinding(f,instance,((Model<?>)instance).getEntityField(((Model<?>)instance).getEntity().getAutoIncrementField()));
      if (fieldValue != null)       ((Model<?>)instance).setEntityField(f,e,fieldValue);
    }
  }
  return instance;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static <E>E map(ResultRow row,Class<E> type,Entity e){
  E instance=null;
  try {
    instance=(E)e.getDefaultConstructor().newInstance();
  }
 catch (  Exception e1) {
    Log.error(e1.getMessage());
  }
  if (instance != null) {
    for (    Field f : e.getFields()) {
      if (!f.isList()) {
        Object fieldValue=row.getColumn(f.getGeneratedName());
        fieldValue=smartCasting(fieldValue,f.getClazz());
        fieldValue=makeCardinalityBinding(f,instance,fieldValue);
        if (f.getClazz().isEnum()) {
          Object[] enumConstant=f.getClazz().getEnumConstants();
          try {
            fieldValue=enumConstant[(Integer)fieldValue];
          }
 catch (          Exception ex) {
            Log.error("String_Node_Str",f.getClazz().getName(),fieldValue == null ? null : fieldValue);
            fieldValue=null;
          }
        }
        if (fieldValue != null)         ((Model<?>)instance).setEntityField(f,e,fieldValue);
      }
 else {
        Object fieldValue=makeCardinalityBinding(f,instance,((Model<?>)instance).getEntityField(((Model<?>)instance).getEntity().getAutoIncrementField()));
        if (fieldValue != null)         ((Model<?>)instance).setEntityField(f,e,fieldValue);
      }
    }
    ((Model<?>)instance).makePersistent();
  }
  return instance;
}
Program: 177680
Project: 177680
Buggy source:
public static void main(String[] args){
  Database db=new SQLite("String_Node_Str");
  StandardLogger log=new StandardLogger();
  Log.setLogger(log);
  Log.setLevel(LoggingLevel.TRACE);
  MappingSession.registerDatabase(db);
  MappingSession.getConfiguration().setCreationPolicy(SchemeCreationPolicy.CREATE);
  MappingSession.start();
  Department d1=new Department();
  d1.title="String_Node_Str";
  Department d2=new Department();
  d2.title="String_Node_Str";
  d1.insert();
  d2.insert();
  d1.employees=new EntityList(Department.class,Employee.class,d1);
  Employee e1=new Employee();
  e1.name="String_Node_Str";
  e1.insert();
  d1.employees.add(e1);
  Employee e2=new Employee();
  e2.name="String_Node_Str";
  e2.insert();
  e2.dept=d2;
  e2.update();
  d2.employees=new EntityList(Department.class,Employee.class,d2);
  Employee e3=new Employee();
  e3.name="String_Node_Str";
  e3.insert();
  d2.employees.add(e3);
  System.out.println("String_Node_Str");
  System.out.println(d1.employees);
  System.out.println(d2.employees);
  System.out.println("String_Node_Str");
  List<Department> depts=Model.fetchAll(Department.class);
  for (  Department d : depts) {
    System.out.println("String_Node_Str" + d.toString() + "String_Node_Str"+ d.employees);
  }
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public static void main(String[] args){
  Database db=new SQLite("String_Node_Str");
  StandardLogger log=new StandardLogger();
  Log.setLogger(log);
  Log.setLevel(LoggingLevel.TRACE);
  MappingSession.registerDatabase(db);
  MappingSession.getConfiguration().setCreationPolicy(SchemeCreationPolicy.CREATE);
  MappingSession.start();
  Department d1=new Department();
  d1.title="String_Node_Str";
  Department d2=new Department();
  d2.title="String_Node_Str";
  d1.insert();
  d2.insert();
  d1.employees=new EntityList(Department.class,Employee.class,d1);
  Employee e1=new Employee();
  e1.name="String_Node_Str";
  e1.insert();
  d1.employees.add(e1);
  Employee e2=new Employee();
  e2.name="String_Node_Str";
  e2.dept=d2;
  e2.insert();
  d2.employees=new EntityList(Department.class,Employee.class,d2);
  Employee e3=new Employee();
  e3.name="String_Node_Str";
  e3.insert();
  d2.employees.add(e3);
  System.out.println("String_Node_Str");
  System.out.println(d1.employees);
  System.out.println(d2.employees);
  System.out.println("String_Node_Str");
  List<Department> depts=Model.fetchAll(Department.class);
  for (  Department d : depts) {
    System.out.println("String_Node_Str" + d.toString() + "String_Node_Str"+ d.employees);
  }
  System.out.println("String_Node_Str");
}
Program: 177681
Project: 177681
Buggy source:
/** 
 * Fields should be in format of EntityName.fieldName, they will be translated to physical names. Field expression can be predeced with (+) indicating ASC, (-) indicating DESCending order. <p> examples: </p> orderBy("User.lastName", "-Customer.id")
 */
public ModelQuery orderBy(String... fields){
  for (int i=0; i < fields.length; i++) {
    String expr=fields[i].trim();
    boolean desc=fields[i].charAt(0) == '-';
    expr=expr.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
    Entity e=parseEntity(expr);
    Field f=parseField(expr);
    String fieldName=f.getGeneratedName();
    fields[i]=(desc ? "String_Node_Str" : "String_Node_Str") + F.formatField(e,fieldName);
  }
  qb.orderBy(fields);
  return this;
}

Fixed version (ground truth):
/** 
 * Fields should be in format of EntityName.fieldName, they will be translated to physical names. Field expression can be predeced with (+) indicating ASC, (-) indicating DESCending order. <p> examples: </p> orderBy("User.lastName", "-Customer.id")
 */
public ModelQuery orderBy(String... fields){
  for (int i=0; i < fields.length; i++) {
    String expr=fields[i].trim();
    boolean desc=fields[i].charAt(0) == '-';
    expr=expr.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
    Entity e=parseEntity(expr);
    Field f=parseField(expr);
    String fieldName=f.getOriginalName();
    fields[i]=(desc ? "String_Node_Str" : "String_Node_Str") + F.formatField(e,fieldName);
  }
  qb.orderBy(fields);
  return this;
}
Program: 177682
Project: 177682
Buggy source:
private String getTemplateFieldValue(String tplField) throws QueryBuilderException {
  if ("String_Node_Str".equals(tplField))   return prepareSelectFieldList();
  if ("String_Node_Str".equals(tplField))   return prepareFieldDescriptionList();
  if ("String_Node_Str".equals(tplField))   return prepareTableConstraints();
  if ("String_Node_Str".equals(tplField))   return prepareTableList();
  if ("String_Node_Str".equals(tplField))   return prepareIndexName();
  if ("String_Node_Str".equals(tplField))   return prepareValueList();
  if ("String_Node_Str".equals(tplField))   return prepareFieldValuePairList();
  if ("String_Node_Str".equals(tplField))   return prepareValuedFieldList();
  if ("String_Node_Str".equals(tplField))   return prepareDatabase();
  SubclauseType subclause=SubclauseType.lookup(tplField);
  if (subclause != null) {
    return this.prepareSubclause(subclause);
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
private String getTemplateFieldValue(String tplField) throws OrmanQueryBuilderException {
  if ("String_Node_Str".equals(tplField))   return prepareSelectFieldList();
  if ("String_Node_Str".equals(tplField))   return prepareFieldDescriptionList();
  if ("String_Node_Str".equals(tplField))   return prepareTableConstraints();
  if ("String_Node_Str".equals(tplField))   return prepareTableList();
  if ("String_Node_Str".equals(tplField))   return prepareIndexName();
  if ("String_Node_Str".equals(tplField))   return prepareValueList();
  if ("String_Node_Str".equals(tplField))   return prepareFieldValuePairList();
  if ("String_Node_Str".equals(tplField))   return prepareValuedFieldList();
  if ("String_Node_Str".equals(tplField))   return prepareDatabase();
  SubclauseType subclause=SubclauseType.lookup(tplField);
  if (subclause != null) {
    return this.prepareSubclause(subclause);
  }
  return "String_Node_Str";
}
Program: 177683
Project: 177683
Buggy source:
public void setPort(short port){
  this.port=port < 0 || port > 0xffff ? -1 : port;
}

Fixed version (ground truth):
public void setPort(int port){
  this.port=port < 0 || port > 0xffff ? -1 : port;
}
Program: 177684
Project: 177684
Buggy source:
public short getPort(){
  return port;
}

Fixed version (ground truth):
public int getPort(){
  return port;
}
Program: 177685
Project: 177685
Buggy source:
public MySQLSettingsImpl(String username,String password,String db,String host,short port){
  if (username != null)   this.username=username;
  if (password != null)   this.password=password;
  if (db != null)   this.database=db;
  if (host != null)   this.host=host;
  if (port >= 0)   this.port=port;
}

Fixed version (ground truth):
public MySQLSettingsImpl(String username,String password,String db,String host,int port){
  if (username != null)   this.username=username;
  if (password != null)   this.password=password;
  if (db != null)   this.database=db;
  if (host != null)   this.host=host;
  if (port >= 0)   this.port=port;
}
Program: 177688
Project: 177688
Buggy source:
/** 
 * Tries to find a getter method for given field name within specified   {@link Class}. First match (according to the  Java naming standards) will be returned, null if not found. Warning: If getter method has arguments in its parameter list, it will not be matched.
 */
private static Method findGetterFor(Class<?> forClass,final String fieldName){
  if (fieldName == null || "String_Node_Str".equals(fieldName))   throw new IllegalArgumentException("String_Node_Str");
  @SuppressWarnings("String_Node_Str") List<String> methodNameCandidates=new ArrayList<String>(){
{
      add("String_Node_Str" + Character.toUpperCase(fieldName.charAt(0)) + (fieldName.length() > 1 ? fieldName.substring(1) : "String_Node_Str"));
      add("String_Node_Str" + fieldName);
      add(fieldName);
    }
  }
;
  Method m=findMethodLike(forClass,methodNameCandidates);
  if (m != null && m.getParameterTypes().length == 0 && !m.getReturnType().equals(Void.TYPE))   return m;
 else   return null;
}

Fixed version (ground truth):
/** 
 * Tries to find a getter method for given field name within specified   {@link Class}. First match (according to the  Java naming standards) will be returned, null if not found. Warning: If getter method has arguments in its parameter list, it will not be matched.
 */
private static Method findGetterFor(Class<?> forClass,final String fieldName){
  if (fieldName == null || "String_Node_Str".equals(fieldName))   throw new IllegalArgumentException("String_Node_Str");
  @SuppressWarnings("String_Node_Str") List<String> methodNameCandidates=new ArrayList<String>(){
{
      add("String_Node_Str" + Character.toUpperCase(fieldName.charAt(0)) + (fieldName.length() > 1 ? fieldName.substring(1) : "String_Node_Str"));
      add("String_Node_Str" + fieldName);
      add("String_Node_Str" + Character.toUpperCase(fieldName.charAt(0)) + (fieldName.length() > 1 ? fieldName.substring(1) : "String_Node_Str"));
      add("String_Node_Str" + fieldName);
      add(fieldName);
    }
  }
;
  Method m=findMethodLike(forClass,methodNameCandidates);
  if (m != null && m.getParameterTypes().length == 0 && !m.getReturnType().equals(Void.TYPE))   return m;
 else   return null;
}
Program: 177689
Project: 177689
Buggy source:
/** 
 * Tries to find a setter method for given field name within specified   {@link Class}. First match (according to the  Java naming standards) will be returned, null if not found. Warning: If setter method does not have exactly 1 argument in parameter list, it will not be matched.
 */
private static Method findSetterFor(Class<?> forClass,final String fieldName){
  if (fieldName == null || "String_Node_Str".equals(fieldName))   throw new IllegalArgumentException("String_Node_Str");
  @SuppressWarnings("String_Node_Str") List<String> methodNameCandidates=new ArrayList<String>(){
{
      add("String_Node_Str" + Character.toUpperCase(fieldName.charAt(0)) + (fieldName.length() > 1 ? fieldName.substring(1) : "String_Node_Str"));
      add("String_Node_Str" + fieldName);
      add("String_Node_Str" + Character.toUpperCase(fieldName.charAt(0)) + (fieldName.length() > 1 ? fieldName.substring(1) : "String_Node_Str"));
      add("String_Node_Str" + fieldName);
      add(fieldName);
    }
  }
;
  Method m=findMethodLike(forClass,methodNameCandidates);
  if (m != null && m.getParameterTypes().length == 1)   return m;
 else   return null;
}

Fixed version (ground truth):
/** 
 * Tries to find a setter method for given field name within specified   {@link Class}. First match (according to the  Java naming standards) will be returned, null if not found. Warning: If setter method does not have exactly 1 argument in parameter list, it will not be matched.
 */
private static Method findSetterFor(Class<?> forClass,final String fieldName){
  if (fieldName == null || "String_Node_Str".equals(fieldName))   throw new IllegalArgumentException("String_Node_Str");
  @SuppressWarnings("String_Node_Str") List<String> methodNameCandidates=new ArrayList<String>(){
{
      add("String_Node_Str" + Character.toUpperCase(fieldName.charAt(0)) + (fieldName.length() > 1 ? fieldName.substring(1) : "String_Node_Str"));
      add("String_Node_Str" + fieldName);
      add(fieldName);
    }
  }
;
  Method m=findMethodLike(forClass,methodNameCandidates);
  if (m != null && m.getParameterTypes().length == 1)   return m;
 else   return null;
}
Program: 177692
Project: 177692
Buggy source:
/** 
 * Formats given <code>originalName</code> to some other physical name using given <code>policy</code>.
 * @param originalName of the field, table or anything else.
 * @param policy physical naming configuration
 * @return converted name
 */
public static String format(String originalName,PhysicalNamingPolicy policy){
  if (!policy.isUnderscore()) {
    originalName=_toCamelCase(originalName);
  }
 else {
    originalName=camelCaseTo_(originalName);
  }
  if (policy.isUppercase()) {
    originalName=originalName.toUpperCase();
  }
 else   if (!policy.isUppercase() && !policy.isCamelCase()) {
    originalName=originalName.toLowerCase();
  }
  if (policy.isPluralize()) {
    originalName=pluralize(originalName);
  }
  return originalName;
}

Fixed version (ground truth):
/** 
 * Formats given <code>originalName</code> to some other physical name using given <code>policy</code>.
 * @param originalName of the field, table or anything else.
 * @param policy physical naming configuration
 * @return converted name
 */
public static String format(String originalName,PhysicalNamingPolicy policy){
  if (policy.isPluralize()) {
    originalName=pluralize(originalName);
  }
  if (!policy.isUnderscore()) {
    originalName=_toCamelCase(originalName);
  }
 else {
    originalName=camelCaseTo_(originalName);
  }
  if (policy.isUppercase()) {
    originalName=originalName.toUpperCase();
  }
 else   if (!policy.isUppercase() && !policy.isCamelCase()) {
    originalName=originalName.toLowerCase();
  }
  return originalName;
}
Program: 177693
Project: 177693
Buggy source:
/** 
 * Overrides lowercase policy.
 * @param camelCase
 */
public void camelCase(boolean camelCase){
  this.camelCase=camelCase;
}

Fixed version (ground truth):
/** 
 * Overrides lowercase policy.
 * @param camelCase
 */
public PhysicalNamingPolicy camelCase(boolean camelCase){
  this.camelCase=camelCase;
  return this;
}
Program: 177694
Project: 177694
Buggy source:
private static Class<?> getIdTypeForClass(Class<?> clazz){
  getIdFieldForClass(clazz).getType();
  return null;
}

Fixed version (ground truth):
private static Class<?> getIdTypeForClass(Class<?> clazz){
  return getIdFieldForClass(clazz).getType();
}
Program: 177696
Project: 177696
Buggy source:
private static java.lang.reflect.Field getIdFieldForClass(Class<?> clazz){
  for (  java.lang.reflect.Field f : clazz.getDeclaredFields())   if (f.isAnnotationPresent(Id.class))   return f;
  return null;
}

Fixed version (ground truth):
private static java.lang.reflect.Field getIdFieldForClass(Class<?> clazz){
  for (  java.lang.reflect.Field f : clazz.getDeclaredFields()) {
    if (f.isAnnotationPresent(Id.class)) {
      return f;
    }
  }
  return null;
}
Program: 177697
Project: 177697
Buggy source:
public Log4jAdapter(){
  BasicConfigurator.configure();
  Logger.getLogger(FRAMEWORK_LOGGER_NAME);
}

Fixed version (ground truth):
public Log4jAdapter(){
  BasicConfigurator.configure();
  logger=Logger.getLogger(FRAMEWORK_LOGGER_NAME);
}
Program: 177698
Project: 177698
Buggy source:
public static void main(String[] args){
  Database db=new SQLite("String_Node_Str");
  MappingSession.registerDatabase(db);
  MappingSession.registerEntity(User.class);
  MappingSession.registerEntity(Notebook.class);
  MappingSession.getConfiguration().setCreationPolicy(SchemeCreationPolicy.USE_EXISTING);
  MappingSession.start();
  User a=new User();
  Notebook n=new Notebook();
  n.insert();
  a.bookOfUser=n;
  a.insert();
  n.name=a.id + "String_Node_Str";
  n.update();
  Query custom=ModelQuery.select().from(User.class).where(C.gt(User.class,"String_Node_Str",0)).getQuery();
  List<User> l=Model.fetchQuery(custom,User.class);
  System.out.println(l);
}

Fixed version (ground truth):
public static void main(String[] args){
  Database db=new SQLite("String_Node_Str");
  MappingSession.registerDatabase(db);
  MappingSession.registerEntity(User.class);
  MappingSession.registerEntity(Notebook.class);
  MappingSession.getConfiguration().setCreationPolicy(SchemeCreationPolicy.USE_EXISTING);
  MappingSession.start();
  Query custom=ModelQuery.select().from(User.class).getQuery();
  List<User> l=Model.fetchQuery(custom,User.class);
  System.out.println(l);
}
Program: 177700
Project: 177700
Buggy source:
public Field(Class<?> clazz,String name){
  this.clazz=clazz;
  this.originalName=name;
  if (clazz.isAnnotationPresent(Column.class)) {
    String tmpCustomName=clazz.getAnnotation(Column.class).name();
    String tmpCustomType=clazz.getAnnotation(Column.class).type();
    this.customName=(tmpCustomName == null || "String_Node_Str".equals(tmpCustomName)) ? null : tmpCustomName;
    this.customType=(tmpCustomType == null || "String_Node_Str".equals(tmpCustomType)) ? null : tmpCustomType;
  }
}

Fixed version (ground truth):
public Field(Class<?> clazz,java.lang.reflect.Field fieldInstance){
  this.clazz=clazz;
  this.originalName=fieldInstance.getName();
  if (fieldInstance.isAnnotationPresent(Column.class)) {
    Column col=fieldInstance.getAnnotation(Column.class);
    String tmpCustomName=col.name();
    String tmpCustomType=col.type();
    this.customName=(tmpCustomName == null || "String_Node_Str".equals(tmpCustomName)) ? null : tmpCustomName;
    this.customType=(tmpCustomType == null || "String_Node_Str".equals(tmpCustomType)) ? null : tmpCustomType;
  }
}
Program: 177701
Project: 177701
Buggy source:
/** 
 * Saves the persistent instance to the database "if changes are made on it". If no changes are made, no queries will be executed.
 */
public void update(){
  Query q=prepareUpdateQuery();
  MappingSession.getExecuter().executeOnly(q);
  makePersistent();
}

Fixed version (ground truth):
/** 
 * Saves the persistent instance to the database "if changes are made on it". If no changes are made, no queries will be executed.
 */
public void update(){
  Query q=prepareUpdateQuery();
  if (q != null)   MappingSession.getExecuter().executeOnly(q);
  makePersistent();
}
Program: 177702
Project: 177702
Buggy source:
public static void main(String[] args){
  MappingSession.registerEntity(User.class);
  MappingSession.start();
  User u=new User();
  u.insert();
  u.id=5;
  u.setLastName("String_Node_Str");
  u.update();
  u.id=6;
  u.update();
  u.delete();
  ModelQuery q=ModelQuery.type(QueryType.SELECT);
  q.from(User.class).orderBy("String_Node_Str");
  System.out.println(q.getQuery());
}

Fixed version (ground truth):
public static void main(String[] args){
  MappingSession.registerEntity(User.class);
  MappingSession.start();
  User u=new User();
  u.setLastName("String_Node_Str");
  u.insert();
  u.setLastName("String_Node_Str");
  u.update();
  System.out.println();
  ModelQuery q=ModelQuery.type(QueryType.SELECT);
  q.fromAs(User.class,"String_Node_Str").orderBy("String_Node_Str").where(C.and(C.eq(User.class,"String_Node_Str",10),C.between(User.class,"String_Node_Str",3,"String_Node_Str")));
  System.out.println(q.getQuery());
}
Program: 177703
Project: 177703
Buggy source:
public static Criterion like(Field field,Object pattern){
  return C.like(formatField(field),pattern);
}

Fixed version (ground truth):
public static Criterion like(Class<?> entityClass,String fieldName,Object pattern){
  return C.like(F.field(entityClass,fieldName),pattern);
}
Program: 177704
Project: 177704
Buggy source:
public static Criterion in(Field field,Object val){
  return C.in(formatField(field),val);
}

Fixed version (ground truth):
public static Criterion in(Class<?> entityClass,String fieldName,Object set){
  return C.in(F.field(entityClass,fieldName),set);
}
Program: 177705
Project: 177705
Buggy source:
public static Criterion notBetween(Field field,Object l,Object h){
  return C.notBetween(formatField(field),l,h);
}

Fixed version (ground truth):
public static Criterion notBetween(Class<?> entityClass,String fieldName,Object l,Object h){
  return C.notBetween(F.field(entityClass,fieldName),l,h);
}
Program: 177706
Project: 177706
Buggy source:
public static Criterion lt(Field field,Object val){
  return C.lt(formatField(field),val);
}

Fixed version (ground truth):
public static Criterion lt(Class<?> entityClass,String fieldName,Object val){
  return C.lt(F.field(entityClass,fieldName),val);
}
Program: 177707
Project: 177707
Buggy source:
public static Criterion eq(Field field,Object val){
  return C.eq(formatField(field),val);
}

Fixed version (ground truth):
public static Criterion eq(Class<?> entityClass,String fieldName,Object val){
  return C.eq(F.field(entityClass,fieldName),val);
}
Program: 177708
Project: 177708
Buggy source:
public static Criterion gt(Field field,Object val){
  return C.gt(formatField(field),val);
}

Fixed version (ground truth):
public static Criterion gt(Class<?> entityClass,String fieldName,Object val){
  return C.gt(F.field(entityClass,fieldName),val);
}
Program: 177709
Project: 177709
Buggy source:
public static Criterion geq(Field field,Object val){
  return C.geq(formatField(field),val);
}

Fixed version (ground truth):
public static Criterion geq(Class<?> entityClass,String fieldName,Object val){
  return C.geq(F.field(entityClass,fieldName),val);
}
Program: 177710
Project: 177710
Buggy source:
public static Criterion notLike(Field field,Object pattern){
  return C.notLike(formatField(field),pattern);
}

Fixed version (ground truth):
public static Criterion notLike(Class<?> entityClass,String fieldName,Object pattern){
  return C.notLike(F.field(entityClass,fieldName),pattern);
}
Program: 177711
Project: 177711
Buggy source:
public static Criterion leq(Field field,Object val){
  return C.leq(formatField(field),val);
}

Fixed version (ground truth):
public static Criterion leq(Class<?> entityClass,String fieldName,Object val){
  return C.leq(F.field(entityClass,fieldName),val);
}
Program: 177712
Project: 177712
Buggy source:
public static Criterion notIn(Field field,Object val){
  return C.notIn(formatField(field),val);
}

Fixed version (ground truth):
public static Criterion notIn(Class<?> entityClass,String fieldName,Object set){
  return C.notIn(F.field(entityClass,fieldName),set);
}
Program: 177713
Project: 177713
Buggy source:
public static Criterion notEq(Field field,Object val){
  return C.notEq(formatField(field),val);
}

Fixed version (ground truth):
public static Criterion notEq(Class<?> entityClass,String fieldName,Object val){
  return C.notEq(F.field(entityClass,fieldName),val);
}
Program: 177714
Project: 177714
Buggy source:
public static Criterion between(Field field,Object l,Object h){
  return C.between(formatField(field),l,h);
}

Fixed version (ground truth):
public static Criterion between(Class<?> entityClass,String fieldName,Object l,Object h){
  return C.between(F.field(entityClass,fieldName),l,h);
}
Program: 177715
Project: 177715
Buggy source:
public static Query createTableQuery(Entity e){
  if (e.getGeneratedName() == null) {
    throw new UnmappedEntityException(e.getOriginalFullName());
  }
  QueryBuilder qb=QueryBuilder.getBuilder(QueryType.CREATE_TABLE);
  qb.from(e.getGeneratedName());
  for (  Field f : e.getFields()) {
    if (f.getGeneratedName() == null || f.getType() == null) {
      throw new UnmappedFieldException(f.getOriginalName() + "String_Node_Str" + e.getOriginalName()+ "String_Node_Str");
    }
    qb.createColumn(f.getGeneratedName(),f.getType());
  }
  return qb.getQuery();
}

Fixed version (ground truth):
public static Query createTableQuery(Entity e){
  if (e.getGeneratedName() == null) {
    throw new UnmappedEntityException(e.getOriginalFullName());
  }
  QueryBuilder qb=QueryBuilder.getBuilder(QueryType.CREATE_TABLE);
  qb.from(e.getGeneratedName());
  for (  Field f : e.getFields()) {
    if (f.getGeneratedName() == null || f.getType() == null) {
      throw new UnmappedFieldException(f.getOriginalName() + "String_Node_Str" + e.getOriginalName()+ "String_Node_Str");
    }
    qb.createColumn(f.getGeneratedName(),f.getType(),f.isNullable());
  }
  return qb.getQuery();
}
Program: 177716
Project: 177716
Buggy source:
@SuppressWarnings("String_Node_Str") private List<Field> extractFields(){
  this.fields.clear();
  for (  java.lang.reflect.Field f : this.clazz.getDeclaredFields()) {
    if (!Modifier.isTransient(f.getModifiers())) {
      Field newF=new Field(f.getType(),f.getName());
      int accessibility=f.getModifiers();
      if (!(Modifier.isPublic(accessibility))) {
        Method setter=this.findSetterFor(this.clazz,f.getName());
        if (setter == null)         throw new NotDeclaredSetterException(f.getName(),this.clazz.getName());
 else         newF.setSetterMethod(setter);
        Method getter=this.findGetterFor(this.clazz,f.getName());
        if (getter == null)         throw new NotDeclaredGetterException(f.getName(),this.clazz.getName());
 else         newF.setGetterMethod(getter);
      }
      if (f.isAnnotationPresent(Index.class)) {
        Index ann=f.getAnnotation(Index.class);
        newF.setIndex(new FieldIndexHolder(ann.name(),ann.unique()));
      }
      if (f.isAnnotationPresent(Id.class)) {
        newF.makeId(true);
        if (!isSupportedForIdField(f.getType()))         throw new UnsupportedIdFieldTypeException(f.getType().getName());
        if (newF.getIndex() == null)         newF.setIndex(new FieldIndexHolder(null,true));
      }
      fields.add(newF);
    }
  }
  return this.fields;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private List<Field> extractFields(){
  this.fields.clear();
  for (  java.lang.reflect.Field f : this.clazz.getDeclaredFields()) {
    if (!Modifier.isTransient(f.getModifiers())) {
      Field newF=new Field(f.getType(),f.getName());
      int accessibility=f.getModifiers();
      if (!(Modifier.isPublic(accessibility))) {
        Method setter=this.findSetterFor(this.clazz,f.getName());
        if (setter == null)         throw new NotDeclaredSetterException(f.getName(),this.clazz.getName());
 else         newF.setSetterMethod(setter);
        Method getter=this.findGetterFor(this.clazz,f.getName());
        if (getter == null)         throw new NotDeclaredGetterException(f.getName(),this.clazz.getName());
 else         newF.setGetterMethod(getter);
      }
      if (f.isAnnotationPresent(Index.class)) {
        Index ann=f.getAnnotation(Index.class);
        newF.setIndex(new FieldIndexHolder(ann.name(),ann.unique()));
      }
      if (f.isAnnotationPresent(NotNull.class)) {
        newF.setNullable(false);
      }
      if (f.isAnnotationPresent(Id.class)) {
        newF.makeId(true);
        if (!isSupportedForIdField(f.getType()))         throw new UnsupportedIdFieldTypeException(f.getType().getName());
        if (newF.getIndex() == null)         newF.setIndex(new FieldIndexHolder(null,true));
      }
      fields.add(newF);
    }
  }
  return this.fields;
}
Program: 177717
Project: 177717
Buggy source:
private Query prepareUpdateQuery(){
  List<Field> updatedFields=new ArrayList<Field>();
  List<Field> fields=getEntity().getFields();
  for (int i=0; i < __persistencyFieldHashes.length; i++) {
    Object o=getEntityField(fields.get(i),getEntity(),this);
    if (((o == null) ? DEFAULT_TRANSIENT_HASHCODE : o.hashCode()) != __persistencyFieldHashes[i])     updatedFields.add(fields.get(i));
  }
  if (!updatedFields.isEmpty()) {
    QueryBuilder qb=QueryBuilder.update().from(getEntity().getGeneratedName());
    for (    Field f : updatedFields) {
      qb.set(f.getGeneratedName(),getEntityField(f,getEntity(),this));
    }
    qb.where(C.eq(getEntity().getIdField().getGeneratedName(),__persistencyId));
    return qb.getQuery();
  }
 else   return null;
}

Fixed version (ground truth):
private Query prepareUpdateQuery(){
  List<Field> updatedFields=new ArrayList<Field>();
  List<Field> fields=getEntity().getFields();
  for (int i=0; i < __persistencyFieldHashes.length; i++) {
    Object o=getEntityField(fields.get(i),getEntity(),this);
    if (((o == null) ? DEFAULT_TRANSIENT_HASHCODE : o.hashCode()) != __persistencyFieldHashes[i])     updatedFields.add(fields.get(i));
  }
  if (!updatedFields.isEmpty()) {
    QueryBuilder qb=QueryBuilder.update().from(getEntity().getGeneratedName());
    for (    Field f : updatedFields) {
      Object fieldVal=getEntityField(f,getEntity(),this);
      if (!f.isNullable() && fieldVal == null)       throw new NotNullableFieldException(getEntity().getOriginalFullName(),f.getOriginalName());
      qb.set(f.getGeneratedName(),fieldVal);
    }
    qb.where(C.eq(getEntity().getIdField().getGeneratedName(),__persistencyId));
    return qb.getQuery();
  }
 else   return null;
}
Program: 177718
Project: 177718
Buggy source:
private Query prepareInsertQuery(){
  QueryBuilder qb=QueryBuilder.insert();
  qb.from(getEntity().getGeneratedName());
  for (  Field f : getEntity().getFields()) {
    boolean useField=true;
    if (f.isId()) {
      IdGenerationPolicy policy=MappingSession.getConfiguration().getIdGenerationPolicy();
      if (policy == IdGenerationPolicy.ORMAN_ID_GENERATOR)       setEntityField(f,getEntity(),this,NativeIdGenerator.generate(f,this));
      if (policy == IdGenerationPolicy.DEFER_TO_DBMS)       useField=false;
    }
    if (useField)     qb.set(f.getGeneratedName(),getEntityField(f,getEntity(),this));
  }
  return qb.getQuery();
}

Fixed version (ground truth):
private Query prepareInsertQuery(){
  QueryBuilder qb=QueryBuilder.insert();
  qb.from(getEntity().getGeneratedName());
  for (  Field f : getEntity().getFields()) {
    boolean useField=true;
    if (f.isId()) {
      IdGenerationPolicy policy=MappingSession.getConfiguration().getIdGenerationPolicy();
      if (policy == IdGenerationPolicy.ORMAN_ID_GENERATOR)       setEntityField(f,getEntity(),this,NativeIdGenerator.generate(f,this));
      if (policy == IdGenerationPolicy.DEFER_TO_DBMS)       useField=false;
    }
    if (useField) {
      Object fieldVal=getEntityField(f,getEntity(),this);
      if (!f.isNullable() && fieldVal == null)       throw new NotNullableFieldException(getEntity().getOriginalFullName(),f.getOriginalName());
      qb.set(f.getGeneratedName(),fieldVal);
    }
  }
  return qb.getQuery();
}
Program: 177719
Project: 177719
Buggy source:
public Entity(Class<?> clazz){
  if (!clazz.isAnnotationPresent(org.orman.mapper.annotation.Entity.class))   throw new NotAnEntityException();
  this.clazz=clazz;
  this.originalName=clazz.getSimpleName();
  this.originalFullName=clazz.getName();
  this.fields=new EntityInspector(clazz).getFields();
  String tmpCustomName=clazz.getAnnotation(org.orman.mapper.annotation.Entity.class).table();
  this.customName=(tmpCustomName == null || "String_Node_Str".equals(tmpCustomName)) ? null : tmpCustomName;
}

Fixed version (ground truth):
public Entity(Class<?> clazz){
  if (!clazz.isAnnotationPresent(org.orman.mapper.annotation.Entity.class))   throw new NotAnEntityException(clazz.getName());
  this.clazz=clazz;
  this.originalName=clazz.getSimpleName();
  this.originalFullName=clazz.getName();
  this.fields=new EntityInspector(clazz).getFields();
  String tmpCustomName=clazz.getAnnotation(org.orman.mapper.annotation.Entity.class).table();
  this.customName=(tmpCustomName == null || "String_Node_Str".equals(tmpCustomName)) ? null : tmpCustomName;
}
Program: 177720
Project: 177720
Buggy source:
private List<Field> extractFields(){
  this.fields.clear();
  for (  java.lang.reflect.Field f : this.clazz.getDeclaredFields()) {
    if (!Modifier.isTransient(f.getModifiers())) {
      fields.add(new Field(f.getType(),f.getName()));
    }
  }
  return this.fields;
}

Fixed version (ground truth):
private List<Field> extractFields(){
  this.fields.clear();
  for (  java.lang.reflect.Field f : this.clazz.getDeclaredFields()) {
    if (!Modifier.isTransient(f.getModifiers())) {
      Field newF=new Field(f.getType(),f.getName());
      if (f.isAnnotationPresent(Index.class)) {
        Index ann=f.getAnnotation(Index.class);
        newF.setIndex(new FieldIndexHolder(ann.name(),ann.unique()));
      }
      fields.add(newF);
    }
  }
  return this.fields;
}
Program: 177721
Project: 177721
Buggy source:
/** 
 * Makes name and type bindings to entity and its fields then registers to the scheme.
 * @param entityClass
 */
public void registerEntity(Class<?> entityClass){
  Entity e=new Entity(entityClass);
  for (  Field f : e.getFields()) {
    PhysicalNameAndTypeBindingEngine.makeBinding(f,configuration.getColumnNamePolicy(),typeMapper);
  }
  scheme.checkConflictingFields(e);
  PhysicalNameAndTypeBindingEngine.makeBinding(e,configuration.getTableNamePolicy());
  scheme.addEntity(e);
}

Fixed version (ground truth):
/** 
 * Makes name and type bindings to entity and its fields then registers to the scheme.
 * @param entityClass
 * @return scheme props-binded entity  
 */
public Entity registerEntity(Class<?> entityClass){
  Entity e=new Entity(entityClass);
  for (  Field f : e.getFields()) {
    PhysicalNameAndTypeBindingEngine.makeBinding(f,configuration.getColumnNamePolicy(),typeMapper);
  }
  scheme.checkConflictingFields(e);
  PhysicalNameAndTypeBindingEngine.makeBinding(e,configuration.getTableNamePolicy());
  scheme.addEntity(e);
  return e;
}
Program: 177722
Project: 177722
Buggy source:
private Entity getEntityByTableName(String tblName){
  return this.tableNames.get(tblName);
}

Fixed version (ground truth):
public Entity getEntityByTableName(String tblName){
  return this.tableNames.get(tblName);
}
Program: 177723
Project: 177723
Buggy source:
public static void makeBinding(Field field,PhysicalNamingPolicy namingPolicy,DataTypeMapper dataTypeMapper){
  if (field.getCustomName() != null) {
    field.setGeneratedName(field.getCustomName());
  }
 else {
    field.setGeneratedName(PhysicalNameGenerator.format(field.getOriginalName(),namingPolicy));
  }
  if (field.getCustomType() != null) {
    field.setType(field.getCustomType());
  }
 else {
    field.setType(dataTypeMapper.getTypeFor(field.getClazz()));
  }
}

Fixed version (ground truth):
public static void makeBinding(Field field,PhysicalNamingPolicy namingPolicy,DataTypeMapper dataTypeMapper){
  if (field.getCustomName() != null) {
    field.setGeneratedName(field.getCustomName());
  }
 else {
    field.setGeneratedName(PhysicalNameGenerator.format(field.getOriginalName(),namingPolicy));
  }
  if (field.getCustomType() != null) {
    field.setType(field.getCustomType());
  }
 else {
    field.setType(dataTypeMapper.getTypeFor(field.getClazz()));
  }
  if (field.getIndex() != null) {
    if (field.getIndex().name() == null || "String_Node_Str".equals(field.getIndex().name())) {
      field.getIndex().name(field.getGeneratedName() + INDEX_POSTFIX);
    }
  }
}
Program: 177724
Project: 177724
Buggy source:
private static final String camelCaseTo_(String s){
  List<String> parts=new ArrayList<String>();
  ;
  int onUpperFor=0;
  int firstUpper=0;
  for (int i=0; i < s.length(); i++) {
    if (Character.isUpperCase(s.charAt(i))) {
      if (onUpperFor == 0) {
        if (i > 0) {
          parts.add(s.substring(firstUpper,i));
        }
        firstUpper=i;
      }
      onUpperFor++;
    }
 else {
      if (onUpperFor > 1) {
        parts.add(s.substring(firstUpper,firstUpper + onUpperFor - 1));
        firstUpper+=onUpperFor - 1;
      }
      onUpperFor=0;
    }
  }
  if (firstUpper < s.length()) {
    parts.add(s.substring(firstUpper,s.length()));
  }
  StringBuilder sb=new StringBuilder();
  for (int i=0; i < parts.size(); i++) {
    sb.append(parts);
    if (i != parts.size() - 1)     sb.append("String_Node_Str");
  }
  return sb.toString();
}

Fixed version (ground truth):
private static final String camelCaseTo_(String s){
  List<String> parts=new ArrayList<String>();
  ;
  int onUpperFor=0;
  int firstUpper=0;
  for (int i=0; i < s.length(); i++) {
    if (Character.isUpperCase(s.charAt(i))) {
      if (onUpperFor == 0) {
        if (i > 0) {
          parts.add(s.substring(firstUpper,i));
        }
        firstUpper=i;
      }
      onUpperFor++;
    }
 else {
      if (onUpperFor > 1) {
        parts.add(s.substring(firstUpper,firstUpper + onUpperFor - 1));
        firstUpper+=onUpperFor - 1;
      }
      onUpperFor=0;
    }
  }
  if (firstUpper < s.length()) {
    parts.add(s.substring(firstUpper,s.length()));
  }
  StringBuilder sb=new StringBuilder();
  for (int i=0; i < parts.size(); i++) {
    sb.append(parts.get(i));
    if (i != parts.size() - 1)     sb.append("String_Node_Str");
  }
  return sb.toString();
}
Program: 177725
Project: 177725
Buggy source:
@Override public String getMessage(){
  return message;
}

Fixed version (ground truth):
@Override public String getMessage(){
  return String.format(message,this.s);
}
Program: 177726
Project: 177726
Buggy source:
public Query addTable(String tableName,String as){
  if (as == null || "String_Node_Str".equals(as))   as=acquireTableAlias(tableName);
  Table newTable=new Table(tableName,as);
  tables.add(newTable);
  return this;
}

Fixed version (ground truth):
public Query addTable(String tableName,String as){
  if (as == null || "String_Node_Str".equals(as))   as=acquireTableAlias(tableName);
  System.out.println("String_Node_Str" + as);
  Table newTable=new Table(tableName,as);
  newTable.setHandle(as);
  tables.add(newTable);
  return this;
}
Program: 177730
Project: 177730
Buggy source:
/** 
 * Check if the character at position i in the buffer is a delimiter which wouldn't be used as part of an entity
 */
public boolean isNonentityDelimiter(int i){
  final char[] buffer=termAtt.buffer();
  final int bufferLength=termAtt.length();
switch (buffer[i]) {
case '-':
case '?':
case '!':
case ',':
case ';':
case ':':
case '(':
case ')':
case '[':
case ']':
case '/':
case '\\':
    return true;
case '.':
  return (i >= 2 && buffer[i - 2] != '.') || ((i + 2) < bufferLength && buffer[i + 2] != '.');
}
return false;
}

Fixed version (ground truth):
/** 
 * Check if the character at position i in the buffer is a delimiter which wouldn't be used as part of an entity
 */
public boolean isNonentityDelimiter(int i){
  final char[] buffer=termAtt.buffer();
  final int bufferLength=termAtt.length();
switch (buffer[i]) {
case '[':
case ']':
case '!':
case '"':
case '$':
case '%':
case '(':
case ')':
case '*':
case '+':
case ',':
case '/':
case ':':
case ';':
case '<':
case '=':
case '>':
case '?':
case '\\':
case '^':
case '`':
case '{':
case '|':
case '}':
case '~':
case '-':
case '…':
case '¬':
case '·':
    return true;
case '.':
  return (i >= 2 && buffer[i - 2] != '.') || ((i + 2) < bufferLength && buffer[i + 2] != '.');
case '&':
return i < 1 || (i + 1) >= bufferLength || Character.isLowerCase(buffer[i - 1]) || Character.isLowerCase(buffer[i + 1]);
}
return false;
}