nus-yam/ex-repair huggingface dataset:
Program: 25392
Project: 25392
Buggy source:
@Override public ResultRow next() throws GrillException {
  TRow row=rowItr.next();
  List<ColumnDescriptor> descriptors=getTableSchema().getColumnDescriptors();
  List<Object> results=new ArrayList<Object>(row.getColValsSize());
  List<TColumnValue> thriftRow=row.getColVals();
  for (int i=0; i < row.getColValsSize(); i++) {
    TColumnValue tColumnValue=thriftRow.get(i);
    Type type=descriptors.get(i).getType();
    Object value=null;
switch (type) {
case NULL_TYPE:
      value=null;
    break;
case BOOLEAN_TYPE:
{
    TBoolValue tValue=tColumnValue.getBoolVal();
    if (tValue.isSetValue()) {
      value=tValue.isValue();
    }
    break;
  }
case TINYINT_TYPE:
{
  TByteValue tValue=tColumnValue.getByteVal();
  if (tValue.isSetValue()) {
    value=tValue.getValue();
  }
  break;
}
case SMALLINT_TYPE:
{
TI16Value tValue=tColumnValue.getI16Val();
if (tValue.isSetValue()) {
  value=tValue.getValue();
}
break;
}
case INT_TYPE:
{
TI32Value tValue=tColumnValue.getI32Val();
if (tValue.isSetValue()) {
value=tValue.getValue();
}
break;
}
case BIGINT_TYPE:
{
TI64Value tValue=tColumnValue.getI64Val();
if (tValue.isSetValue()) {
value=tValue.getValue();
}
break;
}
case FLOAT_TYPE:
case DOUBLE_TYPE:
{
TDoubleValue tValue=tColumnValue.getDoubleVal();
if (tValue.isSetValue()) {
value=tValue.getValue();
}
break;
}
case STRING_TYPE:
case VARCHAR_TYPE:
case DATE_TYPE:
case TIMESTAMP_TYPE:
case BINARY_TYPE:
case DECIMAL_TYPE:
case ARRAY_TYPE:
case MAP_TYPE:
case STRUCT_TYPE:
case UNION_TYPE:
case USER_DEFINED_TYPE:
{
TStringValue tValue=tColumnValue.getStringVal();
if (tValue.isSetValue()) {
value=tValue.getValue();
}
break;
}
default :
value=null;
}
results.add(value);
}
return new ResultRow(results);
}

Fixed version (ground truth):
@Override public ResultRow next() throws GrillException {
  List<ColumnDescriptor> descriptors=getTableSchema().getColumnDescriptors();
  int numColumns=descriptors.size();
  List<Object> results=new ArrayList<Object>(numColumns);
  Object[] row=fetchedRowsItr.next();
  results.addAll(Arrays.asList(row));
  return new ResultRow(results);
}
Program: 25393
Project: 25393
Buggy source:
@Override public boolean hasNext() throws GrillException {
  if (noMoreResults) {
    return false;
  }
  if (rowItr == null || !rowItr.hasNext()) {
    try {
      rowSet=client.fetchResults(opHandle,FetchOrientation.FETCH_NEXT,fetchSize).toTRowSet();
      noMoreResults=rowSet.getRowsSize() == 0;
    }
 catch (    Exception e) {
      throw new GrillException(e);
    }
    rowItr=rowSet.getRowsIterator();
  }
  return rowItr.hasNext();
}

Fixed version (ground truth):
@Override public boolean hasNext() throws GrillException {
  if (fetchedRowsItr == null || !fetchedRowsItr.hasNext()) {
    try {
      rowSet=client.fetchResults(opHandle,FetchOrientation.FETCH_NEXT,fetchSize);
      noMoreResults=rowSet.numRows() == 0;
      if (noMoreResults) {
        return false;
      }
      fetchedRowsItr=rowSet.iterator();
    }
 catch (    Exception e) {
      throw new GrillException(e);
    }
  }
  return fetchedRowsItr.hasNext();
}
Program: 25394
Project: 25394
Buggy source:
private void extractPlanDetails(List<String> explainOutput,HiveConf conf) throws HiveException {
  ParserState state=ParserState.BEGIN;
  ParserState prevState=state;
  ArrayList<ParserState> states=new ArrayList<ParserState>();
  Hive metastore=Hive.get(conf);
  for (  String line : explainOutput) {
    String tr=line.trim();
    prevState=state;
    state=nextState(tr,state);
    if (prevState != state) {
      states.add(prevState);
    }
switch (state) {
case MOVE:
      if (tr.startsWith("String_Node_Str")) {
        String outputPath=tr.replace("String_Node_Str","String_Node_Str").trim();
        resultDestination=outputPath;
      }
    break;
case TABLE_SCAN:
  if (tr.startsWith("String_Node_Str")) {
    String tableName=tr.replace("String_Node_Str","String_Node_Str").trim();
    tablesQueried.add(tableName);
    Table tbl=metastore.getTable(tableName);
    String costStr=tbl.getParameters().get(GrillConfConstants.STORAGE_COST);
    Double weight=1d;
    if (costStr != null) {
      weight=Double.parseDouble(costStr);
    }
    tableWeights.put(tableName,weight);
  }
break;
case JOIN:
if (tr.equals("String_Node_Str")) {
numJoins++;
}
break;
case SELECT:
if (tr.startsWith("String_Node_Str") && states.get(states.size() - 1) == ParserState.TABLE_SCAN) {
numSels++;
}
break;
case GROUPBY_EXPRS:
if (tr.startsWith("String_Node_Str")) {
numAggrExprs++;
}
break;
case GROUPBY_KEYS:
if (tr.startsWith("String_Node_Str")) {
numGbys++;
}
break;
}
}
}

Fixed version (ground truth):
private void extractPlanDetails(List<String> explainOutput,HiveConf conf) throws HiveException {
  ParserState state=ParserState.BEGIN;
  ParserState prevState=state;
  ArrayList<ParserState> states=new ArrayList<ParserState>();
  Hive metastore=Hive.get(conf);
  for (  String line : explainOutput) {
    String tr=line.trim();
    prevState=state;
    state=nextState(tr,state);
    if (prevState != state) {
      states.add(prevState);
    }
switch (state) {
case MOVE:
      if (tr.startsWith("String_Node_Str")) {
        String outputPath=tr.replace("String_Node_Str","String_Node_Str").trim();
        resultDestination=outputPath;
      }
    break;
case TABLE_SCAN:
  if (tr.startsWith("String_Node_Str")) {
    String tableName=tr.replace("String_Node_Str","String_Node_Str").trim();
    tablesQueried.add(tableName);
    Table tbl=metastore.getTable(tableName);
    String costStr=tbl.getParameters().get(GrillConfConstants.STORAGE_COST);
    Double weight=1d;
    if (costStr != null) {
      weight=Double.parseDouble(costStr);
    }
    tableWeights.put(tableName,weight);
  }
break;
case JOIN:
if (tr.equals("String_Node_Str")) {
numJoins++;
}
break;
case SELECT:
if (tr.startsWith("String_Node_Str") && states.get(states.size() - 1) == ParserState.TABLE_SCAN) {
numSels+=StringUtils.split(tr,"String_Node_Str").length;
}
break;
case GROUPBY_EXPRS:
if (tr.startsWith("String_Node_Str")) {
numAggrExprs+=StringUtils.split(tr,"String_Node_Str").length;
}
break;
case GROUPBY_KEYS:
if (tr.startsWith("String_Node_Str")) {
numGbys+=StringUtils.split(tr,"String_Node_Str").length;
}
break;
}
}
}
Program: 25395
Project: 25395
Buggy source:
@Test public void testExecuteQueryAsync() throws Exception {
  createTestTable("String_Node_Str");
  String expectFail="String_Node_Str";
  conf.setBoolean(GrillConfConstants.GRILL_PERSISTENT_RESULT_SET,true);
  QueryContext context=new QueryContext(expectFail,null,conf);
  driver.executeAsync(context);
  validateExecuteAsync(context,Status.FAILED,true,null,false);
  driver.closeQuery(context.getQueryHandle());
  String select="String_Node_Str";
  conf.setBoolean(HiveDriver.GRILL_PERSISTENT_RESULT_SET,false);
  context=new QueryContext(select,null,conf);
  driver.executeAsync(context);
  validateExecuteAsync(context,Status.SUCCESSFUL,false,null,false);
  driver.closeQuery(context.getQueryHandle());
  conf.setBoolean(HiveDriver.GRILL_PERSISTENT_RESULT_SET,true);
  context=new QueryContext(select,null,conf);
  driver.executeAsync(context);
  validateExecuteAsync(context,Status.SUCCESSFUL,true,HiveDriver.GRILL_RESULT_SET_PARENT_DIR_DEFAULT,false);
  driver.closeQuery(context.getQueryHandle());
  conf.set(HiveDriver.GRILL_OUTPUT_DIRECTORY_FORMAT,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  select="String_Node_Str";
  context=new QueryContext(select,null,conf);
  driver.executeAsync(context);
  validateExecuteAsync(context,Status.SUCCESSFUL,true,HiveDriver.GRILL_RESULT_SET_PARENT_DIR_DEFAULT,true);
  driver.closeQuery(context.getQueryHandle());
}

Fixed version (ground truth):
@Test public void testExecuteQueryAsync() throws Exception {
  createTestTable("String_Node_Str");
  String expectFail="String_Node_Str";
  conf.setBoolean(GrillConfConstants.GRILL_PERSISTENT_RESULT_SET,true);
  conf.set("String_Node_Str",FailHook.class.getCanonicalName());
  QueryContext context=new QueryContext(expectFail,null,conf);
  driver.executeAsync(context);
  validateExecuteAsync(context,Status.FAILED,true,null,false);
  driver.closeQuery(context.getQueryHandle());
  conf.set("String_Node_Str","String_Node_Str");
  String select="String_Node_Str";
  conf.setBoolean(HiveDriver.GRILL_PERSISTENT_RESULT_SET,false);
  context=new QueryContext(select,null,conf);
  driver.executeAsync(context);
  validateExecuteAsync(context,Status.SUCCESSFUL,false,null,false);
  driver.closeQuery(context.getQueryHandle());
  conf.setBoolean(HiveDriver.GRILL_PERSISTENT_RESULT_SET,true);
  context=new QueryContext(select,null,conf);
  driver.executeAsync(context);
  validateExecuteAsync(context,Status.SUCCESSFUL,true,HiveDriver.GRILL_RESULT_SET_PARENT_DIR_DEFAULT,false);
  driver.closeQuery(context.getQueryHandle());
  conf.set(HiveDriver.GRILL_OUTPUT_DIRECTORY_FORMAT,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  select="String_Node_Str";
  context=new QueryContext(select,null,conf);
  driver.executeAsync(context);
  validateExecuteAsync(context,Status.SUCCESSFUL,true,HiveDriver.GRILL_RESULT_SET_PARENT_DIR_DEFAULT,true);
  driver.closeQuery(context.getQueryHandle());
}
Program: 25396
Project: 25396
Buggy source:
public static SessionHandle getHiveSessionHandle(GrillSessionHandle grillHandle){
  return new SessionHandle(new HandleIdentifier(grillHandle.getPublicId(),grillHandle.getSecretId()));
}

Fixed version (ground truth):
public static SessionHandle getHiveSessionHandle(GrillSessionHandle grillHandle){
  return new SessionHandle(new HandleIdentifier(grillHandle.getPublicId(),grillHandle.getSecretId()),CLIService.SERVER_VERSION);
}
Program: 25397
Project: 25397
Buggy source:
public GrillSessionImpl(String username,String password,Map<String,String> sessionConf){
  super(username,password,sessionConf);
}

Fixed version (ground truth):
public GrillSessionImpl(TProtocolVersion protocol,String username,String password,Map<String,String> sessionConf){
  super(protocol,username,password,sessionConf);
}
Program: 25398
Project: 25398
Buggy source:
public OperationHandle getAllSessionParameters(GrillSessionHandle sessionid,boolean verbose,String key){
  String command="String_Node_Str";
  if (verbose) {
    command+="String_Node_Str";
  }
  if (!StringUtils.isBlank(key)) {
    command+="String_Node_Str" + key;
  }
  OperationHandle handle;
  try {
    acquire(sessionid);
    handle=getCliService().executeStatement(getHiveSessionHandle(sessionid),command,null);
  }
 catch (  HiveSQLException e) {
    throw new WebApplicationException(e);
  }
catch (  GrillException e) {
    throw new WebApplicationException(e);
  }
 finally {
    try {
      release(sessionid);
    }
 catch (    GrillException e) {
      throw new WebApplicationException(e);
    }
  }
  return handle;
}

Fixed version (ground truth):
public OperationHandle getAllSessionParameters(GrillSessionHandle sessionid,boolean verbose,String key) throws GrillException, HiveSQLException {
  String command="String_Node_Str";
  if (verbose) {
    command+="String_Node_Str";
  }
  if (!StringUtils.isBlank(key)) {
    command+="String_Node_Str" + key;
  }
  OperationHandle handle;
  try {
    acquire(sessionid);
    handle=getCliService().executeStatement(getHiveSessionHandle(sessionid),command,null);
  }
  finally {
    try {
      release(sessionid);
    }
 catch (    GrillException e) {
      throw new WebApplicationException(e);
    }
  }
  return handle;
}
Program: 25399
Project: 25399
Buggy source:
/** 
 * Get a list of key=value parameters set for this session
 * @param sessionid session handle object
 * @param verbose If true, all the parameters will be returned.If false, configuration parameters will be returned
 * @param key if this is empty, output will contain all parameters and their values, if it is non empty parameters will be filtered by key
 * @return List of Strings, one entry per key-value pair
 */
@GET @Path("String_Node_Str") @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML,MediaType.TEXT_PLAIN}) public StringList getParams(@QueryParam("String_Node_Str") GrillSessionHandle sessionid,@DefaultValue("String_Node_Str") @QueryParam("String_Node_Str") boolean verbose,@DefaultValue("String_Node_Str") @QueryParam("String_Node_Str") String key){
  OperationHandle handle=sessionService.getAllSessionParameters(sessionid,verbose,key);
  RowSet rows=null;
  try {
    rows=sessionService.getCliService().fetchResults(handle);
  }
 catch (  HiveSQLException e) {
    new WebApplicationException(e);
  }
  List<String> result=new ArrayList<String>();
  for (  TRow row : rows.toTRowSet().getRows()) {
    result.add(row.getColVals().get(0).getStringVal().getValue());
  }
  return new StringList(result);
}

Fixed version (ground truth):
/** 
 * Get a list of key=value parameters set for this session
 * @param sessionid session handle object
 * @param verbose If true, all the parameters will be returned.If false, configuration parameters will be returned
 * @param key if this is empty, output will contain all parameters and their values, if it is non empty parameters will be filtered by key
 * @return List of Strings, one entry per key-value pair
 */
@GET @Path("String_Node_Str") @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML,MediaType.TEXT_PLAIN}) public StringList getParams(@QueryParam("String_Node_Str") GrillSessionHandle sessionid,@DefaultValue("String_Node_Str") @QueryParam("String_Node_Str") boolean verbose,@DefaultValue("String_Node_Str") @QueryParam("String_Node_Str") String key){
  RowSet rows=null;
  boolean failed=false;
  List<String> result=new ArrayList<String>();
  try {
    OperationHandle handle=sessionService.getAllSessionParameters(sessionid,verbose,key);
    rows=sessionService.getCliService().fetchResults(handle);
  }
 catch (  HiveSQLException e) {
    failed=true;
    result.add(key + "String_Node_Str");
  }
catch (  GrillException e) {
    new WebApplicationException(e);
  }
  if (!failed) {
    Iterator<Object[]> itr=rows.iterator();
    while (itr.hasNext()) {
      result.add((String)itr.next()[0]);
    }
  }
  return new StringList(result);
}
Program: 25400
Project: 25400
Buggy source:
/** 
 * Get status of the query, specified by the handle
 * @param handle The query handle
 * @return query status
 */
@Override public QueryStatus getStatus(QueryHandle handle) throws GrillException {
  checkConfigured();
  JdbcQueryContext ctx=getQueryContext(handle);
  QueryStatus status;
  if (ctx.getResultFuture().isDone()) {
    if (ctx.isCancelled()) {
      status=new QueryStatus(1.0,Status.CANCELED,handle.getHandleId() + "String_Node_Str",true);
    }
 else     if (ctx.getQueryResult() != null && ctx.getQueryResult().error != null) {
      status=new QueryStatus(1.0,Status.FAILED,ctx.getQueryResult().error.getMessage(),false);
    }
 else {
      status=new QueryStatus(1.0,Status.SUCCESSFUL,handle.getHandleId() + "String_Node_Str",true);
    }
  }
 else {
    status=new QueryStatus(0.0,Status.RUNNING,handle.getHandleId() + "String_Node_Str",false);
  }
  return status;
}

Fixed version (ground truth):
/** 
 * Get status of the query, specified by the handle
 * @param handle The query handle
 * @return query status
 */
@Override public QueryStatus getStatus(QueryHandle handle) throws GrillException {
  checkConfigured();
  JdbcQueryContext ctx=getQueryContext(handle);
  QueryStatus status;
  if (ctx.getResultFuture().isDone()) {
    if (ctx.isCancelled()) {
      status=new QueryStatus(1.0,Status.CANCELED,handle.getHandleId() + "String_Node_Str",true,null,null);
    }
 else     if (ctx.getQueryResult() != null && ctx.getQueryResult().error != null) {
      status=new QueryStatus(1.0,Status.FAILED,ctx.getQueryResult().error.getMessage(),false,null,null);
    }
 else {
      status=new QueryStatus(1.0,Status.SUCCESSFUL,handle.getHandleId() + "String_Node_Str",true,null,null);
    }
  }
 else {
    status=new QueryStatus(0.0,Status.RUNNING,handle.getHandleId() + "String_Node_Str",false,null,null);
  }
  return status;
}
Program: 25401
Project: 25401
Buggy source:
public CubeReader(final Properties changes) throws IOException {
  reader=CubeDefinitionReaderFactory.get(changes);
  props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("String_Node_Str"));
  for (  final Object key : changes.keySet()) {
    props.put(key,changes.get(key));
  }
}

Fixed version (ground truth):
public CubeReader(final Properties changes) throws IOException {
  reader=CubeDefinitionReaderFactory.get(changes);
  props=reader.getAllProps();
  for (  final Object key : changes.keySet()) {
    props.put(key,changes.get(key));
  }
}
Program: 25403
Project: 25403
Buggy source:
@BeforeTest public void setup() throws Exception {
  service=new EventServiceImpl();
  service.init();
  service.start();
  LOG.info("String_Node_Str");
}

Fixed version (ground truth):
@BeforeTest public void setup() throws Exception {
  service=new EventServiceImpl();
  service.start();
  LOG.info("String_Node_Str");
}
Program: 25404
Project: 25404
Buggy source:
@Override public QueryPlan explain(String query,Configuration conf) throws GrillException {
  QueryContext ctx=createQueryContext(query,conf);
  Configuration explainConf=new Configuration(conf);
  explainConf.setBoolean(GRILL_PERSISTENT_RESULT_SET,false);
  String explainQuery="String_Node_Str" + ctx.hiveQuery;
  HiveInMemoryResultSet inMemoryResultSet=(HiveInMemoryResultSet)execute(explainQuery,explainConf);
  List<String> explainOutput=new ArrayList<String>();
  while (inMemoryResultSet.hasNext()) {
    explainOutput.add(((TStringValue)inMemoryResultSet.next().get(0)).getValue());
  }
  QueryHandle handle=null;
  if (conf.getBoolean(GrillConfConstatnts.PREPARE_ON_EXPLAIN,GrillConfConstatnts.DEFAULT_PREPARE_ON_EXPLAIN)) {
    handleToContext.put(ctx.queryHandle,ctx);
    handle=ctx.queryHandle;
  }
  LOG.info("String_Node_Str" + query);
  try {
    return new HiveQueryPlan(explainOutput,handle,ctx.conf);
  }
 catch (  HiveException e) {
    throw new GrillException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public QueryPlan explain(String query,Configuration conf) throws GrillException {
  QueryContext ctx=createQueryContext(query,conf);
  Configuration explainConf=new Configuration(conf);
  explainConf.setBoolean(GRILL_PERSISTENT_RESULT_SET,false);
  String explainQuery="String_Node_Str" + ctx.hiveQuery;
  HiveInMemoryResultSet inMemoryResultSet=(HiveInMemoryResultSet)execute(explainQuery,explainConf);
  List<String> explainOutput=new ArrayList<String>();
  while (inMemoryResultSet.hasNext()) {
    explainOutput.add(((TStringValue)inMemoryResultSet.next().get(0)).getValue());
  }
  QueryHandle handle=null;
  if (conf.getBoolean(GrillConfConstants.PREPARE_ON_EXPLAIN,GrillConfConstants.DEFAULT_PREPARE_ON_EXPLAIN)) {
    handleToContext.put(ctx.queryHandle,ctx);
    handle=ctx.queryHandle;
  }
  LOG.info("String_Node_Str" + query);
  try {
    return new HiveQueryPlan(explainOutput,handle,ctx.conf);
  }
 catch (  HiveException e) {
    throw new GrillException("String_Node_Str",e);
  }
}
Program: 25406
Project: 25406
Buggy source:
@Test public void testExplain() throws Exception {
  createTestTable("String_Node_Str");
  QueryPlan plan=driver.explain("String_Node_Str",conf);
  assertTrue(plan instanceof HiveQueryPlan);
  assertEquals(plan.getTableWeight("String_Node_Str"),500.0);
  GrillResultSet result=driver.executePrepare(plan.getHandle(),conf);
  validateExecuteSync(result);
  driver.executePrepareAsync(plan.getHandle(),conf);
  validateExecuteAsync(plan.getHandle(),Status.SUCCESSFUL);
  driver.closeQuery(plan.getHandle());
  conf.setBoolean(GrillConfConstatnts.PREPARE_ON_EXPLAIN,false);
  plan=driver.explain("String_Node_Str",conf);
  assertTrue(plan instanceof HiveQueryPlan);
  assertNull(plan.getHandle());
  conf.setBoolean(GrillConfConstatnts.PREPARE_ON_EXPLAIN,true);
}

Fixed version (ground truth):
@Test public void testExplain() throws Exception {
  createTestTable("String_Node_Str");
  QueryPlan plan=driver.explain("String_Node_Str",conf);
  assertTrue(plan instanceof HiveQueryPlan);
  assertEquals(plan.getTableWeight("String_Node_Str"),500.0);
  GrillResultSet result=driver.executePrepare(plan.getHandle(),conf);
  validateExecuteSync(result);
  driver.executePrepareAsync(plan.getHandle(),conf);
  validateExecuteAsync(plan.getHandle(),Status.SUCCESSFUL);
  driver.closeQuery(plan.getHandle());
  conf.setBoolean(GrillConfConstants.PREPARE_ON_EXPLAIN,false);
  plan=driver.explain("String_Node_Str",conf);
  assertTrue(plan instanceof HiveQueryPlan);
  assertNull(plan.getHandle());
  conf.setBoolean(GrillConfConstants.PREPARE_ON_EXPLAIN,true);
}
Program: 25407
Project: 25407
Buggy source:
@Override public Object clone(){
  GoogleSpreadsheetOutputMeta retval=(GoogleSpreadsheetOutputMeta)super.clone();
  retval.setServiceEmail(this.serviceEmail);
  retval.setPrivateKeyStore(this.privateKeyStore);
  retval.setSpreadsheetKey(this.spreadsheetKey);
  retval.setWorksheetId(this.spreadsheetKey);
  return retval;
}

Fixed version (ground truth):
@Override public Object clone(){
  GoogleSpreadsheetOutputMeta retval=(GoogleSpreadsheetOutputMeta)super.clone();
  retval.setServiceEmail(this.serviceEmail);
  retval.setPrivateKeyStore(this.privateKeyStore);
  retval.setSpreadsheetKey(this.spreadsheetKey);
  retval.setWorksheetId(this.worksheetId);
  return retval;
}
Program: 25408
Project: 25408
Buggy source:
@Override public Object clone(){
  GoogleSpreadsheetInputMeta retval=(GoogleSpreadsheetInputMeta)super.clone();
  retval.setServiceEmail(this.serviceEmail);
  retval.setPrivateKeyStore(this.privateKeyStore);
  retval.setSpreadsheetKey(this.spreadsheetKey);
  retval.setWorksheetId(this.spreadsheetKey);
  return retval;
}

Fixed version (ground truth):
@Override public Object clone(){
  GoogleSpreadsheetInputMeta retval=(GoogleSpreadsheetInputMeta)super.clone();
  retval.setServiceEmail(this.serviceEmail);
  retval.setPrivateKeyStore(this.privateKeyStore);
  retval.setSpreadsheetKey(this.spreadsheetKey);
  retval.setWorksheetId(this.worksheetId);
  return retval;
}
Program: 25409
Project: 25409
Buggy source:
public static ComposeData buildDefault(Context context,Uri uri){
  return new ComposeData(uri,context.getString(R.string.default_lgtm_text),40,Color.BLACK);
}

Fixed version (ground truth):
public static ComposeData buildDefault(Context context,Uri uri){
  return new ComposeData(uri,context.getString(R.string.default_lgtm_text),80,Color.BLACK);
}
Program: 25410
Project: 25410
Buggy source:
@Override protected void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_compose);
  mHolder.onCreate(getIntent().<Uri>getParcelableExtra(EXTRA_URI),savedInstanceState);
  mHelper.setSurface(mHolder.getData());
}

Fixed version (ground truth):
@Override protected void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_compose);
  mHolder.onCreate(getIntent().<Uri>getParcelableExtra(EXTRA_URI),savedInstanceState);
  mHelper.setUpActionBar();
  mHelper.setUpComposeView(mHolder.getData());
}
Program: 25411
Project: 25411
Buggy source:
@Inject ComposeViewHelper(@ForActivity Context context){
  super(context);
  mMoveDetector=new MoveGestureDetector(context,this);
  mScaleDetector=new ScaleGestureDetector(context,this);
}

Fixed version (ground truth):
@Inject ComposeViewHelper(@ForActivity Context context){
  super(context);
}
Program: 25412
Project: 25412
Buggy source:
@Override public void surfaceChanged(SurfaceHolder holder,int format,int width,int height){
  if (mLooper != null) {
    mWidth=width;
    mHeight=height;
    mLooper.start();
  }
}

Fixed version (ground truth):
@Override public void surfaceChanged(SurfaceHolder holder,int format,int width,int height){
  if (mLooper != null) {
    mWidth=width;
    mHeight=height;
    Paint.FontMetrics metrics=mTextPaint.getFontMetrics();
    float textWidth=mTextPaint.measureText(mData.getText());
    mTextBaseX=(mWidth / 2) - textWidth / 2;
    mTextBaseY=(mHeight / 2) - (metrics.ascent + metrics.descent) / 2;
    mLooper.start();
  }
}
Program: 25413
Project: 25413
Buggy source:
@Override public boolean onTouchEvent(MotionEvent event){
  mScaleDetector.onTouchEvent(event);
  mRotateDetector.onTouchEvent(event);
  mMoveDetector.onTouchEvent(event);
  mLooper=new Thread(this);
  mLooper.start();
  return true;
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(@Nonnull MotionEvent event){
  mScaleDetector.onTouchEvent(event);
  mRotateDetector.onTouchEvent(event);
  mMoveDetector.onTouchEvent(event);
  mLooper=new Thread(this);
  mLooper.start();
  return true;
}
Program: 25414
Project: 25414
Buggy source:
void drawText(Canvas canvas){
  canvas.save();
  float textSize=mTextSize * mScaleFactor;
  float textX=mTextBaseX + mTextX;
  float textY=mTextBaseY=mTextY;
  canvas.rotate(mDegree,textX,textY);
  mTextPaint.setTextSize(textSize < 255.f ? textSize : 255.f);
  canvas.drawText(mData.getText(),textX,textY,mTextPaint);
  float strokeSize=0.5f * mScaleFactor;
  Paint strokePaint=new Paint();
  strokePaint.setStyle(Paint.Style.STROKE);
  strokePaint.setStrokeWidth(strokeSize < 3.f ? strokeSize : 3.f);
  strokePaint.setColor(Color.BLACK);
  strokePaint.setTextSize(textSize < 255.f ? textSize : 255.f);
  strokePaint.setTypeface(Typeface.DEFAULT_BOLD);
  strokePaint.setAntiAlias(true);
  canvas.drawText(mData.getText(),textX,textY,strokePaint);
  canvas.restore();
}

Fixed version (ground truth):
void drawText(Canvas canvas){
  canvas.save();
  float textSize=mTextSize * mScaleFactor;
  float textX=mTextBaseX + mTextX;
  float textY=mTextBaseY + mTextY;
  canvas.rotate(mDegree,textX,textY);
  mTextPaint.setTextSize(textSize < 255.f ? textSize : 255.f);
  canvas.drawText(mData.getText(),textX,textY,mTextPaint);
  float strokeSize=0.5f * mScaleFactor;
  Paint strokePaint=new Paint();
  strokePaint.setStyle(Paint.Style.STROKE);
  strokePaint.setStrokeWidth(strokeSize < 3.f ? strokeSize : 3.f);
  strokePaint.setColor(Color.BLACK);
  strokePaint.setTextSize(textSize < 255.f ? textSize : 255.f);
  strokePaint.setTypeface(Typeface.DEFAULT_BOLD);
  strokePaint.setAntiAlias(true);
  canvas.drawText(mData.getText(),textX,textY,strokePaint);
  canvas.restore();
}
Program: 25415
Project: 25415
Buggy source:
public ComposeView(Context context,ComposeData data){
  super(context);
  mData=data;
  mMoveDetector=new MoveGestureDetector(context,this);
  mScaleDetector=new ScaleGestureDetector(context,this);
  mRotateDetector=new RotateGestureDetector(context,this);
  getHolder().addCallback(this);
  mTextSize=mData.getTextSize();
  mScaleFactor=1.f;
  mTextPaint=new Paint();
  mTextPaint.setTextSize(mTextSize);
  mTextPaint.setColor(Color.WHITE);
  mTextPaint.setAntiAlias(true);
  mTextPaint.setTypeface(Typeface.DEFAULT_BOLD);
  Paint.FontMetrics metrics=mTextPaint.getFontMetrics();
  float textWidth=mTextPaint.measureText(mData.getText());
  mTextBaseX=(mWidth / 2) - textWidth / 2;
  mTextBaseY=(mHeight / 2) - (metrics.ascent + metrics.descent) / 2;
}

Fixed version (ground truth):
public ComposeView(Context context,ComposeData data){
  super(context);
  mData=data;
  mMoveDetector=new MoveGestureDetector(context,this);
  mScaleDetector=new ScaleGestureDetector(context,this);
  mRotateDetector=new RotateGestureDetector(context,this);
  getHolder().addCallback(this);
  mTextSize=mData.getTextSize();
  mScaleFactor=1.f;
  mTextPaint=new Paint();
  mTextPaint.setTextSize(mTextSize);
  mTextPaint.setColor(Color.WHITE);
  mTextPaint.setAntiAlias(true);
  mTextPaint.setTypeface(Typeface.DEFAULT_BOLD);
}
Program: 25416
Project: 25416
Buggy source:
private void loadMixes(){
  RandomAccessFile randomAccessFile=null;
  try {
    List<Path> mixFiles=listDirectoryMixes(Paths.get(RESOURCE_FOLDER));
    for (    Path f : mixFiles) {
      randomAccessFile=new RandomAccessFile(f.toString().toLowerCase(),"String_Node_Str");
      FileChannel inChannel=randomAccessFile.getChannel();
      MixFile mix=new MixFile(f.getFileName().toString(),inChannel);
      mixes.put(mix.getFileName(),mix);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
  }
}

Fixed version (ground truth):
private void loadMixes(){
  RandomAccessFile randomAccessFile=null;
  try {
    List<Path> mixFiles=listDirectoryMixes(Paths.get(RESOURCE_FOLDER));
    for (    Path f : mixFiles) {
      randomAccessFile=new RandomAccessFile(f.toString(),"String_Node_Str");
      FileChannel inChannel=randomAccessFile.getChannel();
      MixFile mix=new MixFile(f.getFileName().toString(),inChannel);
      mixes.put(mix.getFileName(),mix);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
  }
}
Program: 25417
Project: 25417
Buggy source:
public PalFile getPaletteByName(String name){
  if (palettes.containsKey(name)) {
    return palettes.get(name);
  }
  try (RandomAccessFile randomAccessFile=new RandomAccessFile(Paths.get(PAL_FOLDER + name).toString().toLowerCase(),"String_Node_Str")){
    FileChannel inChannel=randomAccessFile.getChannel();
    PalFile palfile=new PalFile(name,inChannel);
    palettes.put(name,palfile);
    return palfile;
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
  }
  return null;
}

Fixed version (ground truth):
public PalFile getPaletteByName(String name){
  if (palettes.containsKey(name)) {
    return palettes.get(name);
  }
  try (RandomAccessFile randomAccessFile=new RandomAccessFile(PAL_FOLDER + name.toString().toLowerCase(),"String_Node_Str")){
    FileChannel inChannel=randomAccessFile.getChannel();
    PalFile palfile=new PalFile(name,inChannel);
    palettes.put(name,palfile);
    return palfile;
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
  }
  return null;
}
Program: 25418
Project: 25418
Buggy source:
public void update(int delta){
  cellX=(int)(-Main.getInstance().getCamera().getOffsetX() + Main.getInstance().getContainer().getInput().getMouseX()) / 24;
  cellY=(int)(-Main.getInstance().getCamera().getOffsetY() + Main.getInstance().getContainer().getInput().getMouseY()) / 24;
  if (!Main.getInstance().getPlayer().getBase().getProductionQueue().canBuild(this.targetBuilding)) {
    resetBuildingMode();
  }
}

Fixed version (ground truth):
public void update(int delta){
  cellX=(int)(-Main.getInstance().getCamera().getOffsetX() + Main.getInstance().getContainer().getInput().getMouseX()) / 24;
  cellY=(int)(-Main.getInstance().getCamera().getOffsetY() + Main.getInstance().getContainer().getInput().getMouseY()) / 24;
  if (this.targetBuilding != null) {
    boolean isBuildingCancelled=!Main.getInstance().getPlayer().getBase().getProductionQueue().getProductionForBuilding(this.targetBuilding).isReady();
    if (isBuildingCancelled || !Main.getInstance().getPlayer().getBase().getProductionQueue().canBuild(this.targetBuilding)) {
      resetBuildingMode();
    }
  }
}
Program: 25419
Project: 25419
Buggy source:
private void initExternalResources() throws ResourceInitializationException {
  getConfigurationParams(parameters);
  this.rawTextFiles=FileUtils.listRawTextFiles(rawTextFilePath);
  this.restClient=S4ClientBuilder.newClientInstance().withS4Endpoint(serviceEndpoint).withApiKeyId(apiKeyId).withApiPassword(apiPassword).build();
}

Fixed version (ground truth):
private void initExternalResources() throws ResourceInitializationException {
  getConfigurationParams(parameters);
  this.rawTextFiles=FileUtils.listFiles(rawTextFilePath);
  this.restClient=S4ClientBuilder.newClientInstance().withS4Endpoint(serviceEndpoint).withApiKeyId(apiKeyId).withApiPassword(apiPassword).build();
}
Program: 25420
Project: 25420
Buggy source:
/** 
 * Create a collection reader description corresponding to the provided configuration data.
 * @param confData Any configuration data values in the standard UIMAfit format
 * @return a new <code>CollectionReaderDescription</code> instance suitable for using a pipeline directlyor serializing to disk as XML
 * @throws org.apache.uima.resource.ResourceInitializationException
 */
public CollectionReaderDescription createDescription(Object... confData) throws ResourceInitializationException {
  this.parameters=confData;
  initExternalResources();
  final AnnotatedDocument s4Document=fetchS4AnnotatedDocument(rawTextFiles.get(0));
  this.s4CasConverter=new S4DocumentToUimaCasConverter(s4Document);
  s4CasConverter.inferCasTypeSystem(s4Document.entities);
  TypeSystemDescription tsd;
  try {
    tsd=s4CasConverter.getTypeSystemDescription();
  }
 catch (  Exception e) {
    throw new ResourceInitializationException(e);
  }
  return CollectionReaderFactory.createReaderDescription(S4DocumentCollectionReader.class,tsd,parameters);
}

Fixed version (ground truth):
/** 
 * Create a collection reader description corresponding to the provided configuration data.
 * @param confData Any configuration data values in the standard UIMAfit format
 * @return a new <code>CollectionReaderDescription</code> instance suitable for using a pipeline directlyor serializing to disk as XML
 * @throws org.apache.uima.resource.ResourceInitializationException
 */
public CollectionReaderDescription createDescription(Object... confData) throws ResourceInitializationException {
  this.parameters=confData;
  initExternalResources();
  final AnnotatedDocument s4Document=fetchS4AnnotatedDocument(rawTextFiles.get(0));
  this.s4CasConverter=new S4DocumentToUimaCasConverter(s4Document);
  s4CasConverter.inferCasTypeSystem(s4Document.entities.keySet());
  TypeSystemDescription tsd;
  try {
    tsd=s4CasConverter.getTypeSystemDescription();
  }
 catch (  Exception e) {
    throw new ResourceInitializationException(e);
  }
  return CollectionReaderFactory.createReaderDescription(S4DocumentCollectionReader.class,tsd,parameters);
}
Program: 25421
Project: 25421
Buggy source:
private void transformFetchedDocument(File rawTextFile,CAS... cas){
  final AnnotatedDocument s4Document=fetchS4AnnotatedDocument(rawTextFile);
  this.s4CasConverter=new S4DocumentToUimaCasConverter(s4Document);
  s4CasConverter.convertAnnotations();
  s4CasConverter.setSourceDocumentText();
  cas[0]=s4CasConverter.getConvertedDocument();
}

Fixed version (ground truth):
private void transformFetchedDocument(File rawTextFile,CAS cas){
  final AnnotatedDocument s4Document=fetchS4AnnotatedDocument(rawTextFile);
  this.s4CasConverter=new S4DocumentToUimaCasConverter(s4Document);
  s4CasConverter.convertAnnotations(cas);
  s4CasConverter.setSourceDocumentText(cas);
}
Program: 25422
Project: 25422
Buggy source:
@Override public void convertAnnotations(){
  Map<String,List<Annotation>> entities=this.startDocument.entities;
  int featureStructureArrayIndex=0;
  inferCasTypeSystem(entities);
  try {
    this.endDocument=CasCreationUtils.createCas(tsd,null,null);
  }
 catch (  ResourceInitializationException e) {
    e.printStackTrace();
  }
  TypeSystem typeSystem=endDocument.getTypeSystem();
  this.featureStructureArrayCapacity=entities.size();
  this.annotationFeatureStructures=endDocument.createArrayFS(featureStructureArrayCapacity);
  for (  Map.Entry<String,List<Annotation>> entityEntry : entities.entrySet()) {
    String annotationName=entityEntry.getKey();
    annotationName=removeDashes(annotationName);
    List<Annotation> annotations=entityEntry.getValue();
    for (    Annotation ann : annotations) {
      Type type=typeSystem.getType(annotationName);
      LOG.info("String_Node_Str" + type);
      AnnotationFS afs=endDocument.createAnnotation(type,(int)ann.startOffset,(int)ann.endOffset);
      endDocument.addFsToIndexes(afs);
      if (featureStructureArrayIndex + 1 == featureStructureArrayCapacity) {
        resizeArrayFS(featureStructureArrayCapacity * 2,annotationFeatureStructures);
      }
      annotationFeatureStructures.set(featureStructureArrayIndex++,afs);
    }
  }
  endDocument.addFsToIndexes(annotationFeatureStructures);
}

Fixed version (ground truth):
@Override public void convertAnnotations(CAS cas){
  Map<String,List<Annotation>> entities=this.startDocument.entities;
  int featureStructureArrayIndex=0;
  inferCasTypeSystem(entities.keySet());
  try {
    LOG.info("String_Node_Str");
    cas=CasCreationUtils.createCas(tsd,null,null);
  }
 catch (  ResourceInitializationException e) {
    LOG.info("String_Node_Str",e);
  }
  TypeSystem typeSystem=cas.getTypeSystem();
  this.featureStructureArrayCapacity=entities.size();
  this.annotationFeatureStructures=cas.createArrayFS(featureStructureArrayCapacity);
  for (  Map.Entry<String,List<Annotation>> entityEntry : entities.entrySet()) {
    String annotationName=entityEntry.getKey();
    annotationName=removeDashes(annotationName);
    Type type=typeSystem.getType(annotationName);
    List<Annotation> annotations=entityEntry.getValue();
    LOG.info("String_Node_Str" + type);
    for (    Annotation ann : annotations) {
      AnnotationFS afs=cas.createAnnotation(type,(int)ann.startOffset,(int)ann.endOffset);
      cas.addFsToIndexes(afs);
      if (featureStructureArrayIndex + 1 == featureStructureArrayCapacity) {
        resizeArrayFS(featureStructureArrayCapacity * 2,annotationFeatureStructures,cas);
      }
      annotationFeatureStructures.set(featureStructureArrayIndex++,afs);
    }
  }
  cas.addFsToIndexes(annotationFeatureStructures);
}
Program: 25423
Project: 25423
Buggy source:
private void resizeArrayFS(int newCapacity,ArrayFS originalArray){
  ArrayFS biggerArrayFS=endDocument.createArrayFS(newCapacity);
  biggerArrayFS.copyFromArray(originalArray.toArray(),0,0,originalArray.size());
  this.annotationFeatureStructures=biggerArrayFS;
  this.featureStructureArrayCapacity=annotationFeatureStructures.size();
}

Fixed version (ground truth):
private void resizeArrayFS(int newCapacity,ArrayFS originalArray,CAS cas){
  ArrayFS biggerArrayFS=cas.createArrayFS(newCapacity);
  biggerArrayFS.copyFromArray(originalArray.toArray(),0,0,originalArray.size());
  this.annotationFeatureStructures=biggerArrayFS;
  this.featureStructureArrayCapacity=annotationFeatureStructures.size();
}
Program: 25424
Project: 25424
Buggy source:
public void inferCasTypeSystem(Map<String,List<Annotation>> entities){
  for (  String typeName : entities.keySet()) {
    typeName=removeDashes(typeName);
    tsd.addType(typeName,"String_Node_Str" + typeName,"String_Node_Str");
    LOG.info("String_Node_Str" + typeName);
  }
}

Fixed version (ground truth):
@Override public void inferCasTypeSystem(Iterable<String> originalTypes){
  for (  String typeName : originalTypes) {
    typeName=removeDashes(typeName);
    tsd.addType(typeName,"String_Node_Str" + typeName,"String_Node_Str");
    LOG.info("String_Node_Str" + typeName);
  }
}
Program: 25425
Project: 25425
Buggy source:
/** 
 * Removes dashes from UIMA Annotations because they are not allowed to contain dashes.
 * @param typeName
 * @return
 */
private String removeDashes(String typeName){
  if (typeName.contains("String_Node_Str")) {
    typeName=typeName.replaceAll("String_Node_Str","String_Node_Str");
  }
  return typeName;
}

Fixed version (ground truth):
/** 
 * Removes dashes from UIMA Annotations because they are not allowed to contain dashes.
 * @param typeName the annotation name of the current annotation of the source document
 * @return the transformed annotation name suited for the UIMA typesystem
 */
private String removeDashes(String typeName){
  if (typeName.contains("String_Node_Str")) {
    typeName=typeName.replaceAll("String_Node_Str","String_Node_Str");
  }
  return typeName;
}
Program: 25426
Project: 25426
Buggy source:
@Override public void setSourceDocumentText(){
  endDocument.setSofaDataString(startDocument.text,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void setSourceDocumentText(CAS cas){
  cas.setSofaDataString(startDocument.text,"String_Node_Str");
}
Program: 25427
Project: 25427
Buggy source:
void convertAnnotations();

Fixed version (ground truth):
/** 
 * Operation responsible for converting the custom annotations into native UIMA datastructures. .
 * @param cas the CAS object to be populated
 */
void convertAnnotations(CAS cas);
Program: 25428
Project: 25428
Buggy source:
void setSourceDocumentText();

Fixed version (ground truth):
/** 
 * Operation responsible for setting the document's raw text to the CAS objects.
 * @param cas the CAS object to be populated
 */
void setSourceDocumentText(CAS cas);
Program: 25429
Project: 25429
Buggy source:
/** 
 * Send a request with embedded plain text document, Request output as GATE JSON and use the defauls set of annotation selectors.
 */
private static void processInlineDocument(){
  ProcessingRequest pr=new ProcessingRequest();
  pr.setDocument("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  pr.setMimeType("String_Node_Str");
  processRequest(pr,GATE_JSON);
}

Fixed version (ground truth):
/** 
 * Send a request with embedded plain text document, Request output as GATE JSON and use the defauls set of annotation selectors.
 */
private static void processInlineDocument(){
  ProcessingRequest pr=new ProcessingRequest();
  pr.setDocument("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  pr.setDocumentType("String_Node_Str");
  processRequest(pr,GATE_JSON);
}
Program: 25431
Project: 25431
Buggy source:
/** 
 * Process an HTML document by supplying its publicly accessible URL Request output as GATE XML and use the default set of annotation selectors.
 */
private static void processRemoteDocument(){
  ProcessingRequest pr=new ProcessingRequest();
  pr.setDocumentUrl("String_Node_Str");
  pr.setMimeType("String_Node_Str");
  processRequest(pr,GATE_XML);
}

Fixed version (ground truth):
/** 
 * Process an HTML document by supplying its publicly accessible URL Request output as GATE XML and use the default set of annotation selectors.
 */
private static void processRemoteDocument(){
  ProcessingRequest pr=new ProcessingRequest();
  pr.setDocumentUrl("String_Node_Str");
  pr.setDocumentType("String_Node_Str");
  processRequest(pr,GATE_XML);
}
Program: 25433
Project: 25433
Buggy source:
/** 
 * Construct a request for the online service to annotate a document it downloads directly from a remote URL.
 * @param documentUrl the URL from which the document should bedownloaded. This must be accessible to the service so it must not require authentication credentials etc. (but it may be, for example, a pre-signed Amazon S3 URL).
 * @param type the MIME type that the service should use to parse thedocument.
 * @param annotationSelectors annotations to return. Leave as<code>null</code> to use the default selectors recommended by the pipeline provider.
 */
public OnlineServiceRequest(URL documentUrl,SupportedMimeType type,List<AnnotationSelector> annotationSelectors){
  this.documentUrl=documentUrl.toString();
  this.mimeType=type.value;
  if (annotationSelectors != null) {
    this.annotationSelectors=new LinkedList<String>();
    for (    AnnotationSelector as : annotationSelectors) {
      this.annotationSelectors.add(as.toString());
    }
  }
}

Fixed version (ground truth):
/** 
 * Construct a request for the online service to annotate a document it downloads directly from a remote URL.
 * @param documentUrl the URL from which the document should bedownloaded. This must be accessible to the service so it must not require authentication credentials etc. (but it may be, for example, a pre-signed Amazon S3 URL).
 * @param type the MIME type that the service should use to parse thedocument.
 * @param annotationSelectors annotations to return. Leave as<code>null</code> to use the default selectors recommended by the pipeline provider.
 */
public OnlineServiceRequest(URL documentUrl,SupportedMimeType type,List<AnnotationSelector> annotationSelectors){
  this.documentUrl=documentUrl.toString();
  this.documentType=type.value;
  if (annotationSelectors != null) {
    this.annotationSelectors=new LinkedList<String>();
    for (    AnnotationSelector as : annotationSelectors) {
      this.annotationSelectors.add(as.toString());
    }
  }
}
Program: 25436
Project: 25436
Buggy source:
public static int Minimum(int[] data){
  if (data.length < 2)   return 0;
  int iter=0;
  int threshold=-1;
  int max=-1;
  double[] iHisto=new double[data.length];
  for (int i=0; i < data.length; i++) {
    iHisto[i]=(double)data[i];
    if (data[i] > 0)     max=i;
  }
  double[] tHisto=iHisto;
  while (!bimodalTest(iHisto)) {
    for (int i=1; i < data.length - 1; i++)     tHisto[i]=(iHisto[i - 1] + iHisto[i] + iHisto[i + 1]) / 3;
    tHisto[0]=(iHisto[0] + iHisto[1]) / 3;
    tHisto[data.length - 1]=(iHisto[data.length - 2] + iHisto[data.length - 1]) / 3;
    iHisto=tHisto;
    iter++;
    if (iter > 10000) {
      threshold=-1;
      IJ.log("String_Node_Str");
      return threshold;
    }
  }
  for (int i=1; i < max; i++) {
    if (iHisto[i - 1] > iHisto[i] && iHisto[i + 1] >= iHisto[i]) {
      threshold=i;
      break;
    }
  }
  return threshold;
}

Fixed version (ground truth):
public static int Minimum(int[] data){
  if (data.length < 2)   return 0;
  int iter=0;
  int threshold=-1;
  int max=-1;
  double[] iHisto=new double[data.length];
  for (int i=0; i < data.length; i++) {
    iHisto[i]=(double)data[i];
    if (data[i] > 0)     max=i;
  }
  double[] tHisto=new double[iHisto.length];
  while (!bimodalTest(iHisto)) {
    for (int i=1; i < data.length - 1; i++)     tHisto[i]=(iHisto[i - 1] + iHisto[i] + iHisto[i + 1]) / 3;
    tHisto[0]=(iHisto[0] + iHisto[1]) / 3;
    tHisto[data.length - 1]=(iHisto[data.length - 2] + iHisto[data.length - 1]) / 3;
    System.arraycopy(tHisto,0,iHisto,0,iHisto.length);
    iter++;
    if (iter > 10000) {
      threshold=-1;
      IJ.log("String_Node_Str");
      return threshold;
    }
  }
  for (int i=1; i < max; i++) {
    if (iHisto[i - 1] > iHisto[i] && iHisto[i + 1] >= iHisto[i]) {
      threshold=i;
      break;
    }
  }
  return threshold;
}
Program: 25437
Project: 25437
Buggy source:
public boolean getInstallDefaultDrop(){
  return this.flush_on_connect;
}

Fixed version (ground truth):
public boolean getInstallDefaultDrop(){
  return this.install_default_drop;
}
Program: 25438
Project: 25438
Buggy source:
@Override public void switchRemoved(long switchId){
  logger.debug("String_Node_Str");
  List<Proxy> proxies=controllerConnector.getSwitchProxies(switchId);
  Iterator<Proxy> it=proxies.iterator();
  Iterator<IOFSwitch> switchIt=this.switches.iterator();
  while (switchIt.hasNext()) {
    IOFSwitch tmpSwitch=switchIt.next();
    if (tmpSwitch.getId() == switchId) {
      switchIt.remove();
    }
  }
  this.statsCacher.clearCache(switchId);
  while (it.hasNext()) {
    Proxy p=it.next();
    p.disconnect();
    it.remove();
  }
}

Fixed version (ground truth):
@Override public void switchRemoved(long switchId){
  logger.debug("String_Node_Str");
  Iterator<IOFSwitch> switchIt=this.switches.iterator();
  while (switchIt.hasNext()) {
    IOFSwitch tmpSwitch=switchIt.next();
    if (tmpSwitch.getId() == switchId) {
      switchIt.remove();
    }
  }
  this.statsCacher.clearCache(switchId);
  List<Proxy> proxies=controllerConnector.getSwitchProxies(switchId);
  if (proxies != null) {
    Iterator<Proxy> it=proxies.iterator();
    while (it.hasNext()) {
      Proxy p=it.next();
      p.disconnect();
      it.remove();
    }
  }
}