nus-yam/ex-repair huggingface dataset:
Program: 30835
Project: 30835
Buggy source:
@Override public void onChange(){
  cachedInv=null;
  int olderSize=oldSize;
  oldSize=getDest().getSizeInventory();
  if (olderSize != oldSize) {
    getHost().PartChanged();
    tile.worldObj.notifyBlocksOfNeighborChange(tile.xCoord,tile.yCoord,tile.zCoord,0);
  }
}

Fixed version (ground truth):
@Override public void onChange(){
  if (!output) {
    cachedInv=null;
    int olderSize=oldSize;
    oldSize=getDest().getSizeInventory();
    if (olderSize != oldSize) {
      getHost().PartChanged();
      tile.worldObj.notifyBlocksOfNeighborChange(tile.xCoord,tile.yCoord,tile.zCoord,0);
    }
  }
 else {
    PartP2PItems input=getInput();
    if (input != null)     input.onChange();
  }
}
Program: 30837
Project: 30837
Buggy source:
@Override public boolean registerNewLayer(String layer,Class<?> layerInterface){
  if (interfaces2Layer.get(layerInterface) == null) {
    desc.add(layerInterface.getName());
    interfaces2Layer.put(layerInterface,layer);
  }
 else   AELog.info("String_Node_Str" + layer + "String_Node_Str"+ layerInterface.getName()+ "String_Node_Str");
  return false;
}

Fixed version (ground truth):
@Override public boolean registerNewLayer(String layer,String layerInterface){
  try {
    if (interfaces2Layer.get(layerInterface) == null) {
      interfaces2Layer.put(Class.forName(layerInterface),layer);
      desc.add(layerInterface);
      return true;
    }
 else     AELog.info("String_Node_Str" + layer + "String_Node_Str"+ layerInterface+ "String_Node_Str");
  }
 catch (  Throwable t) {
  }
  return false;
}
Program: 30838
Project: 30838
Buggy source:
@Override public void Init(){
  AEApi.instance().partHelper().registerNewLayer("String_Node_Str",IPipeConnection.class);
  AEApi.instance().registries().externalStorage().addExternalStorageInterface(new BCPipeHandler());
}

Fixed version (ground truth):
@Override public void Init(){
  AEApi.instance().partHelper().registerNewLayer("String_Node_Str","String_Node_Str");
  AEApi.instance().registries().externalStorage().addExternalStorageInterface(new BCPipeHandler());
}
Program: 30839
Project: 30839
Buggy source:
private void updateTunnel(long freq,boolean updateOutputs){
  if (updateOutputs) {
    for (    PartP2PTunnel p : outputs.values())     p.onChange();
  }
 else {
    for (    PartP2PTunnel p : inputs.values())     p.onChange();
  }
}

Fixed version (ground truth):
private void updateTunnel(long freq,boolean updateOutputs){
  for (  PartP2PTunnel p : outputs.get(freq))   p.onChange();
  PartP2PTunnel in=inputs.get(freq);
  if (in != null)   in.onChange();
}
Program: 30840
Project: 30840
Buggy source:
public FacadePart(ItemStack facade,ForgeDirection side){
  if (facade == null)   throw new RuntimeException("String_Node_Str");
  facade.stackSize=1;
  this.facade=facade;
  this.side=side;
}

Fixed version (ground truth):
public FacadePart(ItemStack facade,ForgeDirection side){
  if (facade == null)   throw new RuntimeException("String_Node_Str");
  this.facade=facade.copy();
  this.facade.stackSize=1;
  this.side=side;
}
Program: 30841
Project: 30841
Buggy source:
private int getMaxInstalled(Upgrades u){
  Integer max=null;
  for (  ItemStack is : u.getSupported().keySet()) {
    if (is.getItem() == itemorblock) {
      max=u.getSupported().get(is);
      break;
    }
 else     if (is.getItem() instanceof ItemBlock && Block.blocksList[((ItemBlock)is.getItem()).getBlockID()] == itemorblock) {
      max=u.getSupported().get(is);
      break;
    }
  }
  if (max == null)   return 0;
  return max;
}

Fixed version (ground truth):
private int getMaxInstalled(Upgrades u){
  Integer max=null;
  for (  ItemStack is : u.getSupported().keySet()) {
    if (is.getItem() == itemorblock) {
      max=u.getSupported().get(is);
      break;
    }
 else     if (is.getItem() instanceof ItemBlock && Block.blocksList[((ItemBlock)is.getItem()).getBlockID()] == itemorblock) {
      max=u.getSupported().get(is);
      break;
    }
 else     if (itemorblock instanceof ItemStack && Platform.isSameItem((ItemStack)itemorblock,is)) {
      max=u.getSupported().get(is);
      break;
    }
  }
  if (max == null)   return 0;
  return max;
}
Program: 30842
Project: 30842
Buggy source:
public void readClass(Class listAs,Class c){
  if (readClasses.contains(c))   return;
  readClasses.add(c);
  for (  Method m : c.getMethods()) {
    MENetworkEventSubscribe s=m.getAnnotation(MENetworkEventSubscribe.class);
    if (s != null) {
      Class types[]=m.getParameterTypes();
      if (types.length == 1) {
        if (MENetworkEvent.class.isAssignableFrom(types[0])) {
          Hashtable<Class,MENetworkEventInfo> classEvents=events.get(types[0]);
          if (classEvents == null)           events.put(types[0],classEvents=new Hashtable());
          classEvents.put(listAs,new MENetworkEventInfo(types[0],c,m));
        }
 else         throw new RuntimeException("String_Node_Str" + m.getName() + "String_Node_Str");
      }
 else       throw new RuntimeException("String_Node_Str" + m.getName() + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void readClass(Class listAs,Class c){
  if (readClasses.contains(c))   return;
  readClasses.add(c);
  for (  Method m : c.getMethods()) {
    MENetworkEventSubscribe s=m.getAnnotation(MENetworkEventSubscribe.class);
    if (s != null) {
      Class types[]=m.getParameterTypes();
      if (types.length == 1) {
        if (MENetworkEvent.class.isAssignableFrom(types[0])) {
          Hashtable<Class,MENetworkEventInfo> classEvents=events.get(types[0]);
          if (classEvents == null)           events.put(types[0],classEvents=new Hashtable());
          MENetworkEventInfo thisEvent=classEvents.get(listAs);
          if (thisEvent == null)           thisEvent=new MENetworkEventInfo();
          thisEvent.Add(types[0],c,m);
          classEvents.put(listAs,thisEvent);
        }
 else         throw new RuntimeException("String_Node_Str" + m.getName() + "String_Node_Str");
      }
 else       throw new RuntimeException("String_Node_Str" + m.getName() + "String_Node_Str");
    }
  }
}
Program: 30843
Project: 30843
Buggy source:
public void invoke(Object obj,MENetworkEvent e) throws NetworkEventDone {
  try {
    objMethod.invoke(obj,e);
  }
 catch (  Throwable e1) {
    FMLLog.severe("String_Node_Str");
    FMLLog.severe("String_Node_Str" + obj.getClass().getName());
    FMLLog.severe("String_Node_Str" + obj.toString());
    e1.printStackTrace();
    throw new RuntimeException(e1);
  }
  if (e.isCanceled())   throw new NetworkEventDone();
}

Fixed version (ground truth):
public void invoke(Object obj,MENetworkEvent e) throws NetworkEventDone {
  for (  EventMethod em : methods)   em.invoke(obj,e);
}
Program: 30846
Project: 30846
Buggy source:
public static int generateTileHash(TileEntity target){
  if (target == null)   return 0;
  int hash=target.hashCode();
  if (target instanceof IInventory)   hash^=((IInventory)target).getSizeInventory();
  if (target instanceof ISidedInventory) {
    for (    ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
      int offset=0;
      for (      Integer Side : ((ISidedInventory)target).getAccessibleSlotsFromSide(dir.ordinal())) {
        hash^=Side << (offset++ % 20);
      }
    }
  }
  return hash;
}

Fixed version (ground truth):
public static int generateTileHash(TileEntity target){
  if (target == null)   return 0;
  int hash=target.hashCode();
  if (target instanceof TileEntityChest) {
    TileEntityChest targ=(TileEntityChest)target;
    targ.checkForAdjacentChests();
    if (targ.adjacentChestZNeg != null)     hash^=targ.adjacentChestZNeg.hashCode();
 else     if (targ.adjacentChestZPosition != null)     hash^=targ.adjacentChestZPosition.hashCode();
 else     if (targ.adjacentChestXPos != null)     hash^=targ.adjacentChestXPos.hashCode();
 else     if (targ.adjacentChestXNeg != null)     hash^=targ.adjacentChestXNeg.hashCode();
  }
 else   if (target instanceof IInventory) {
    hash^=((IInventory)target).getSizeInventory();
    if (target instanceof ISidedInventory) {
      for (      ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
        int offset=0;
        for (        Integer Side : ((ISidedInventory)target).getAccessibleSlotsFromSide(dir.ordinal())) {
          hash^=Side << (offset++ % 20);
        }
      }
    }
  }
  return hash;
}
Program: 30847
Project: 30847
Buggy source:
@Override public int compareTo(TickTracker t){
  return (int)((host.getCurrentTick() - lastTick) + current_rate);
}

Fixed version (ground truth):
@Override public int compareTo(TickTracker t){
  int nextTick=(int)((lastTick - host.getCurrentTick()) + current_rate);
  int ts_nextTick=(int)((t.lastTick - host.getCurrentTick()) + t.current_rate);
  return nextTick - ts_nextTick;
}
Program: 30848
Project: 30848
Buggy source:
/** 
 * save all settings using config manager.
 * @param tagCompound
 */
@Override public void writeToNBT(NBTTagCompound tagCompound){
  for (  Enum e : Settings.keySet()) {
    tagCompound.setString(e.name(),e.name());
  }
}

Fixed version (ground truth):
/** 
 * save all settings using config manager.
 * @param tagCompound
 */
@Override public void writeToNBT(NBTTagCompound tagCompound){
  for (  Enum e : Settings.keySet()) {
    tagCompound.setString(e.name(),Settings.get(e).toString());
  }
}
Program: 30849
Project: 30849
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_do_login);
  serverDetails=PreferenceManager.getDefaultSharedPreferences(this);
  serverip=serverDetails.getString("String_Node_Str",null);
  serverport=serverDetails.getString("String_Node_Str",null);
  if (serverip != null && serverport != null) {
    Intent data=getIntent();
    username=data.getStringExtra("String_Node_Str");
    password=data.getStringExtra("String_Node_Str");
    new RequestTask().execute("String_Node_Str");
  }
 else {
    Intent setupServerdetails=new Intent(this,FilePrefActivity.class);
    startActivity(setupServerdetails);
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_do_login);
  finish();
  serverDetails=PreferenceManager.getDefaultSharedPreferences(this);
  serverip=serverDetails.getString("String_Node_Str",null);
  serverport=serverDetails.getString("String_Node_Str",null);
  if (serverip != null && serverport != null) {
    Intent data=getIntent();
    username=data.getStringExtra("String_Node_Str");
    password=data.getStringExtra("String_Node_Str");
    new RequestTask().execute("String_Node_Str");
  }
 else {
    Intent setupServerdetails=new Intent(this,FilePrefActivity.class);
    startActivity(setupServerdetails);
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
  }
}
Program: 30850
Project: 30850
Buggy source:
protected void setPreferences(){
  String serverportSaved=edit_serverport.getText().toString();
  String serveripSaved=edit_serverip.getText().toString();
  String IP_PATTERN="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  Pattern p=Pattern.compile(IP_PATTERN);
  Matcher m=p.matcher(serveripSaved);
  if (serveripSaved != null && m.matches()) {
    String PORT_PATTERN="String_Node_Str";
    Pattern p2=Pattern.compile(PORT_PATTERN);
    Matcher m2=p2.matcher(serverportSaved);
    if (serverportSaved != null && m2.matches()) {
      editor.putString("String_Node_Str",serveripSaved);
      editor.putString("String_Node_Str",serverportSaved);
      editor.commit();
      Intent backtoLogin=new Intent(this,LoginActivity.class);
      startActivity(backtoLogin);
      Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
      finish();
    }
 else {
      Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
    }
  }
 else {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
  }
}

Fixed version (ground truth):
protected void setPreferences(){
  String serverportSaved=edit_serverport.getText().toString();
  String serveripSaved=edit_serverip.getText().toString();
  String IP_PATTERN="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  Pattern p=Pattern.compile(IP_PATTERN);
  Matcher m=p.matcher(serveripSaved);
  if (serveripSaved != null && m.matches()) {
    String PORT_PATTERN="String_Node_Str";
    Pattern p2=Pattern.compile(PORT_PATTERN);
    Matcher m2=p2.matcher(serverportSaved);
    if (serverportSaved != null && m2.matches()) {
      editor.putString("String_Node_Str",serveripSaved);
      editor.putString("String_Node_Str",serverportSaved);
      editor.commit();
      Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
      finish();
    }
 else {
      Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
    }
  }
 else {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
  }
}
Program: 30851
Project: 30851
Buggy source:
private static Control findNextFilter(){
  if (lastFocusedIndex != -1) {
    Control lastFocused=FILTERS.get(lastFocusedIndex);
    if (!lastFocused.isFocused()) {
      return lastFocused;
    }
  }
  int focused=findCurrentFilter();
  if (focused == -1) {
    focused=0;
  }
 else {
    int iterations=0;
    while (iterations < FILTERS.size()) {
      iterations++;
      focused++;
      if (focused >= FILTERS.size()) {
        focused=0;
      }
      boolean isFocusable=FILTERS.get(focused).getScene() != null;
      if (isFocusable)       break;
    }
  }
  return FILTERS.get(focused);
}

Fixed version (ground truth):
private static Control findNextFilter(){
  if (lastFocusedIndex != -1) {
    Control lastFocused=FILTERS.get(lastFocusedIndex);
    if (!lastFocused.isFocused() && lastFocused.isVisible() && lastFocused.getScene() != null) {
      return lastFocused;
    }
  }
  int focused=findCurrentFilter();
  if (focused == -1) {
    focused=0;
  }
  int iterations=0;
  while (iterations < FILTERS.size()) {
    iterations++;
    focused++;
    if (focused >= FILTERS.size()) {
      focused=0;
    }
    boolean isFocusable=FILTERS.get(focused).getScene() != null;
    if (isFocusable)     break;
  }
  return FILTERS.get(focused);
}
Program: 30852
Project: 30852
Buggy source:
public void stopAllTraces() throws IOException, OtpErlangException {
  sendRPC("String_Node_Str","String_Node_Str",list());
  receiveRPC();
}

Fixed version (ground truth):
public synchronized void stopAllTraces() throws IOException, OtpErlangException {
  sendRPC("String_Node_Str","String_Node_Str",list());
  receiveRPC();
}
Program: 30853
Project: 30853
Buggy source:
public OtpErlangList dictToPropslist(OtpErlangObject dict) throws IOException, OtpErlangException {
  sendRPC("String_Node_Str","String_Node_Str",list(dict));
  return (OtpErlangList)receiveRPC(5000);
}

Fixed version (ground truth):
public synchronized OtpErlangList dictToPropslist(OtpErlangObject dict) throws IOException, OtpErlangException {
  sendRPC("String_Node_Str","String_Node_Str",list(dict));
  return (OtpErlangList)receiveRPC(5000);
}
Program: 30854
Project: 30854
Buggy source:
private void removeErrorLoggerHandler() throws IOException, OtpErlangException {
  OtpErlangList args=OtpUtil.list(mbox.self());
  sendRPC("String_Node_Str","String_Node_Str",OtpUtil.list(ERLYBERLY_ATOM,args));
  receiveRPC();
}

Fixed version (ground truth):
private synchronized void removeErrorLoggerHandler() throws IOException, OtpErlangException {
  OtpErlangList args=OtpUtil.list(mbox.self());
  sendRPC("String_Node_Str","String_Node_Str",OtpUtil.list(ERLYBERLY_ATOM,args));
  receiveRPC();
}
Program: 30855
Project: 30855
Buggy source:
private void addErrorLoggerHandler() throws IOException, OtpErlangException {
  OtpErlangList args=OtpUtil.list(mbox.self());
  sendRPC("String_Node_Str","String_Node_Str",OtpUtil.list(ERLYBERLY_ATOM,args));
  receiveRPC();
}

Fixed version (ground truth):
private synchronized void addErrorLoggerHandler() throws IOException, OtpErlangException {
  OtpErlangList args=OtpUtil.list(mbox.self());
  sendRPC("String_Node_Str","String_Node_Str",OtpUtil.list(ERLYBERLY_ATOM,args));
  receiveRPC();
}
Program: 30856
Project: 30856
Buggy source:
public void complete(HashMap<Object,Object> resultMap){
  tracePropsToString=null;
  Object e=resultMap.get(EXCEPTION_FROM_ATOM);
  Object r=resultMap.get(RESULT_ATOM);
  Object ts=resultMap.get(TIMESTAMP_RETURN_ATOM);
  if (e != null)   map.put(EXCEPTION_FROM_ATOM,e);
  if (r != null) {
    map.put(RESULT_ATOM,r);
    String resultString=ErlyBerly.getTermFormatter().toString((OtpErlangObject)r);
    result.set(resultString);
  }
  if (ts != null)   map.put(TIMESTAMP_RETURN_ATOM,ts);
  duration.set(durationFromMap());
  Platform.runLater(() -> {
    summary.set(toString());
    complete.set(true);
  }
);
}

Fixed version (ground truth):
public void complete(HashMap<Object,Object> resultMap){
  tracePropsToString=null;
  Object e=resultMap.get(EXCEPTION_FROM_ATOM);
  Object ts=resultMap.get(TIMESTAMP_RETURN_ATOM);
  if (e != null) {
    map.put(EXCEPTION_FROM_ATOM,e);
  }
  Object r=getResultFromMap();
  if (r != null) {
    map.put(RESULT_ATOM,r);
    String resultString=ErlyBerly.getTermFormatter().toString((OtpErlangObject)r);
    result.set(resultString);
  }
  if (ts != null)   map.put(TIMESTAMP_RETURN_ATOM,ts);
  duration.set(durationFromMap());
  Platform.runLater(() -> {
    summary.set(toString());
    complete.set(true);
  }
);
}
Program: 30857
Project: 30857
Buggy source:
private static Control findNextFilter(){
  if (lastFocusedIndex != -1) {
    Control lastFocused=filters.get(lastFocusedIndex);
    if (!lastFocused.isFocused()) {
      return lastFocused;
    }
  }
  int focused=findCurrentFilter();
  if (focused == -1) {
    focused=0;
  }
 else {
    focused++;
    if (focused >= filters.size()) {
      focused=0;
    }
  }
  return filters.get(focused);
}

Fixed version (ground truth):
private static Control findNextFilter(){
  if (lastFocusedIndex != -1) {
    Control lastFocused=filters.get(lastFocusedIndex);
    if (!lastFocused.isFocused()) {
      return lastFocused;
    }
  }
  int focused=findCurrentFilter();
  if (focused == -1) {
    focused=0;
  }
 else {
    int iterations=0;
    while (iterations < filters.size()) {
      iterations++;
      focused++;
      if (focused >= filters.size()) {
        focused=0;
      }
      boolean isFocusable=filters.get(focused).getScene() != null;
      if (isFocusable)       break;
    }
  }
  return filters.get(focused);
}
Program: 30858
Project: 30858
Buggy source:
private void loadRemoteErlyberly() throws IOException, OtpErlangException {
  sendRPC("String_Node_Str","String_Node_Str",list(atom("String_Node_Str"),new OtpErlangString(ERLYBERLY_BEAM_PATH),new OtpErlangBinary(loadBeamFile())));
  OtpErlangObject result=receiveRPC();
  if (result instanceof OtpErlangTuple) {
    OtpErlangObject e0=((OtpErlangTuple)result).elementAt(0);
    if (!MODULE_ATOM.equals(e0)) {
      throw new RuntimeException("String_Node_Str" + result);
    }
  }
 else {
    throw new RuntimeException("String_Node_Str" + result);
  }
}

Fixed version (ground truth):
private void loadRemoteErlyberly() throws IOException, OtpErlangException {
  OtpErlangBinary otpErlangBinary=new OtpErlangBinary(loadBeamFile());
  System.out.println("String_Node_Str" + otpErlangBinary.size());
  sendRPC("String_Node_Str","String_Node_Str",list(atom("String_Node_Str"),new OtpErlangString(ERLYBERLY_BEAM_PATH),otpErlangBinary));
  OtpErlangObject result=receiveRPC();
  if (result instanceof OtpErlangTuple) {
    OtpErlangObject e0=((OtpErlangTuple)result).elementAt(0);
    if (!MODULE_ATOM.equals(e0)) {
      throw new RuntimeException("String_Node_Str" + result);
    }
  }
 else {
    throw new RuntimeException("String_Node_Str" + result);
  }
}
Program: 30859
Project: 30859
Buggy source:
private static byte[] loadBeamFile() throws IOException {
  InputStream resourceAsStream=OtpUtil.class.getResourceAsStream(ERLYBERLY_BEAM_PATH);
  byte[] b=new byte[BEAM_SIZE_LIMIT];
  int read=resourceAsStream.read(b);
  if (read >= BEAM_SIZE_LIMIT) {
    throw new RuntimeException("String_Node_Str");
  }
  return b;
}

Fixed version (ground truth):
private static byte[] loadBeamFile() throws IOException {
  InputStream resourceAsStream=OtpUtil.class.getResourceAsStream(ERLYBERLY_BEAM_PATH);
  byte[] b=new byte[BEAM_SIZE_LIMIT];
  int total=0;
  int read=0;
  do {
    total+=read;
    read=resourceAsStream.read(b,total,BEAM_SIZE_LIMIT - total);
  }
 while (read != -1);
  if (total >= BEAM_SIZE_LIMIT) {
    throw new RuntimeException("String_Node_Str");
  }
  return Arrays.copyOf(b,total);
}
Program: 30860
Project: 30860
Buggy source:
@Override protected void updateItem(T item,boolean empty){
  super.updateItem(item,empty);
  getGraphic().setVisible(!empty);
  if (controller != null) {
    controller.updateItem(item,empty);
  }
}

Fixed version (ground truth):
@Override protected void updateItem(T item,boolean empty){
  super.updateItem(item,empty);
  if (item == null || empty) {
    setGraphic(null);
    setText(null);
  }
 else {
    setGraphic(aControl);
    setText(null);
  }
  if (controller != null) {
    controller.updateItem(item,empty);
  }
}
Program: 30861
Project: 30861
Buggy source:
public FXTreeCell(CellController<T> aController,Parent aControl){
  controller=aController;
  setGraphic(aControl);
}

Fixed version (ground truth):
public FXTreeCell(CellController<T> aController,Parent aControl){
  controller=aController;
  this.aControl=aControl;
}
Program: 30862
Project: 30862
Buggy source:
protected void sendError(MessageInfo mi,RTMPCommand command,Object object,Object information){
  AMFPacket response=new AMFPacket();
  response.writeString("String_Node_Str");
  response.writeNumber(command.getTxid());
  response.writeMixed(null);
  response.writeMixed(null);
  context.writeCommand(mi.chunkStreamID,response);
}

Fixed version (ground truth):
protected void sendError(MessageInfo mi,RTMPCommand command,Object object,Object information){
  AMFPacket response=new AMFPacket();
  response.writeString("String_Node_Str");
  response.writeNumber(command.getTxid());
  response.writeMixed(object);
  response.writeMixed(information);
  context.writeCommand(mi.chunkStreamID,response);
}
Program: 30863
Project: 30863
Buggy source:
private void testAnimCircleIndicator(){
  mAnimCircleIndicator=(InfiniteIndicator)findViewById(R.id.infinite_anim_circle);
  IndicatorConfiguration configuration=new IndicatorConfiguration.Builder().imageLoader(new UILoader()).isStopWhileTouch(true).onPageChangeListener(this).onPageClickListener(this).direction(LEFT).position(IndicatorConfiguration.IndicatorPosition.Center).build();
  mAnimCircleIndicator.init(configuration);
  mAnimCircleIndicator.notifyDataChange(pageViews);
  mAnimCircleIndicator.setCurrentItem(3);
}

Fixed version (ground truth):
private void testAnimCircleIndicator(){
  mAnimCircleIndicator=(InfiniteIndicator)findViewById(R.id.infinite_anim_circle);
  IndicatorConfiguration configuration=new IndicatorConfiguration.Builder().imageLoader(new UILoader()).isStopWhileTouch(true).isLoop(false).onPageChangeListener(this).onPageClickListener(this).direction(LEFT).position(IndicatorConfiguration.IndicatorPosition.Center).build();
  mAnimCircleIndicator.init(configuration);
  mAnimCircleIndicator.notifyDataChange(pageViews);
  mAnimCircleIndicator.setCurrentItem(2);
}
Program: 30864
Project: 30864
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_my);
  RadioGroup rg=(RadioGroup)findViewById(R.id.radio_group);
  rg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    RadioGroup group,    int checkedId){
switch (checkedId) {
case R.id.theme_flavored_material:
        mTheme=-1;
      break;
case R.id.theme_material:
    mTheme=R.style.Theme_AlertDialogPro_Material;
  break;
case R.id.theme_material_light:
mTheme=R.style.Theme_AlertDialogPro_Material_Light;
break;
case R.id.theme_holo:
mTheme=R.style.Theme_AlertDialogPro_Holo;
break;
case R.id.theme_holo_light:
mTheme=R.style.Theme_AlertDialogPro_Holo_Light;
break;
case R.id.theme_native:
mTheme=NATIVE_THEME;
break;
}
}
}
);
findViewById(R.id.showMessage).setOnClickListener(this);
findViewById(R.id.showProgress).setOnClickListener(this);
findViewById(R.id.showProgressHorizontal).setOnClickListener(this);
findViewById(R.id.showList).setOnClickListener(this);
findViewById(R.id.showMultiChoiceList).setOnClickListener(this);
findViewById(R.id.showSingleChoiceList).setOnClickListener(this);
findViewById(R.id.showCustomView).setOnClickListener(this);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_my);
  RadioGroup rg=(RadioGroup)findViewById(R.id.radio_group);
  rg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    RadioGroup group,    int checkedId){
switch (checkedId) {
case R.id.theme_flavored_material:
        mTheme=-1;
      break;
case R.id.theme_material:
    mTheme=R.style.Theme_AlertDialogPro_Material;
  break;
case R.id.theme_material_light:
mTheme=R.style.Theme_AlertDialogPro_Material_Light;
break;
case R.id.theme_holo:
mTheme=R.style.Theme_AlertDialogPro_Holo;
break;
case R.id.theme_holo_light:
mTheme=R.style.Theme_AlertDialogPro_Holo_Light;
break;
case R.id.theme_native:
mTheme=NATIVE_THEME;
break;
}
}
}
);
findViewById(R.id.showMessage).setOnClickListener(this);
findViewById(R.id.showLongMessage).setOnClickListener(this);
findViewById(R.id.showProgress).setOnClickListener(this);
findViewById(R.id.showProgressHorizontal).setOnClickListener(this);
findViewById(R.id.showList).setOnClickListener(this);
findViewById(R.id.showMultiChoiceList).setOnClickListener(this);
findViewById(R.id.showSingleChoiceList).setOnClickListener(this);
findViewById(R.id.showCustomView).setOnClickListener(this);
}
Program: 30865
Project: 30865
Buggy source:
@Override public void setPadding(int left,int top,int right,int bottom){
  super.setPadding(left,top,right,bottom);
  mBasePadding=getPaddingLeftField();
}

Fixed version (ground truth):
@Override public void setPadding(int left,int top,int right,int bottom){
  super.setPadding(left,top,right,bottom);
  setBasePadding(isCheckMarkAtStart());
  updatePadding();
}
Program: 30866
Project: 30866
Buggy source:
/** 
 * Set the checkmark to a given Drawable. This will be drawn when   {@link #isChecked()} is true.
 * @param d The Drawable to use for the checkmark.
 */
public void setCheckMarkDrawable(Drawable d){
  if (mCheckMarkDrawable != null) {
    mCheckMarkDrawable.setCallback(null);
    unscheduleDrawable(mCheckMarkDrawable);
  }
  if (d != null) {
    d.setCallback(this);
    d.setVisible(getVisibility() == VISIBLE,false);
    d.setState(CHECKED_STATE_SET);
    setMinHeight(d.getIntrinsicHeight());
    mCheckMarkWidth=d.getIntrinsicWidth();
    mBasePadding=getPaddingLeftField();
    setPaddingLeftField(mCheckMarkWidth + mBasePadding);
    d.setState(getDrawableState());
  }
  mCheckMarkDrawable=d;
  requestLayout();
}

Fixed version (ground truth):
/** 
 * Set the checkmark to a given Drawable. This will be drawn when   {@link #isChecked()} is true.
 * @param d The Drawable to use for the checkmark.
 */
public void setCheckMarkDrawable(Drawable d){
  if (mCheckMarkDrawable != null) {
    mCheckMarkDrawable.setCallback(null);
    unscheduleDrawable(mCheckMarkDrawable);
  }
  if (d != null) {
    d.setCallback(this);
    d.setVisible(getVisibility() == VISIBLE,false);
    d.setState(CHECKED_STATE_SET);
    setMinHeight(d.getIntrinsicHeight());
    mCheckMarkWidth=d.getIntrinsicWidth();
    d.setState(getDrawableState());
  }
 else {
    mCheckMarkWidth=0;
  }
  mCheckMarkDrawable=d;
  updatePadding();
}
Program: 30867
Project: 30867
Buggy source:
private void updatePadding(){
  invokeResetPaddingToInitialValues();
  int newPadding=(mCheckMarkDrawable != null) ? mCheckMarkWidth + mBasePadding : mBasePadding;
  if (isCheckMarkAtStart()) {
    mNeedRequestlayout|=(getPaddingLeftField() != newPadding);
    setPaddingLeftField(newPadding);
  }
 else {
    mNeedRequestlayout|=(getPaddingRightField() != newPadding);
    setPaddingRightFeild(newPadding);
  }
  if (mNeedRequestlayout) {
    requestLayout();
    mNeedRequestlayout=false;
  }
}

Fixed version (ground truth):
private void updatePadding(){
  int newPadding=(mCheckMarkDrawable != null) ? mCheckMarkWidth + mBasePadding : mBasePadding;
  if (isCheckMarkAtStart()) {
    mNeedRequestlayout|=(getPaddingLeftField() != newPadding);
    setPaddingLeftField(newPadding);
  }
 else {
    mNeedRequestlayout|=(getPaddingRightField() != newPadding);
    setPaddingRightFeild(newPadding);
  }
  if (mNeedRequestlayout) {
    requestLayout();
    mNeedRequestlayout=false;
  }
}
Program: 30868
Project: 30868
Buggy source:
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @Override public void onRtlPropertiesChanged(int layoutDirection){
  super.onRtlPropertiesChanged(layoutDirection);
  updatePadding();
}

Fixed version (ground truth):
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @Override public void onRtlPropertiesChanged(int layoutDirection){
  super.onRtlPropertiesChanged(layoutDirection);
  invokeResetPaddingToInitialValues();
  setBasePadding(isCheckMarkAtStart());
  updatePadding();
}
Program: 30869
Project: 30869
Buggy source:
public CheckedTextViewCompat(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  final TintTypedArray a=TintTypedArray.obtainStyledAttributes(context,attrs,CHECKED_TEXT_VIEW_ATTRS,defStyle,0);
  final boolean checked=a.getBoolean(0,false);
  setChecked(checked);
  final Drawable d=a.getDrawable(1);
  if (d != null) {
    setCheckMarkDrawable(d);
  }
  a.recycle();
  mTintManager=a.getTintManager();
}

Fixed version (ground truth):
public CheckedTextViewCompat(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  setBasePadding(isCheckMarkAtStart());
  final TintTypedArray a=TintTypedArray.obtainStyledAttributes(context,attrs,CHECKED_TEXT_VIEW_ATTRS,defStyle,0);
  final boolean checked=a.getBoolean(0,false);
  setChecked(checked);
  final Drawable d=a.getDrawable(1);
  if (d != null) {
    setCheckMarkDrawable(d);
  }
  a.recycle();
  mTintManager=a.getTintManager();
}
Program: 30870
Project: 30870
Buggy source:
public CheckedTextViewCompat(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  TintTypedArray a=TintTypedArray.obtainStyledAttributes(context,attrs,CHECKED_TEXT_VIEW_ATTRS,defStyle,0);
  Drawable d=a.getDrawable(0);
  if (d != null) {
    setCheckMarkDrawable(d);
  }
  boolean checked=a.getBoolean(1,false);
  setChecked(checked);
  a.recycle();
  mTintManager=a.getTintManager();
}

Fixed version (ground truth):
public CheckedTextViewCompat(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  final TintTypedArray a=TintTypedArray.obtainStyledAttributes(context,attrs,CHECKED_TEXT_VIEW_ATTRS,defStyle,0);
  final boolean checked=a.getBoolean(0,false);
  setChecked(checked);
  final Drawable d=a.getDrawable(1);
  if (d != null) {
    setCheckMarkDrawable(d);
  }
  a.recycle();
  mTintManager=a.getTintManager();
}
Program: 30871
Project: 30871
Buggy source:
public KeySpec getKey(){
  return new KeySpec(generateKey(ARGUMENT_KEY_PREFIX,name),key);
}

Fixed version (ground truth):
public KeySpec getKey(){
  return key;
}
Program: 30872
Project: 30872
Buggy source:
public BundleFieldBinding(AnnotationType annotationType,String name,TypeMirror type,String bundleType,String key,boolean needsToBeCast,boolean canHaveDefault,boolean required){
  this.annotationType=annotationType;
  this.name=name;
  this.type=type;
  this.bundleType=bundleType;
  this.needsToBeCast=needsToBeCast;
  this.key=key;
  this.canHaveDefault=canHaveDefault;
  this.required=required;
}

Fixed version (ground truth):
public BundleFieldBinding(AnnotationType annotationType,String name,TypeMirror type,String bundleType,KeySpec key,boolean needsToBeCast,boolean canHaveDefault,boolean required){
  this.annotationType=annotationType;
  this.name=name;
  this.type=type;
  this.bundleType=bundleType;
  this.needsToBeCast=needsToBeCast;
  this.key=key;
  this.canHaveDefault=canHaveDefault;
  this.required=required;
}
Program: 30873
Project: 30873
Buggy source:
public KeySpec getKey(){
  return new KeySpec(generateKey(KEY_PREFIX,name),key);
}

Fixed version (ground truth):
public KeySpec getKey(){
  return key;
}
Program: 30874
Project: 30874
Buggy source:
public IntentFieldBinding(String name,TypeMirror type,String intentType,String key,Boolean needsToBeCast,boolean hasDefault,boolean required){
  this.name=name;
  this.type=type;
  this.intentType=intentType;
  this.key=key;
  this.needsToBeCast=needsToBeCast;
  this.hasDefault=hasDefault;
  this.required=required;
  this.arrayList=false;
}

Fixed version (ground truth):
public IntentFieldBinding(String name,TypeMirror type,String intentType,KeySpec key,Boolean needsToBeCast,boolean hasDefault,boolean required){
  this.name=name;
  this.type=type;
  this.intentType=intentType;
  this.key=key;
  this.needsToBeCast=needsToBeCast;
  this.hasDefault=hasDefault;
  this.required=required;
  this.arrayList=false;
}
Program: 30875
Project: 30875
Buggy source:
@Override public int compareTo(KeySpec o){
  int i=name.compareTo(o.name);
  if (i == 0) {
    return value.compareTo(o.value);
  }
  return i;
}

Fixed version (ground truth):
@Override public int compareTo(KeySpec o){
  int i;
  if (name == null) {
    if (o.name != null) {
      i=-1;
    }
 else {
      i=0;
    }
  }
 else   if (o.name == null) {
    i=1;
  }
 else {
    i=name.compareTo(o.name);
  }
  if (i == 0) {
    return value.compareTo(o.value);
  }
  return i;
}
Program: 30876
Project: 30876
Buggy source:
private void generateKeys(TypeSpec.Builder classBuilder){
  Set<KeySpec> keys=new TreeSet<KeySpec>();
  for (  MethodBinding method : methods) {
    keys.addAll(method.getKeys());
  }
  for (  KeySpec key : keys) {
    classBuilder.addField(FieldSpec.builder(String.class,key.getName(),PUBLIC,STATIC,FINAL).initializer("String_Node_Str",key.getValue()).build());
  }
}

Fixed version (ground truth):
private void generateKeys(TypeSpec.Builder classBuilder){
  Set<KeySpec> keys=new TreeSet<KeySpec>();
  for (  MethodBinding method : methods) {
    keys.addAll(method.getKeys());
  }
  for (  KeySpec key : keys) {
    if (StringUtils.isNotBlank(key.getName())) {
      classBuilder.addField(FieldSpec.builder(String.class,key.getName(),PUBLIC,STATIC,FINAL).initializer("String_Node_Str",key.getValue()).build());
    }
  }
}
Program: 30877
Project: 30877
Buggy source:
private String getKey(Element element,String keyPrefix){
  Key key=element.getAnnotation(Key.class);
  if (key != null) {
    return key.value();
  }
  return generateKey(keyPrefix,element.getSimpleName().toString());
}

Fixed version (ground truth):
private KeySpec getKey(Element element,String keyPrefix){
  Key key=element.getAnnotation(Key.class);
  if (key != null) {
    return new KeySpec(null,key.value());
  }
  String genKey=generateKey(keyPrefix,element.getSimpleName().toString());
  return new KeySpec(genKey,genKey);
}
Program: 30878
Project: 30878
Buggy source:
private IntentFieldBinding getIntentFieldBinding(Element element) throws InvalidTypeException {
  TypeMirror type=element.asType();
  if (type instanceof TypeVariable) {
    type=((TypeVariable)type).getUpperBound();
  }
  String name=element.getSimpleName().toString();
  String intentType=typeUtil.getIntentType(type);
  boolean arrayList=isIntentArrayList(intentType);
  String key=getKey(element,EXTRA_KEY_PREFIX);
  return new IntentFieldBinding(name,type,intentType,key,arrayList);
}

Fixed version (ground truth):
private IntentFieldBinding getIntentFieldBinding(Element element) throws InvalidTypeException {
  TypeMirror type=element.asType();
  if (type instanceof TypeVariable) {
    type=((TypeVariable)type).getUpperBound();
  }
  String name=element.getSimpleName().toString();
  String intentType=typeUtil.getIntentType(type);
  boolean arrayList=isIntentArrayList(intentType);
  KeySpec key=getKey(element,EXTRA_KEY_PREFIX);
  return new IntentFieldBinding(name,type,intentType,key,arrayList);
}
Program: 30879
Project: 30879
Buggy source:
private BundleFieldBinding getBundleFieldBinding(Element element) throws InvalidTypeException {
  TypeMirror type=element.asType();
  if (type instanceof TypeVariable) {
    type=((TypeVariable)type).getUpperBound();
  }
  String name=element.getSimpleName().toString();
  String bundleType=typeUtil.getBundleType(type);
  String key=getKey(element,ARG_KEY_PREFIX);
  return new BundleFieldBinding(name,type,bundleType,key);
}

Fixed version (ground truth):
private BundleFieldBinding getBundleFieldBinding(Element element) throws InvalidTypeException {
  TypeMirror type=element.asType();
  if (type instanceof TypeVariable) {
    type=((TypeVariable)type).getUpperBound();
  }
  String name=element.getSimpleName().toString();
  String bundleType=typeUtil.getBundleType(type);
  KeySpec key=getKey(element,ARG_KEY_PREFIX);
  return new BundleFieldBinding(name,type,bundleType,key);
}
Program: 30880
Project: 30880
Buggy source:
@Override public MethodSpec generateMethodSpec(TypeUtil typeUtil){
  String returnVarName=getReturnVarName(RETURN_VAR_NAME_ROOT);
  MethodSpec.Builder methodBuilder=MethodSpec.methodBuilder(name).addAnnotation(Override.class).addModifiers(PUBLIC).returns(ClassName.get(typeUtil.bundleType)).addStatement("String_Node_Str",ClassName.get(typeUtil.bundleType),returnVarName,ClassName.get(typeUtil.bundleType));
  for (  BundleFieldBinding fieldBinding : fields) {
    methodBuilder.addParameter(ClassName.get(fieldBinding.getType()),fieldBinding.getName());
    methodBuilder.addStatement("String_Node_Str",returnVarName,fieldBinding.getBundleType(),fieldBinding.getKey().getName(),fieldBinding.getName());
  }
  methodBuilder.addStatement("String_Node_Str",returnVarName);
  return methodBuilder.build();
}

Fixed version (ground truth):
@Override public MethodSpec generateMethodSpec(TypeUtil typeUtil){
  String returnVarName=getReturnVarName(RETURN_VAR_NAME_ROOT);
  MethodSpec.Builder methodBuilder=MethodSpec.methodBuilder(name).addAnnotation(Override.class).addModifiers(PUBLIC).returns(ClassName.get(typeUtil.bundleType)).addStatement("String_Node_Str",ClassName.get(typeUtil.bundleType),returnVarName,ClassName.get(typeUtil.bundleType));
  for (  BundleFieldBinding fieldBinding : fields) {
    methodBuilder.addParameter(ClassName.get(fieldBinding.getType()),fieldBinding.getName());
    String keyValue;
    String stmt="String_Node_Str";
    KeySpec key=fieldBinding.getKey();
    if (StringUtils.isBlank(key.getName())) {
      keyValue=key.getValue();
      stmt=stmt.concat("String_Node_Str");
    }
 else {
      keyValue=key.getName();
      stmt=stmt.concat("String_Node_Str");
    }
    stmt=stmt.concat("String_Node_Str");
    methodBuilder.addStatement(stmt,returnVarName,fieldBinding.getBundleType(),keyValue,fieldBinding.getName());
  }
  methodBuilder.addStatement("String_Node_Str",returnVarName);
  return methodBuilder.build();
}
Program: 30881
Project: 30881
Buggy source:
@Override public MethodSpec generateMethodSpec(TypeUtil typeUtil){
  String returnVarName=getReturnVarName(RETURN_VAR_NAME_ROOT);
  String argsVarName=getReturnVarName(ARGS_VAR_NAME_ROOT);
  MethodSpec.Builder methodBuilder=MethodSpec.methodBuilder(name).addAnnotation(Override.class).addModifiers(PUBLIC).returns(ClassName.get(returnType)).addStatement("String_Node_Str",ClassName.get(returnType),returnVarName,ClassName.get(returnType));
  if (!fields.isEmpty()) {
    methodBuilder.addStatement("String_Node_Str",ClassName.get(typeUtil.bundleType),argsVarName,ClassName.get(typeUtil.bundleType));
  }
  for (  BundleFieldBinding fieldBinding : fields) {
    methodBuilder.addParameter(ClassName.get(fieldBinding.getType()),fieldBinding.getName());
    methodBuilder.addStatement("String_Node_Str",argsVarName,fieldBinding.getBundleType(),fieldBinding.getKey().getName(),fieldBinding.getName());
  }
  if (!fields.isEmpty()) {
    methodBuilder.addStatement("String_Node_Str",returnVarName,argsVarName);
  }
  methodBuilder.addStatement("String_Node_Str",returnVarName);
  return methodBuilder.build();
}

Fixed version (ground truth):
@Override public MethodSpec generateMethodSpec(TypeUtil typeUtil){
  String returnVarName=getReturnVarName(RETURN_VAR_NAME_ROOT);
  String argsVarName=getReturnVarName(ARGS_VAR_NAME_ROOT);
  MethodSpec.Builder methodBuilder=MethodSpec.methodBuilder(name).addAnnotation(Override.class).addModifiers(PUBLIC).returns(ClassName.get(returnType)).addStatement("String_Node_Str",ClassName.get(returnType),returnVarName,ClassName.get(returnType));
  if (!fields.isEmpty()) {
    methodBuilder.addStatement("String_Node_Str",ClassName.get(typeUtil.bundleType),argsVarName,ClassName.get(typeUtil.bundleType));
  }
  for (  BundleFieldBinding fieldBinding : fields) {
    methodBuilder.addParameter(ClassName.get(fieldBinding.getType()),fieldBinding.getName());
    String keyValue;
    String stmt="String_Node_Str";
    KeySpec key=fieldBinding.getKey();
    if (StringUtils.isBlank(key.getName())) {
      keyValue=key.getValue();
      stmt=stmt.concat("String_Node_Str");
    }
 else {
      keyValue=key.getName();
      stmt=stmt.concat("String_Node_Str");
    }
    stmt=stmt.concat("String_Node_Str");
    methodBuilder.addStatement(stmt,argsVarName,fieldBinding.getBundleType(),keyValue,fieldBinding.getName());
  }
  if (!fields.isEmpty()) {
    methodBuilder.addStatement("String_Node_Str",returnVarName,argsVarName);
  }
  methodBuilder.addStatement("String_Node_Str",returnVarName);
  return methodBuilder.build();
}
Program: 30883
Project: 30883
Buggy source:
private void parseSaveState(Element element,Map<TypeElement,BundleInjectionAdapterGenerator> targetClassMap,Set<String> erasedTargetNames) throws ClassNotFoundException, InvalidTypeException {
  TypeElement enclosingElement=(TypeElement)element.getEnclosingElement();
  TypeMirror type=element.asType();
  if (type instanceof TypeVariable) {
    TypeVariable typeVariable=(TypeVariable)type;
    type=typeVariable.getUpperBound();
  }
  validateNotRequiredArguments(element);
  validateForCodeGeneration(SaveState.class,element);
  validateBindingPackage(SaveState.class,element);
  String name=element.getSimpleName().toString();
  String bundleType=typeUtil.getBundleType(type);
  NotRequired notRequired=element.getAnnotation(NotRequired.class);
  boolean required=notRequired == null;
  int minSdk=Build.VERSION_CODES.FROYO;
  if (!required) {
    minSdk=notRequired.value();
  }
  boolean canHaveDefault=!required && canHaveDefault(type,minSdk);
  boolean needsToBeCast=typeUtil.needToCastBundleType(type);
  BundleInjectionAdapterGenerator bundleInjectionAdapterGenerator=getOrCreateTargetClass(targetClassMap,enclosingElement);
  BundleFieldBinding binding=new BundleFieldBinding(SAVE_STATE,name,type,bundleType,generateKey(SAVE_STATE_KEY_PREFIX,name),needsToBeCast,canHaveDefault,required);
  bundleInjectionAdapterGenerator.addField(binding);
  erasedTargetNames.add(enclosingElement.toString());
}

Fixed version (ground truth):
private void parseSaveState(Element element,Map<TypeElement,BundleInjectionAdapterGenerator> targetClassMap,Set<String> erasedTargetNames) throws ClassNotFoundException, InvalidTypeException {
  TypeElement enclosingElement=(TypeElement)element.getEnclosingElement();
  TypeMirror type=element.asType();
  if (type instanceof TypeVariable) {
    TypeVariable typeVariable=(TypeVariable)type;
    type=typeVariable.getUpperBound();
  }
  validateNotRequiredArguments(element);
  validateForCodeGeneration(SaveState.class,element);
  validateBindingPackage(SaveState.class,element);
  String name=element.getSimpleName().toString();
  String bundleType=typeUtil.getBundleType(type);
  NotRequired notRequired=element.getAnnotation(NotRequired.class);
  boolean required=notRequired == null;
  int minSdk=Build.VERSION_CODES.FROYO;
  if (!required) {
    minSdk=notRequired.value();
  }
  boolean canHaveDefault=!required && canHaveDefault(type,minSdk);
  boolean needsToBeCast=typeUtil.needToCastBundleType(type);
  BundleInjectionAdapterGenerator bundleInjectionAdapterGenerator=getOrCreateTargetClass(targetClassMap,enclosingElement);
  BundleFieldBinding binding=new BundleFieldBinding(SAVE_STATE,name,type,bundleType,new KeySpec(null,generateKey(SAVE_STATE_KEY_PREFIX,name)),needsToBeCast,canHaveDefault,required);
  bundleInjectionAdapterGenerator.addField(binding);
  erasedTargetNames.add(enclosingElement.toString());
}
Program: 30884
Project: 30884
Buggy source:
private String getKey(Element element){
  if (isDefaultAnnotationElement(element,InjectArgument.class.getName(),"String_Node_Str")) {
    return generateKey(BundleFieldBinding.ARGUMENT_KEY_PREFIX,element.getSimpleName().toString());
  }
  return element.getAnnotation(InjectArgument.class).value();
}

Fixed version (ground truth):
private KeySpec getKey(Element element){
  if (isDefaultAnnotationElement(element,InjectArgument.class.getName(),"String_Node_Str")) {
    return new KeySpec(null,generateKey(BundleFieldBinding.ARGUMENT_KEY_PREFIX,element.getSimpleName().toString()));
  }
  return new KeySpec(null,element.getAnnotation(InjectArgument.class).value());
}
Program: 30885
Project: 30885
Buggy source:
private void parseInjectAnnotation(Element element,Map<TypeElement,BundleInjectionAdapterGenerator> targetClassMap,Set<String> erasedTargetNames) throws InvalidTypeException {
  TypeElement enclosingElement=(TypeElement)element.getEnclosingElement();
  TypeMirror type=element.asType();
  if (element instanceof TypeVariable) {
    TypeVariable typeVariable=(TypeVariable)type;
    type=typeVariable.getUpperBound();
  }
  validateNotRequiredArguments(element);
  validateForCodeGeneration(InjectArgument.class,element);
  validateBindingPackage(InjectArgument.class,element);
  String name=element.getSimpleName().toString();
  String bundleType=typeUtil.getBundleType(type);
  String key=getKey(element);
  NotRequired notRequired=element.getAnnotation(NotRequired.class);
  boolean required=notRequired == null;
  int minSdk=Build.VERSION_CODES.FROYO;
  if (!required) {
    minSdk=notRequired.value();
  }
  boolean canHaveDefault=!required && canHaveDefault(type,minSdk);
  boolean needsToBeCast=typeUtil.needToCastBundleType(type);
  BundleInjectionAdapterGenerator bundleInjectionAdapterGenerator=getOrCreateTargetClass(targetClassMap,enclosingElement);
  BundleFieldBinding binding=new BundleFieldBinding(BundleFieldBinding.AnnotationType.ARGUMENT,name,type,bundleType,key,needsToBeCast,canHaveDefault,required);
  bundleInjectionAdapterGenerator.orRequired(required);
  bundleInjectionAdapterGenerator.addField(binding);
  erasedTargetNames.add(enclosingElement.toString());
}

Fixed version (ground truth):
private void parseInjectAnnotation(Element element,Map<TypeElement,BundleInjectionAdapterGenerator> targetClassMap,Set<String> erasedTargetNames) throws InvalidTypeException {
  TypeElement enclosingElement=(TypeElement)element.getEnclosingElement();
  TypeMirror type=element.asType();
  if (element instanceof TypeVariable) {
    TypeVariable typeVariable=(TypeVariable)type;
    type=typeVariable.getUpperBound();
  }
  validateNotRequiredArguments(element);
  validateForCodeGeneration(InjectArgument.class,element);
  validateBindingPackage(InjectArgument.class,element);
  String name=element.getSimpleName().toString();
  String bundleType=typeUtil.getBundleType(type);
  KeySpec key=getKey(element);
  NotRequired notRequired=element.getAnnotation(NotRequired.class);
  boolean required=notRequired == null;
  int minSdk=Build.VERSION_CODES.FROYO;
  if (!required) {
    minSdk=notRequired.value();
  }
  boolean canHaveDefault=!required && canHaveDefault(type,minSdk);
  boolean needsToBeCast=typeUtil.needToCastBundleType(type);
  BundleInjectionAdapterGenerator bundleInjectionAdapterGenerator=getOrCreateTargetClass(targetClassMap,enclosingElement);
  BundleFieldBinding binding=new BundleFieldBinding(BundleFieldBinding.AnnotationType.ARGUMENT,name,type,bundleType,key,needsToBeCast,canHaveDefault,required);
  bundleInjectionAdapterGenerator.orRequired(required);
  bundleInjectionAdapterGenerator.addField(binding);
  erasedTargetNames.add(enclosingElement.toString());
}