nus-yam/ex-repair huggingface dataset:
Program: 175552
Project: 175552
Buggy source:
@Override public InventoryContents set(int row,int column,ClickableItem item){
  contents[row][column]=item;
  update(row,column,item != null ? item.getItem() : null);
  return this;
}

Fixed version (ground truth):
@Override public InventoryContents set(int row,int column,ClickableItem item){
  if (row >= contents.length)   return this;
  if (column >= contents[row].length)   return this;
  contents[row][column]=item;
  update(row,column,item != null ? item.getItem() : null);
  return this;
}
Program: 175553
Project: 175553
Buggy source:
@Override public Optional<ClickableItem> get(int row,int column){
  return Optional.ofNullable(contents[row][column]);
}

Fixed version (ground truth):
@Override public Optional<ClickableItem> get(int row,int column){
  if (row >= contents.length)   return Optional.empty();
  if (column >= contents[row].length)   return Optional.empty();
  return Optional.ofNullable(contents[row][column]);
}
Program: 175554
Project: 175554
Buggy source:
@Override public InventoryContents fillRow(int row,ClickableItem item){
  for (int column=0; column < contents[row].length; column++)   set(row,column,item);
  return this;
}

Fixed version (ground truth):
@Override public InventoryContents fillRow(int row,ClickableItem item){
  if (row >= contents.length)   return this;
  for (int column=0; column < contents[row].length; column++)   set(row,column,item);
  return this;
}
Program: 175555
Project: 175555
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
switch (requestCode) {
case 1:
    if (resultCode == Activity.RESULT_OK) {
      view.showMessage(model.importDatabase(data.getData().getPath()));
    }
  break;
}
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
switch (requestCode) {
case 1:
    if (resultCode == Activity.RESULT_OK) {
      view.exportFinished(model.importDatabase(data.getData().getPath()),this);
    }
  break;
}
}
Program: 175556
Project: 175556
Buggy source:
/** 
 * Make a call to   {@link DataBackupHandler} to import database from external storage.
 * @param path The string which contains stored database path.
 * @return The String message of whether import was successful or failed.
 */
public String importDatabase(String path){
  return DataBackupHandler.importDb(path,activity);
}

Fixed version (ground truth):
/** 
 * Make a call to   {@link DataBackupHandler} to import database from external storage.
 * @param path The string which contains stored database path.
 * @return The String message of whether import was successful or failed.
 */
public String importDatabase(String path){
  return DataBackupHandler.importDb(path);
}
Program: 175557
Project: 175557
Buggy source:
/** 
 * Import backed up data into application.
 * @param path     Where database is saved.
 * @param activity Instance of current activity that will be reset after importing database.
 * @return String success or failed message.
 */
public static String importDb(String path,Activity activity){
  try {
    File sd=Environment.getExternalStorageDirectory();
    if (sd.canWrite()) {
      File backupDB=new File(path);
      File currentDB=App.getAppContext().getDatabasePath(DbHelper.DATABASE_NAME);
      FileChannel src=new FileInputStream(backupDB).getChannel();
      FileChannel dst=new FileOutputStream(currentDB).getChannel();
      dst.transferFrom(src,0,src.size());
      src.close();
      dst.close();
      activity.recreate();
      return App.getAppContext().getString(R.string.import_db_success);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    return App.getAppContext().getString(R.string.import_db_fail);
  }
  return App.getAppContext().getString(R.string.import_db_fail);
}

Fixed version (ground truth):
/** 
 * Import backed up data into application.
 * @param path     Where database is saved.
 * @param activity Instance of current activity that will be reset after importing database.
 * @return String success or failed message.
 */
public static String importDb(String path){
  try {
    File sd=Environment.getExternalStorageDirectory();
    if (sd.canWrite()) {
      File backupDB=new File(path);
      File currentDB=App.getAppContext().getDatabasePath(DbHelper.DATABASE_NAME);
      FileChannel src=new FileInputStream(backupDB).getChannel();
      FileChannel dst=new FileOutputStream(currentDB).getChannel();
      dst.transferFrom(src,0,src.size());
      src.close();
      dst.close();
      return App.getAppContext().getString(R.string.import_db_success);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    return App.getAppContext().getString(R.string.import_db_fail);
  }
  return App.getAppContext().getString(R.string.import_db_fail);
}
Program: 175558
Project: 175558
Buggy source:
/** 
 * Show a message to user using Snackbar.
 * @param message The String message to show to user.
 */
public void showMessage(String message){
  Snackbar.make(mainLayout,message,Snackbar.LENGTH_SHORT).show();
}

Fixed version (ground truth):
/** 
 * Show a message to user using Snackbar.
 * @param message The String message to show to user.
 */
private void showMessage(String message){
  Snackbar.make(mainLayout,message,Snackbar.LENGTH_SHORT).show();
}
Program: 175559
Project: 175559
Buggy source:
public void editMode(NoteStruct note){
  edtTitle.setText(note.getTitle());
  Log.i("String_Node_Str","String_Node_Str" + note.getDrawing().length);
  BitmapFactory.Options options=new BitmapFactory.Options();
  options.inMutable=true;
  Bitmap bmp=BitmapFactory.decodeByteArray(note.getDrawing(),0,note.getDrawing().length,options);
  painting.paintBitmap(bmp);
}

Fixed version (ground truth):
public void editMode(final NoteStruct note){
  mainLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      edtTitle.setText(note.getTitle());
      BitmapFactory.Options options=new BitmapFactory.Options();
      options.inMutable=true;
      Bitmap bmp=BitmapFactory.decodeByteArray(note.getDrawing(),0,note.getDrawing().length,options);
      painting.paintBitmap(bmp);
      if (Build.VERSION.SDK_INT < 16) {
        mainLayout.getViewTreeObserver().removeGlobalOnLayoutListener(this);
      }
 else {
        mainLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
      }
    }
  }
);
}
Program: 175560
Project: 175560
Buggy source:
public AddDrawingView(@NonNull final Activity activity){
  super(activity);
  View view=inflate(getContext(),R.layout.activity_add_drawing,this);
  edtTitle=(EditText)view.findViewById(R.id.edtTitle);
  painting=(DrawingView)view.findViewById(R.id.painting);
  ImageView imgEraser=(ImageView)view.findViewById(R.id.imgEraser);
  ImageView imgClear=(ImageView)view.findViewById(R.id.imgClear);
  imgEraser.setOnClickListener(this);
  imgClear.setOnClickListener(this);
  imgEraser.setTag(ClickedActionItem.ERASER);
  imgClear.setTag(ClickedActionItem.CLEAR);
  Toolbar toolbar=(Toolbar)view.findViewById(R.id.toolbar);
  toolbar.inflateMenu(R.menu.add_note_toolbar);
  MenuItem save=toolbar.getMenu().findItem(R.id.save);
  toolbar.setNavigationIcon(getIcon(R.drawable.ic_arrow_back_24dp));
  save.setIcon(getIcon(R.drawable.ic_check_24dp));
  save.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      ((OnSaveListener)presenter).onSave(edtTitle.getText().toString(),painting);
      return false;
    }
  }
);
  toolbar.setNavigationOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      activity.finish();
    }
  }
);
}

Fixed version (ground truth):
public AddDrawingView(@NonNull final Activity activity){
  super(activity);
  View view=inflate(getContext(),R.layout.activity_add_drawing,this);
  edtTitle=(EditText)view.findViewById(R.id.edtTitle);
  painting=(DrawingView)view.findViewById(R.id.painting);
  mainLayout=(LinearLayout)view.findViewById(R.id.mainLayout);
  ImageView imgEraser=(ImageView)view.findViewById(R.id.imgEraser);
  ImageView imgClear=(ImageView)view.findViewById(R.id.imgClear);
  imgEraser.setOnClickListener(this);
  imgClear.setOnClickListener(this);
  imgEraser.setTag(ClickedActionItem.ERASER);
  imgClear.setTag(ClickedActionItem.CLEAR);
  Toolbar toolbar=(Toolbar)view.findViewById(R.id.toolbar);
  toolbar.inflateMenu(R.menu.add_note_toolbar);
  MenuItem save=toolbar.getMenu().findItem(R.id.save);
  toolbar.setNavigationIcon(getIcon(R.drawable.ic_arrow_back_24dp));
  save.setIcon(getIcon(R.drawable.ic_check_24dp));
  save.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      ((OnSaveListener)presenter).onSave(edtTitle.getText().toString(),painting);
      return false;
    }
  }
);
  toolbar.setNavigationOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      activity.finish();
    }
  }
);
}
Program: 175561
Project: 175561
Buggy source:
public void editNoteRequest(NoteStruct note){
  if (note.isPainting()) {
    Intent intent=new Intent(activity,AddNoteActivity.class);
    intent.putExtra(AddNoteModel.FOLDER_ID,note.getFolderId());
    intent.putExtra(AddNoteModel.IS_EDITING,true);
    intent.putExtra(AddNoteModel.NOTE,note);
    activity.startActivity(intent);
  }
 else {
    Intent intent=new Intent(activity,AddDrawingActivity.class);
    intent.putExtra(AddDrawingModel.FOLDER_ID,note.getFolderId());
    intent.putExtra(AddDrawingModel.IS_EDITING,true);
    intent.putExtra(AddDrawingModel.NOTE,note);
    activity.startActivity(intent);
  }
}

Fixed version (ground truth):
public void editNoteRequest(NoteStruct note){
  if (!note.isPainting()) {
    Intent intent=new Intent(activity,AddNoteActivity.class);
    intent.putExtra(AddNoteModel.FOLDER_ID,note.getFolderId());
    intent.putExtra(AddNoteModel.IS_EDITING,true);
    intent.putExtra(AddNoteModel.NOTE,note);
    activity.startActivity(intent);
  }
 else {
    Intent intent=new Intent(activity,AddDrawingActivity.class);
    intent.putExtra(AddDrawingModel.FOLDER_ID,note.getFolderId());
    intent.putExtra(AddDrawingModel.IS_EDITING,true);
    intent.putExtra(AddDrawingModel.NOTE,note);
    activity.startActivity(intent);
  }
}
Program: 175562
Project: 175562
Buggy source:
public void bindView(final NoteStruct note){
  txtTitle.setText(note.getTitle());
  if (note.getDrawing() == null) {
    setImageDrawable(R.drawable.ic_note_24dp,imgId);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
      txtText.setText(Html.fromHtml(note.getText(),Html.FROM_HTML_MODE_COMPACT));
    }
 else {
      txtText.setText(Html.fromHtml(note.getText()));
    }
  }
 else {
    setImageDrawable(R.drawable.ic_image_24dp,imgId);
    txtText.setVisibility(View.GONE);
  }
  view.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      listener.onNoteSelect(note);
    }
  }
);
}

Fixed version (ground truth):
public void bindView(final NoteStruct note){
  txtTitle.setText(note.getTitle());
  if (note.getDrawing() == null) {
    setImageDrawable(R.drawable.ic_note_24dp,imgId);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
      txtText.setText(Html.fromHtml(note.getText(),Html.FROM_HTML_MODE_COMPACT));
    }
 else {
      txtText.setText(Html.fromHtml(note.getText()));
    }
  }
 else {
    setImageDrawable(R.drawable.ic_image_24dp,imgId);
    txtText.setVisibility(View.GONE);
  }
  view.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      onNoteAdapterClickedListener.onNoteAdapterClicked(note);
    }
  }
);
}
Program: 175563
Project: 175563
Buggy source:
@Override public void onClick(View view){
  listener.onNoteSelect(note);
}

Fixed version (ground truth):
@Override public void onClick(View view){
  onNoteAdapterClickedListener.onNoteAdapterClicked(note);
}
Program: 175564
Project: 175564
Buggy source:
public NoteAdapter(Context context,ArrayList<NoteStruct> notes,Listener listener){
  this.context=context;
  this.notes=notes;
  this.listener=listener;
}

Fixed version (ground truth):
public NoteAdapter(Context context,ArrayList<NoteStruct> notes,OnNoteAdapterClickedListener onNoteAdapterClickedListener){
  this.context=context;
  this.notes=notes;
  this.onNoteAdapterClickedListener=onNoteAdapterClickedListener;
}
Program: 175565
Project: 175565
Buggy source:
public void onCreate(){
}

Fixed version (ground truth):
public void onCreate(){
  view.setPresenter(this);
}
Program: 175566
Project: 175566
Buggy source:
/** 
 * Save user note using model saveNote method
 * @param title user note title
 * @param text  user note text
 */
public void onSave(String title,Editable text){
  model.saveNote(title,text);
}

Fixed version (ground truth):
/** 
 * Save user note using model saveNote method
 * @param title user note title
 * @param text  user note text
 */
@Override public void onSave(String title,Editable text){
  model.saveNote(title,text);
}
Program: 175567
Project: 175567
Buggy source:
public AddNoteView(@NonNull final Activity activity){
  super(activity);
  View view=inflate(getContext(),R.layout.activity_add_note,this);
  final EditText edtTitle=(EditText)view.findViewById(R.id.edtTitle);
  edtText=(EditText)view.findViewById(R.id.edtText);
  ImageView imgBold=(ImageView)view.findViewById(R.id.imgBold);
  ImageView imgItalic=(ImageView)view.findViewById(R.id.imgItalic);
  ImageView imgClear=(ImageView)view.findViewById(R.id.imgClear);
  imgBold.setOnClickListener(this);
  imgItalic.setOnClickListener(this);
  imgClear.setOnClickListener(this);
  imgBold.setTag(ClickedActionItem.BOLD);
  imgItalic.setTag(ClickedActionItem.ITALIC);
  imgClear.setTag(ClickedActionItem.CLEAR);
  Toolbar toolbar=(Toolbar)view.findViewById(R.id.toolbar);
  toolbar.inflateMenu(R.menu.add_note_toolbar);
  MenuItem save=toolbar.getMenu().findItem(R.id.save);
  toolbar.setNavigationIcon(getIcon(R.drawable.ic_arrow_back_24dp));
  save.setIcon(getIcon(R.drawable.ic_check_24dp));
  save.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      ((OnSaveListener)getContext()).onSave(edtTitle.getText().toString(),edtText.getText());
      return false;
    }
  }
);
  toolbar.setNavigationOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      activity.finish();
    }
  }
);
}

Fixed version (ground truth):
public AddNoteView(@NonNull final Activity activity){
  super(activity);
  View view=inflate(getContext(),R.layout.activity_add_note,this);
  final EditText edtTitle=(EditText)view.findViewById(R.id.edtTitle);
  edtText=(EditText)view.findViewById(R.id.edtText);
  ImageView imgBold=(ImageView)view.findViewById(R.id.imgBold);
  ImageView imgItalic=(ImageView)view.findViewById(R.id.imgItalic);
  ImageView imgClear=(ImageView)view.findViewById(R.id.imgClear);
  imgBold.setOnClickListener(this);
  imgItalic.setOnClickListener(this);
  imgClear.setOnClickListener(this);
  imgBold.setTag(ClickedActionItem.BOLD);
  imgItalic.setTag(ClickedActionItem.ITALIC);
  imgClear.setTag(ClickedActionItem.CLEAR);
  Toolbar toolbar=(Toolbar)view.findViewById(R.id.toolbar);
  toolbar.inflateMenu(R.menu.add_note_toolbar);
  MenuItem save=toolbar.getMenu().findItem(R.id.save);
  toolbar.setNavigationIcon(getIcon(R.drawable.ic_arrow_back_24dp));
  save.setIcon(getIcon(R.drawable.ic_check_24dp));
  save.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
    @Override public boolean onMenuItemClick(    MenuItem item){
      ((OnSaveListener)presenter).onSave(edtTitle.getText().toString(),edtText.getText());
      return false;
    }
  }
);
  toolbar.setNavigationOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      activity.finish();
    }
  }
);
}
Program: 175568
Project: 175568
Buggy source:
@Override public boolean onMenuItemClick(MenuItem item){
  ((OnSaveListener)getContext()).onSave(edtTitle.getText().toString(),edtText.getText());
  return false;
}

Fixed version (ground truth):
@Override public boolean onMenuItemClick(MenuItem item){
  ((OnSaveListener)presenter).onSave(edtTitle.getText().toString(),edtText.getText());
  return false;
}
Program: 175569
Project: 175569
Buggy source:
public ViewHolder(View view){
  super(view);
  this.view=view;
  txtTitle=(TextView)view.findViewById(R.id.txtNoteTitle);
  txtText=(TextView)view.findViewById(R.id.txtNoteText);
  imgId=(ImageView)view.findViewById(R.id.txtCancel);
}

Fixed version (ground truth):
public ViewHolder(View view){
  super(view);
  this.view=view;
  txtTitle=(TextView)view.findViewById(R.id.txtNoteTitle);
  txtText=(TextView)view.findViewById(R.id.txtNoteText);
  imgId=(ImageView)view.findViewById(R.id.imgIdentifier);
}
Program: 175570
Project: 175570
Buggy source:
@Override public void onLoadFinished(Loader loader,Object data){
  Cursor cursor=(Cursor)data;
  if (data != null) {
    cursor.moveToFirst();
    ArrayList<FolderStruct> folders=new ArrayList<>();
    try {
      while (cursor.moveToNext()) {
        folders.add(new FolderStruct(cursor));
      }
    }
  finally {
      view.updateFolders(folders);
      cursor.close();
    }
  }
}

Fixed version (ground truth):
@Override public void onLoadFinished(Loader<Cursor> loader,Cursor cursor){
  if (cursor != null) {
    cursor.moveToFirst();
    ArrayList<FolderStruct> folders=new ArrayList<>();
    try {
      while (cursor.moveToNext()) {
        folders.add(new FolderStruct(cursor));
      }
    }
  finally {
      view.updateFolders(folders);
    }
  }
}
Program: 175571
Project: 175571
Buggy source:
public NoteView(@NonNull Activity activity){
  super(activity);
  View view=inflate(getContext(),R.layout.activity_note,this);
  mainLayout=(ViewGroup)view.findViewById(R.id.mainLayout);
  FloatingActionButton fabAddNote=(FloatingActionButton)view.findViewById(R.id.fabAddNote);
}

Fixed version (ground truth):
public NoteView(@NonNull Activity activity){
  super(activity);
  View view=inflate(getContext(),R.layout.activity_note,this);
  mainLayout=(ViewGroup)view.findViewById(R.id.mainLayout);
  final FloatingActionButton fabAddText=(FloatingActionButton)view.findViewById(R.id.fabAddText);
  FloatingActionButton fabAddDrawing=(FloatingActionButton)view.findViewById(R.id.fabAddDrawing);
}
Program: 175572
Project: 175572
Buggy source:
public void addFolder(final String name){
  String[] permissions={Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.READ_EXTERNAL_STORAGE};
  new PermissionHandler().checkPermission(activity,permissions,new PermissionHandler.OnPermissionResponse(){
    @Override public void onPermissionGranted(){
      ContentValues values=new ContentValues();
      values.put(DataContract.FoldersEntry.COLUMN_FOLDER_NAME,name);
      App.getAppContext().getContentResolver().insert(DataContract.FoldersEntry.CONTENT_URI,values);
    }
    @Override public void onPermissionDenied(){
    }
  }
);
}

Fixed version (ground truth):
public void addFolder(final String name){
  ContentValues values=new ContentValues();
  values.put(DataContract.FoldersEntry.COLUMN_FOLDER_NAME,name);
  App.getAppContext().getContentResolver().insert(DataContract.FoldersEntry.CONTENT_URI,values);
}
Program: 175573
Project: 175573
Buggy source:
@Override public void onClick(View v){
  AddNewFolderDialog dialog=new AddNewFolderDialog();
  dialog.setShowsDialog(true);
  dialog.show(fragmentManager,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void onClick(View v){
  String[] permissions={Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.READ_EXTERNAL_STORAGE};
  new PermissionHandler().checkPermission((Activity)getContext(),permissions,new PermissionHandler.OnPermissionResponse(){
    @Override public void onPermissionGranted(){
      AddNewFolderDialog dialog=new AddNewFolderDialog();
      dialog.setShowsDialog(true);
      dialog.show(fragmentManager,"String_Node_Str");
    }
    @Override public void onPermissionDenied(){
    }
  }
);
}
Program: 175574
Project: 175574
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  currentOrientationProvider=new GravityCompassProvider((SensorManager)getSystemService(SENSOR_SERVICE));
  mRenderer=new CubeRenderer();
  mRenderer.setOrientationProvider(currentOrientationProvider);
  mGLSurfaceView=new GLSurfaceView(this);
  mGLSurfaceView.setRenderer(mRenderer);
  setContentView(mGLSurfaceView);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  currentOrientationProvider=new ImprovedOrientationSensor2Provider((SensorManager)getSystemService(SENSOR_SERVICE));
  mRenderer=new CubeRenderer();
  mRenderer.setOrientationProvider(currentOrientationProvider);
  mGLSurfaceView=new GLSurfaceView(this);
  mGLSurfaceView.setRenderer(mRenderer);
  setContentView(mGLSurfaceView);
}
Program: 175575
Project: 175575
Buggy source:
private static Method loadIsMockedMethod(Class<?> registryClass){
  if (registryClass == null) {
    return null;
  }
  try {
    return registryClass.getDeclaredMethod("String_Node_Str",registryClass);
  }
 catch (  NoSuchMethodException e) {
    return null;
  }
}

Fixed version (ground truth):
private static Method loadIsMockedMethod(Class<?> registryClass){
  if (registryClass == null) {
    return null;
  }
  try {
    return registryClass.getDeclaredMethod("String_Node_Str",String.class);
  }
 catch (  NoSuchMethodException e) {
    return null;
  }
}
Program: 175576
Project: 175576
Buggy source:
@Before public void setUp() throws Exception {
  testee=new MockableClient(registry,realClient,mockClient,mockWhenFunction);
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  testee=new MockableClient(registry,realClient,mockClient,lookupFunction);
}
Program: 175577
Project: 175577
Buggy source:
private void givenWhenFunctionReturns(boolean result){
  given(mockWhenFunction.call()).willReturn(result);
}

Fixed version (ground truth):
private void givenWhenFunctionReturns(boolean result){
  given(lookupFunction.call()).willReturn(result);
}
Program: 175578
Project: 175578
Buggy source:
@Test public void callRealClient_NotInRegistry() throws Exception {
  givenEndpointInRegistry(false);
  testee.execute(REQUEST);
  verifyRealClientCalled();
  verifyZeroInteractions(mockWhenFunction);
}

Fixed version (ground truth):
@Test public void callRealClient_NotInRegistry() throws Exception {
  givenEndpointInRegistry(false);
  testee.execute(REQUEST);
  verifyRealClientCalled();
  verifyZeroInteractions(lookupFunction);
}
Program: 175579
Project: 175579
Buggy source:
public MetricsSpan(MetricsTracer tracer,Span span,String operationName,long startNanoTime,Map<String,Object> tags){
  this.tracer=tracer;
  this.wrappedSpan=span;
  this.operationName=operationName;
  this.startNanoTime=startNanoTime;
  this.tags=tags;
}

Fixed version (ground truth):
public MetricsSpan(MetricsTracer tracer,Span span,String operationName,long startNanoTime,Map<String,Object> tags){
  this.tracer=tracer;
  this.wrappedSpan=span;
  this.operationName=operationName;
  this.startNanoTime=startNanoTime;
  this.tags=new ConcurrentHashMap<String,Object>();
  if (tags != null) {
    this.tags.putAll(tags);
  }
}
Program: 175580
Project: 175580
Buggy source:
@Override public Span setOperationName(String operationName){
  wrappedSpan.setOperationName(operationName);
  return this;
}

Fixed version (ground truth):
@Override public Span setOperationName(String operationName){
  wrappedSpan.setOperationName(operationName);
  this.operationName=operationName;
  return this;
}
Program: 175581
Project: 175581
Buggy source:
/** 
 * 根据ID查询 SimplePrincipalCollection
 * @param userIds 用户ID
 * @return
 */
public List<SimplePrincipalCollection> getSimplePrincipalCollectionByUserId(Long... userIds){
  Set<Long> idset=new TreeSet<Long>(Arrays.asList(userIds));
  Collection<Session> sessions=shiroSessionDao.getActiveSessions();
  List<SimplePrincipalCollection> list=new ArrayList<SimplePrincipalCollection>();
  for (  Session session : sessions) {
    Object obj=session.getAttribute(DefaultSubjectContext.PRINCIPALS_SESSION_KEY);
    if (null != obj && obj instanceof SimplePrincipalCollection) {
      SimplePrincipalCollection spc=(SimplePrincipalCollection)obj;
      obj=spc.getPrimaryPrincipal();
      if (null != obj && obj instanceof UserEntity) {
        UserEntity user=(UserEntity)obj;
        if (null != user && idset.contains(user.getId())) {
          list.add(spc);
        }
      }
    }
  }
  return list;
}

Fixed version (ground truth):
/** 
 * 根据ID查询 SimplePrincipalCollection
 * @param userIds 用户ID
 * @return
 */
public List<SimplePrincipalCollection> getSimplePrincipalCollectionByUserId(Long... userIds){
  Set<Long> idset=new TreeSet<Long>(Arrays.asList(userIds));
  Collection<Session> sessions=shiroSessionDao.getActiveSessions();
  List<SimplePrincipalCollection> list=new ArrayList<SimplePrincipalCollection>();
  for (  Session session : sessions) {
    Object obj=session.getAttribute(DefaultSubjectContext.PRINCIPALS_SESSION_KEY);
    if (null != obj && obj instanceof SimplePrincipalCollection) {
      SimplePrincipalCollection spc=(SimplePrincipalCollection)obj;
      obj=spc.getPrimaryPrincipal();
      if (null != obj && obj instanceof UserEntity) {
        UserEntity user=(UserEntity)obj;
        if (idset.contains(user.getId())) {
          list.add(spc);
        }
      }
    }
  }
  return list;
}
Program: 175582
Project: 175582
Buggy source:
@Override public void unmarshalDeferrals(PacketInput in) throws IOException {
  in.align(Alignment.TWO);
  in.fullySkipBytes(2 * offset);
  final StringBuilder sb=new StringBuilder(this.length);
  for (int i=0; i < this.length; i++) {
    sb.append(in.readChar());
  }
  this.value=sb.toString();
  if (isNullTerminated())   in.fullySkipBytes(2);
}

Fixed version (ground truth):
@Override public void unmarshalDeferrals(PacketInput in) throws IOException {
  in.align(Alignment.TWO);
  in.fullySkipBytes(2 * offset);
  final int length;
  final boolean nullTerminated;
  if (isNullTerminated() && this.actualCount > 0) {
    length=this.actualCount - 1;
    nullTerminated=true;
  }
 else {
    length=this.actualCount;
    nullTerminated=false;
  }
  final StringBuilder sb=new StringBuilder(length);
  for (int i=0; i < length; i++) {
    sb.append(in.readChar());
  }
  this.value=sb.toString();
  if (nullTerminated)   in.fullySkipBytes(2);
}
Program: 175583
Project: 175583
Buggy source:
@Override public void unmarshalEntity(PacketInput in) throws IOException {
  in.align(Alignment.FOUR);
  this.offset=readIndex("String_Node_Str",in);
  final int actualCount=readIndex("String_Node_Str",in);
  this.length=(isNullTerminated() ? (actualCount - 1) : actualCount);
}

Fixed version (ground truth):
@Override public void unmarshalEntity(PacketInput in) throws IOException {
  in.align(Alignment.FOUR);
  this.offset=readIndex("String_Node_Str",in);
  this.actualCount=readIndex("String_Node_Str",in);
}
Program: 175584
Project: 175584
Buggy source:
@DataProvider public Object[][] data_marshalDeferrals(){
  return new Object[][]{{false,null,"String_Node_Str","String_Node_Str"},{true,null,"String_Node_Str","String_Node_Str"},{false,"String_Node_Str","String_Node_Str","String_Node_Str"},{true,"String_Node_Str","String_Node_Str","String_Node_Str"},{false,"String_Node_Str","String_Node_Str","String_Node_Str"},{false,"String_Node_Str","String_Node_Str","String_Node_Str"},{false,"String_Node_Str","String_Node_Str","String_Node_Str"}};
}

Fixed version (ground truth):
@DataProvider public Object[][] data_marshalDeferrals(){
  return new Object[][]{{false,null,"String_Node_Str","String_Node_Str"},{true,null,"String_Node_Str","String_Node_Str"},{false,"String_Node_Str","String_Node_Str","String_Node_Str"},{true,"String_Node_Str","String_Node_Str","String_Node_Str"},{false,"String_Node_Str","String_Node_Str","String_Node_Str"},{true,"String_Node_Str","String_Node_Str","String_Node_Str"},{false,"String_Node_Str","String_Node_Str","String_Node_Str"},{false,"String_Node_Str","String_Node_Str","String_Node_Str"},{false,"String_Node_Str","String_Node_Str","String_Node_Str"}};
}
Program: 175585
Project: 175585
Buggy source:
@DataProvider public Object[][] data_unmarshalDeferrals(){
  return new Object[][]{{false,"String_Node_Str",0,"String_Node_Str"},{true,"String_Node_Str",0,"String_Node_Str"},{false,"String_Node_Str",0,"String_Node_Str"},{true,"String_Node_Str",0,"String_Node_Str"},{false,"String_Node_Str",1,"String_Node_Str"},{false,"String_Node_Str",2,"String_Node_Str"},{false,"String_Node_Str",3,"String_Node_Str"}};
}

Fixed version (ground truth):
@DataProvider public Object[][] data_unmarshalDeferrals(){
  return new Object[][]{{true,"String_Node_Str",0,"String_Node_Str"},{false,"String_Node_Str",0,"String_Node_Str"},{false,"String_Node_Str",0,"String_Node_Str"},{true,"String_Node_Str",0,"String_Node_Str"},{false,"String_Node_Str",0,"String_Node_Str"},{true,"String_Node_Str",0,"String_Node_Str"},{false,"String_Node_Str",1,"String_Node_Str"},{false,"String_Node_Str",2,"String_Node_Str"},{false,"String_Node_Str",3,"String_Node_Str"}};
}
Program: 175586
Project: 175586
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return false;
  }
 else   if (!(obj instanceof LSAPR_POLICY_AUDIT_EVENTS_INFO)) {
    return false;
  }
  LSAPR_POLICY_AUDIT_EVENTS_INFO other=(LSAPR_POLICY_AUDIT_EVENTS_INFO)obj;
  return Objects.equals(isAuditingMode(),other.isAuditingMode()) && Arrays.equals(getEventAuditingOptions(),other.getEventAuditingOptions()) && Objects.equals(getMaximumAuditEventCount(),other.getMaximumAuditEventCount());
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
 else   if (!(obj instanceof LSAPR_POLICY_AUDIT_EVENTS_INFO)) {
    return false;
  }
  LSAPR_POLICY_AUDIT_EVENTS_INFO other=(LSAPR_POLICY_AUDIT_EVENTS_INFO)obj;
  return Objects.equals(isAuditingMode(),other.isAuditingMode()) && Arrays.equals(getEventAuditingOptions(),other.getEventAuditingOptions()) && Objects.equals(getMaximumAuditEventCount(),other.getMaximumAuditEventCount());
}
Program: 175587
Project: 175587
Buggy source:
@Test public void test_equals(){
  LSAPR_POLICY_AUDIT_EVENTS_INFO obj1=new LSAPR_POLICY_AUDIT_EVENTS_INFO();
  LSAPR_POLICY_AUDIT_EVENTS_INFO obj2=new LSAPR_POLICY_AUDIT_EVENTS_INFO();
  assertEquals(obj1,obj2);
  obj1.setAuditingMode(true);
  assertNotEquals(obj1,obj2);
  obj2.setAuditingMode(true);
  assertEquals(obj1,obj2);
  obj1.setEventAuditingOptions(new int[]{1,2,3});
  assertNotEquals(obj1,obj2);
  obj2.setEventAuditingOptions(new int[]{1,2,3});
  assertEquals(obj1,obj2);
  obj1.setMaximumAuditEventCount(5);
  assertNotEquals(obj1,obj2);
  obj2.setMaximumAuditEventCount(5);
  assertEquals(obj1,obj2);
}

Fixed version (ground truth):
@Test public void test_equals(){
  LSAPR_POLICY_AUDIT_EVENTS_INFO obj1=new LSAPR_POLICY_AUDIT_EVENTS_INFO();
  assertNotEquals(obj1,null);
  assertEquals(obj1,obj1);
  LSAPR_POLICY_AUDIT_EVENTS_INFO obj2=new LSAPR_POLICY_AUDIT_EVENTS_INFO();
  assertEquals(obj1,obj2);
  obj1.setAuditingMode(true);
  assertNotEquals(obj1,obj2);
  obj2.setAuditingMode(true);
  assertEquals(obj1,obj2);
  obj1.setEventAuditingOptions(new int[]{1,2,3});
  assertNotEquals(obj1,obj2);
  obj2.setEventAuditingOptions(new int[]{1,2,3});
  assertEquals(obj1,obj2);
  obj1.setMaximumAuditEventCount(5);
  assertNotEquals(obj1,obj2);
  obj2.setMaximumAuditEventCount(5);
  assertEquals(obj1,obj2);
}
Program: 175588
Project: 175588
Buggy source:
@Override public void marshal(PacketOutput packetOut) throws IOException {
  packetOut.write(handle.getBytes());
  packetOut.writeInt((int)EnumUtils.toLong(desiredAccess));
  packetOut.writeInt(1);
  packetOut.writeByte(sid.getRevision());
  packetOut.writeByte((byte)(sid.getSubAuthorities().length));
  packetOut.write(sid.getSidIdentifierAuthority());
  for (int i=0; i < sid.getSubAuthorities().length; i++) {
    packetOut.writeInt((int)(sid.getSubAuthorities()[i]));
  }
}

Fixed version (ground truth):
@Override public void marshal(PacketOutput packetOut) throws IOException {
  packetOut.write(handle.getBytes());
  packetOut.writeInt((int)EnumUtils.toLong(desiredAccess));
  packetOut.writeInt(sid.getSubAuthorities().length);
  packetOut.writeByte(sid.getRevision());
  packetOut.writeByte((byte)(sid.getSubAuthorities().length));
  packetOut.write(sid.getSidIdentifierAuthority());
  for (int i=0; i < sid.getSubAuthorities().length; i++) {
    packetOut.writeInt((int)(sid.getSubAuthorities()[i]));
  }
}
Program: 175589
Project: 175589
Buggy source:
/** 
 * The BaseRegEnumKey method is called by the client in order to enumerate a subkey. In response, the server returns a requested subkey.
 * @param hKey A handle to a key that MUST have been opened previously by using one of the open methods:{@link OpenClassesRoot},   {@link OpenCurrentUser},   {@link OpenLocalMachine},   {@link OpenPerformanceData},  {@link OpenUsers},   {@link BaseRegCreateKey},   {@link BaseRegOpenKey},   {@link OpenCurrentConfig},  {@link OpenPerformanceText},   {@link OpenPerformanceNlsText}.
 * @param index The index of the subkey to retrieve.
 * @param nameLen The maximum length of the subkey name to retrieve.
 * @param classLen The maximum length of the subkey class to retrieve.
 */
public BaseRegEnumKeyRequest(final ContextHandle hKey,final int index,final int nameLen,final int classLen){
  super((short)9);
  putBytes(hKey.getBytes());
  putInt(index);
  putStringBuffer(nameLen);
  putStringBufferRef(classLen);
  putLongRef(Long.valueOf(0));
}

Fixed version (ground truth):
/** 
 * The BaseRegEnumKey method is called by the client in order to enumerate a subkey. In response, the server returns a requested subkey.
 * @param hKey A handle to a key that MUST have been opened previously by using one of the open methods:{@link OpenClassesRoot},   {@link OpenCurrentUser},   {@link OpenLocalMachine},   {@link OpenPerformanceData},  {@link OpenUsers}, BaseRegCreateKey,   {@link BaseRegOpenKey},   {@link OpenCurrentConfig},  {@link OpenPerformanceText},   {@link OpenPerformanceNlsText}.
 * @param index The index of the subkey to retrieve.
 * @param nameLen The maximum length of the subkey name to retrieve.
 * @param classLen The maximum length of the subkey class to retrieve.
 */
public BaseRegEnumKeyRequest(final ContextHandle hKey,final int index,final int nameLen,final int classLen){
  super((short)9);
  putBytes(hKey.getBytes());
  putInt(index);
  putStringBuffer(nameLen);
  putStringBufferRef(classLen);
  putLongRef(Long.valueOf(0));
}
Program: 175590
Project: 175590
Buggy source:
/** 
 * @return The method returns 0 (ERROR_SUCCESS) to indicate success; otherwise, it returns a nonzero error code, asspecified in  {@link com.rapid7.client.dcerpc.mserref.SystemErrorCode} in [MS-ERREF]. The most commonerror codes are listed in the following table.<br> <br> <table border="1"> <tr> <td>Return value/code</td> <td>Description</td> <tr> <tr> <td>ERROR_ACCESS_DENIED (0x00000005)</td> <td>The caller does not have KEY_ENUMERATE_SUB_KEYS access rights.</td> </tr> <tr> <td>ERROR_OUTOFMEMORY (0x0000000E)</td> <td>Not enough storage is available to complete this operation.</td> </tr> <tr> <td>ERROR_INVALID_PARAMETER (0x00000057)</td> <td>A parameter is incorrect.</td> </tr> <tr> <td>ERROR_NO_MORE_ITEMS (0x00000103)</td> <td>No more data is available.</td> </tr> <tr> <td>ERROR_WRITE_PROTECT (0x00000013)</td> <td>A read or write operation was attempted to a volume after it was dismounted. The server can no longer service registry requests because server shutdown has been initiated.</td> </tr> <tr> <td>ERROR_MORE_DATA (0x000000EA)</td> <td>The size of the buffer is not large enough to hold the requested data.</td> </tr> </table>
 */
public int getReturnValue(){
  return returnValue;
}

Fixed version (ground truth):
/** 
 * @return The method returns 0 (ERROR_SUCCESS) to indicate success; otherwise, it returns a nonzero error code, asspecified in  {@link com.rapid7.client.dcerpc.mserref.SystemErrorCode} in [MS-ERREF]. The most commonerror codes are listed in the following table.<br> <br> <table border="1" summary=""> <tr> <td>Return value/code</td> <td>Description</td> <tr> <tr> <td>ERROR_ACCESS_DENIED (0x00000005)</td> <td>The caller does not have KEY_ENUMERATE_SUB_KEYS access rights.</td> </tr> <tr> <td>ERROR_OUTOFMEMORY (0x0000000E)</td> <td>Not enough storage is available to complete this operation.</td> </tr> <tr> <td>ERROR_INVALID_PARAMETER (0x00000057)</td> <td>A parameter is incorrect.</td> </tr> <tr> <td>ERROR_NO_MORE_ITEMS (0x00000103)</td> <td>No more data is available.</td> </tr> <tr> <td>ERROR_WRITE_PROTECT (0x00000013)</td> <td>A read or write operation was attempted to a volume after it was dismounted. The server can no longer service registry requests because server shutdown has been initiated.</td> </tr> <tr> <td>ERROR_MORE_DATA (0x000000EA)</td> <td>The size of the buffer is not large enough to hold the requested data.</td> </tr> </table>
 */
public int getReturnValue(){
  return returnValue;
}
Program: 175591
Project: 175591
Buggy source:
/** 
 * The BaseRegEnumValue method is called by the client. In response, the server enumerates the value at the specified index for the specified registry key.
 * @param hKey A handle to a key that MUST have been opened previously by using one of the open methods:{@link OpenClassesRoot},   {@link OpenCurrentUser},   {@link OpenLocalMachine},   {@link OpenPerformanceData},  {@link OpenUsers},   {@link BaseRegCreateKey},   {@link BaseRegOpenKey},   {@link OpenCurrentConfig},  {@link OpenPerformanceText},   {@link OpenPerformanceNlsText}.
 * @param index The index of the value to be retrieved.
 * @param valueNameLen The maximum length of the value name to be retrieved.
 * @param dataLen The maximum length of the value data to be retrieved.
 */
public BaseRegEnumValueRequest(final ContextHandle hKey,final int index,final int valueNameLen,final int dataLen){
  super((short)10);
  putBytes(hKey.getBytes());
  putInt(index);
  putStringBuffer(valueNameLen);
  putIntRef(0);
  putEmptyArrayRef(dataLen);
  putIntRef(dataLen);
  putIntRef(0);
}

Fixed version (ground truth):
/** 
 * The BaseRegEnumValue method is called by the client. In response, the server enumerates the value at the specified index for the specified registry key.
 * @param hKey A handle to a key that MUST have been opened previously by using one of the open methods:{@link OpenClassesRoot},   {@link OpenCurrentUser},   {@link OpenLocalMachine},   {@link OpenPerformanceData},  {@link OpenUsers}, BaseRegCreateKey,   {@link BaseRegOpenKey},   {@link OpenCurrentConfig},  {@link OpenPerformanceText},   {@link OpenPerformanceNlsText}.
 * @param index The index of the value to be retrieved.
 * @param valueNameLen The maximum length of the value name to be retrieved.
 * @param dataLen The maximum length of the value data to be retrieved.
 */
public BaseRegEnumValueRequest(final ContextHandle hKey,final int index,final int valueNameLen,final int dataLen){
  super((short)10);
  putBytes(hKey.getBytes());
  putInt(index);
  putStringBuffer(valueNameLen);
  putIntRef(0);
  putEmptyArrayRef(dataLen);
  putIntRef(dataLen);
  putIntRef(0);
}
Program: 175592
Project: 175592
Buggy source:
/** 
 * @return The method returns 0 (ERROR_SUCCESS) to indicate success; otherwise, it returns a nonzero error code, asspecified in  {@link com.rapid7.client.dcerpc.mserref.SystemErrorCode} in [MS-ERREF]. The most commonerror codes are listed in the following table.<br> <br> <table border="1"> <tr> <td>ERROR_ACCESS_DENIED (0x00000005)</td> <td>The caller does not have KEY_QUERY_VALUE access rights.</td> </tr> <tr> <td>ERROR_OUTOFMEMORY (0x0000000E)</td> <td>Not enough storage is available to complete this operation.</td> </tr> <tr> <td>ERROR_INVALID_PARAMETER (0x00000057)</td> <td>A parameter is incorrect.</td> </tr> <tr> <td>ERROR_INSUFFICIENT_BUFFER (0x0000007A)</td> <td>The data area passed to a system call is too small.</td> </tr> <tr> <td>ERROR_MORE_DATA (0x000000EA)</td> <td>More data is available.</td> </tr> <tr> <td>ERROR_NO_MORE_ITEMS (0x00000103)</td> <td>No more data is available.</td> </tr> <tr> <td>ERROR_WRITE_PROTECT (0x00000013)</td> <td>A read or write operation was attempted to a volume after it was dismounted. The server can no longer service registry requests because server shutdown has been initiated.</td> </tr> </table>
 */
public int getReturnValue(){
  return returnValue;
}

Fixed version (ground truth):
/** 
 * @return The method returns 0 (ERROR_SUCCESS) to indicate success; otherwise, it returns a nonzero error code, asspecified in  {@link com.rapid7.client.dcerpc.mserref.SystemErrorCode} in [MS-ERREF]. The most commonerror codes are listed in the following table.<br> <br> <table border="1" summary=""> <tr> <td>ERROR_ACCESS_DENIED (0x00000005)</td> <td>The caller does not have KEY_QUERY_VALUE access rights.</td> </tr> <tr> <td>ERROR_OUTOFMEMORY (0x0000000E)</td> <td>Not enough storage is available to complete this operation.</td> </tr> <tr> <td>ERROR_INVALID_PARAMETER (0x00000057)</td> <td>A parameter is incorrect.</td> </tr> <tr> <td>ERROR_INSUFFICIENT_BUFFER (0x0000007A)</td> <td>The data area passed to a system call is too small.</td> </tr> <tr> <td>ERROR_MORE_DATA (0x000000EA)</td> <td>More data is available.</td> </tr> <tr> <td>ERROR_NO_MORE_ITEMS (0x00000103)</td> <td>No more data is available.</td> </tr> <tr> <td>ERROR_WRITE_PROTECT (0x00000013)</td> <td>A read or write operation was attempted to a volume after it was dismounted. The server can no longer service registry requests because server shutdown has been initiated.</td> </tr> </table>
 */
public int getReturnValue(){
  return returnValue;
}
Program: 175594
Project: 175594
Buggy source:
/** 
 * The BaseRegQueryInfoKey method is called by the client. In response, the server returns relevant information on the key that corresponds to the specified key handle.
 * @param hKey A handle to a key that MUST have been opened previously by using one of the open methods that arespecified in section 3.1.5:  {@link OpenClassesRoot},   {@link OpenCurrentUser},   {@link OpenLocalMachine},  {@link OpenPerformanceData},   {@link OpenUsers},   {@link BaseRegCreateKey},   {@link BaseRegOpenKey},  {@link OpenCurrentConfig},   {@link OpenPerformanceText},   {@link OpenPerformanceNlsText}.
 */
public BaseRegQueryInfoKeyRequest(final ContextHandle hKey){
  super((short)16);
  putBytes(hKey.getBytes());
  putStringBuffer(0);
}

Fixed version (ground truth):
/** 
 * The BaseRegQueryInfoKey method is called by the client. In response, the server returns relevant information on the key that corresponds to the specified key handle.
 * @param hKey A handle to a key that MUST have been opened previously by using one of the open methods that arespecified in section 3.1.5:  {@link OpenClassesRoot},   {@link OpenCurrentUser},   {@link OpenLocalMachine},  {@link OpenPerformanceData},   {@link OpenUsers}, BaseRegCreateKey,   {@link BaseRegOpenKey},  {@link OpenCurrentConfig},   {@link OpenPerformanceText},   {@link OpenPerformanceNlsText}.
 */
public BaseRegQueryInfoKeyRequest(final ContextHandle hKey){
  super((short)16);
  putBytes(hKey.getBytes());
  putStringBuffer(0);
}
Program: 175595
Project: 175595
Buggy source:
/** 
 * @return The method returns 0 (ERROR_SUCCESS) to indicate success; otherwise, it returns a nonzero error code, asspecified in  {@link com.rapid7.client.dcerpc.mserref.SystemErrorCode} in [MS-ERREF]. The most commonerror codes are listed in the following table. <table> <td> <td>Return value/code</td> <td>Description</td> </tr> <td> <td>ERROR_ACCESS_DENIED (0x00000005)</td> <td>The caller does not have KEY_QUERY_VALUE access rights.</td> </tr> <td> <td>ERROR_INVALID_PARAMETER (0x00000057)</td> <td>A parameter is incorrect.</td> </tr> <td> <td>ERROR_WRITE_PROTECT (0x00000013)</td> <td>A read or write operation was attempted to a volume after it was dismounted. The server can no longer service registry requests because server shutdown has been initiated.</td> </tr> <td> <td>ERROR_MORE_DATA (0x000000EA)</td> <td>The size of the buffer is not large enough to hold the requested data.</td> </tr> </table>
 */
public int getReturnValue(){
  return returnValue;
}

Fixed version (ground truth):
/** 
 * @return The method returns 0 (ERROR_SUCCESS) to indicate success; otherwise, it returns a nonzero error code, asspecified in  {@link com.rapid7.client.dcerpc.mserref.SystemErrorCode} in [MS-ERREF]. The most commonerror codes are listed in the following table. <table border="1" summary=""> <tr> <td>Return value/code</td> <td>Description</td> </tr> <tr> <td>ERROR_ACCESS_DENIED (0x00000005)</td> <td>The caller does not have KEY_QUERY_VALUE access rights.</td> </tr> <tr> <td>ERROR_INVALID_PARAMETER (0x00000057)</td> <td>A parameter is incorrect.</td> </tr> <tr> <td>ERROR_WRITE_PROTECT (0x00000013)</td> <td>A read or write operation was attempted to a volume after it was dismounted. The server can no longer service registry requests because server shutdown has been initiated.</td> </tr> <tr> <td>ERROR_MORE_DATA (0x000000EA)</td> <td>The size of the buffer is not large enough to hold the requested data.</td> </tr> </table>
 */
public int getReturnValue(){
  return returnValue;
}
Program: 175596
Project: 175596
Buggy source:
@Override public <T extends RPCResponse>T transact(final RPCRequest<T> request) throws IOException {
  final int callID;
synchronized (this) {
    callID=this.callID++;
  }
  final byte[] requestBytes=request.marshal(callID);
  final byte[] responseBytes=new byte[MAXIMUM_TRANSACT_SIZE];
  namedPipe.transact(requestBytes,responseBytes);
  return request.unmarshal(responseBytes,callID);
}

Fixed version (ground truth):
@Override public <T extends RPCResponse>T transact(final RPCRequest<T> request) throws IOException {
  final int callID;
synchronized (this) {
    callID=this.callID++;
  }
  final byte[] requestBytes=request.marshal(callID);
  final byte[] responseBytes=namedPipe.transact(requestBytes);
  return request.unmarshal(responseBytes,callID);
}
Program: 175597
Project: 175597
Buggy source:
/** 
 * 删除
 * @param startPos
 */
public void removeRangePartial(int startPos,int count){
  mCompletedBrickInfoList.removeAll(mCompletedBrickInfoList.subList(startPos,startPos + count));
  rebuildPositionCache(mCompletedBrickInfoList);
  mAdapter.removeRange(startPos,count);
}

Fixed version (ground truth):
/** 
 * 删除
 * @param startPos
 */
public void removeRangePartial(int startPos,int count){
  mCompletedBrickInfoList.removeAll(new ArrayList<>(mCompletedBrickInfoList).subList(startPos,startPos + count));
  rebuildPositionCache(mCompletedBrickInfoList);
  mAdapter.removeRange(startPos,count);
}
Program: 175598
Project: 175598
Buggy source:
public boolean isValidity(){
  return !FP.empty(viewEventElementMap);
}

Fixed version (ground truth):
public boolean isValidity(){
  return !FP.empty(viewEventElementMap) || !FP.empty(brickEventElementMap);
}
Program: 175599
Project: 175599
Buggy source:
private Element findHandlerElementByValue(String value,Set<? extends Element> brickEventHandlerElementSet){
  for (  Element element : brickEventHandlerElementSet) {
    String handlerValue=element.getAnnotation(BrickEventHandler.class).value();
    if (value.equals(handlerValue)) {
      return element;
    }
  }
  return null;
}

Fixed version (ground truth):
private Element findHandlerElementByValue(String value,Set<? extends Element> brickEventHandlerElementSet){
  for (  Element element : brickEventHandlerElementSet) {
    String handlerValue=element.getAnnotation(BrickEventHandler.class).value();
    if (value.equals(handlerValue)) {
      return element;
    }
  }
  error("String_Node_Str" + value);
  return null;
}
Program: 175600
Project: 175600
Buggy source:
private Element findViewElementByValue(String value,Set<? extends Element> viewElementSet){
  for (  Element element : viewElementSet) {
    String viewValue=element.getAnnotation(BrickView.class).value();
    if (value.equals(viewValue)) {
      return element;
    }
  }
  return null;
}

Fixed version (ground truth):
private Element findViewElementByValue(String value,Set<? extends Element> viewElementSet){
  for (  Element element : viewElementSet) {
    String viewValue=element.getAnnotation(BrickView.class).value();
    if (value.equals(viewValue)) {
      return element;
    }
  }
  error("String_Node_Str" + value);
  return null;
}