nus-yam/ex-repair huggingface dataset:
Program: 170737
Project: 170737
Buggy source:
@Override protected String getCommonSuperClass(String type1,String type2){
  if (type1 == null || type2 == null) {
    return DEFAULT_PARENT;
  }
  ClassNode node1=loadNode(type1);
  ClassNode node2=loadNode(type2);
  if (node1 == null || node2 == null) {
    return DEFAULT_PARENT;
  }
 else   if (isAssignableFrom(node1,node2)) {
    return type1;
  }
 else   if (isAssignableFrom(node2,node1)) {
    return type2;
  }
  do {
    node1=loadNode(node1.superName);
    if (node1 == null) {
      if (node2.name.equals(type1)) {
        return DEFAULT_PARENT;
      }
      node1=loadNode(type2);
      node2=loadNode(type1);
    }
 else     if (isAssignableFrom(node1,node2)) {
      return type1;
    }
 else     if (isAssignableFrom(node2,node1)) {
      return type2;
    }
  }
 while (!isAssignableFrom(node1,node2));
  return DEFAULT_PARENT;
}

Fixed version (ground truth):
@Override protected String getCommonSuperClass(String type1,String type2){
  if (type1 == null || type2 == null) {
    return DEFAULT_PARENT;
  }
  ClassNode node1=loadNode(type1);
  ClassNode node2=loadNode(type2);
  if (node1 == null || node2 == null) {
    return DEFAULT_PARENT;
  }
 else   if (isAssignableFrom(node1,node2)) {
    return type1;
  }
 else   if (isAssignableFrom(node2,node1)) {
    return type2;
  }
  do {
    node1=loadNode(node1.superName);
    if (node1 == null) {
      if (node2.name.equals(type1)) {
        return DEFAULT_PARENT;
      }
      node1=loadNode(type2);
      node2=loadNode(type1);
    }
 else     if (isAssignableFrom(node1,node2)) {
      return node1.name;
    }
 else     if (isAssignableFrom(node2,node1)) {
      return node2.name;
    }
  }
 while (!isAssignableFrom(node1,node2));
  return DEFAULT_PARENT;
}
Program: 170738
Project: 170738
Buggy source:
/** 
 * Reads the bytes from the inputstream into a byte array.
 * @param is InputStream to read from.
 * @return byt earray representation of the input stream.
 * @throws IOException Thrown if the given input stream cannot be read from.
 */
public static byte[] fromStream(InputStream is) throws IOException {
  try (ByteArrayOutputStream buffer=new ByteArrayOutputStream()){
    int r;
    byte[] data=new byte[BUFF_SIZE];
    while ((r=is.read(data,0,data.length)) != -1) {
      buffer.write(data,0,r);
    }
    buffer.flush();
    return buffer.toByteArray();
  }
 }

Fixed version (ground truth):
/** 
 * Reads the bytes from the inputstream into a byte array.
 * @param is InputStream to read from.
 * @return byte array representation of the input stream.
 * @throws IOException Thrown if the given input stream cannot be read from.
 */
public static byte[] fromStream(InputStream is) throws IOException {
  try (ByteArrayOutputStream buffer=new ByteArrayOutputStream()){
    int r;
    byte[] data=new byte[BUFF_SIZE];
    while ((r=is.read(data,0,data.length)) != -1) {
      buffer.write(data,0,r);
    }
    buffer.flush();
    return buffer.toByteArray();
  }
 }
Program: 170739
Project: 170739
Buggy source:
/** 
 * Save current settings to configuration.
 */
public void save(){
  try {
    if (!optionsFile.exists()) {
      optionsFile.createNewFile();
    }
    JsonObject json=Json.object();
    for (    Field field : Options.class.getDeclaredFields()) {
      field.setAccessible(true);
      String name=field.getName();
      Object value=field.get(this);
      if (value instanceof Boolean) {
        json.set(name,(boolean)value);
      }
 else       if (value instanceof Integer) {
        json.set(name,(int)value);
      }
 else       if (value instanceof String) {
        json.set(name,(String)value);
      }
    }
    StringWriter w=new StringWriter();
    json.writeTo(w,WriterConfig.PRETTY_PRINT);
    Misc.writeFile(optionsFile.getAbsolutePath(),w.toString());
  }
 catch (  Exception e) {
    e.getMessage();
  }
}

Fixed version (ground truth):
/** 
 * Save current settings to configuration.
 */
public void save(){
  try {
    if (!optionsFile.exists() && !optionsFile.createNewFile()) {
      return;
    }
    JsonObject json=Json.object();
    for (    Field field : Options.class.getDeclaredFields()) {
      field.setAccessible(true);
      String name=field.getName();
      Object value=field.get(this);
      if (value instanceof Boolean) {
        json.set(name,(boolean)value);
      }
 else       if (value instanceof Integer) {
        json.set(name,(int)value);
      }
 else       if (value instanceof String) {
        json.set(name,(String)value);
      }
    }
    StringWriter w=new StringWriter();
    json.writeTo(w,WriterConfig.PRETTY_PRINT);
    Misc.writeFile(optionsFile.getAbsolutePath(),w.toString());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 170740
Project: 170740
Buggy source:
/** 
 * Reads the classes of the given jar into a map.
 * @param jarPath Path to jarfile to read classes from.
 * @return Map of classes from the given jarfile.
 * @throws IOException If an exception was encountered while reading the jarfile.
 */
public Map<String,ClassNode> readClasses(String jarPath) throws IOException {
  Map<String,ClassNode> map=new HashMap<>();
  try (ZipFile file=new ZipFile(jarPath)){
    Enumeration<? extends ZipEntry> entries=file.entries();
    while (entries.hasMoreElements()) {
      ZipEntry entry=entries.nextElement();
      if (entry.isDirectory() || !entry.getName().endsWith("String_Node_Str")) {
        continue;
      }
      String name=null;
      try (InputStream is=file.getInputStream(entry)){
        ClassReader cr=new PluginClassReader(is);
        name=cr.getClassName();
        map.put(cr.getClassName(),getNode(cr));
      }
 catch (      IndexOutOfBoundsException ioobe) {
        if (name == null) {
          recaf.window.displayError(new RuntimeException("String_Node_Str" + entry.getName(),ioobe));
        }
 else {
          recaf.window.displayError(new RuntimeException("String_Node_Str" + name,ioobe));
        }
      }
    }
  }
   return map;
}

Fixed version (ground truth):
/** 
 * Reads the classes of the given jar into a map.
 * @param jarPath Path to jarfile to read classes from.
 * @return Map of classes from the given jarfile.
 * @throws IOException If an exception was encountered while reading the jarfile.
 */
public Map<String,ClassNode> readClasses(String jarPath) throws IOException {
  Map<String,ClassNode> map=new HashMap<>();
  try (ZipFile file=new ZipFile(jarPath)){
    Enumeration<? extends ZipEntry> entries=file.entries();
    while (entries.hasMoreElements()) {
      ZipEntry entry=entries.nextElement();
      if (entry.isDirectory() || !entry.getName().endsWith("String_Node_Str")) {
        continue;
      }
      String name=null;
      try (InputStream is=file.getInputStream(entry)){
        ClassReader cr=new PluginClassReader(is);
        name=cr.getClassName();
        map.put(cr.getClassName(),getNode(cr));
      }
 catch (      IndexOutOfBoundsException ioobe) {
        if (name == null) {
          recaf.gui.displayError(new RuntimeException("String_Node_Str" + entry.getName(),ioobe));
        }
 else {
          recaf.gui.displayError(new RuntimeException("String_Node_Str" + name,ioobe));
        }
      }
    }
  }
   return map;
}
Program: 170741
Project: 170741
Buggy source:
public void save(File jar) throws IOException {
  try (JarOutputStream output=new JarOutputStream(new FileOutputStream(jar))){
    for (    String name : classes.keySet()) {
      byte[] data=recaf.asm.toBytes(classes.get(name));
      output.putNextEntry(new JarEntry(name.replace("String_Node_Str","String_Node_Str") + "String_Node_Str"));
      output.write(data);
      output.closeEntry();
    }
    for (    String name : resources.keySet()) {
      output.putNextEntry(new JarEntry(name));
      output.write(resources.get(name));
      output.closeEntry();
    }
  }
 }

Fixed version (ground truth):
public void save(File jar) throws IOException {
  try (JarOutputStream output=new JarOutputStream(new FileOutputStream(jar))){
    for (    Entry<String,ClassNode> entry : classes.entrySet()) {
      byte[] data=recaf.asm.toBytes(entry.getValue());
      output.putNextEntry(new JarEntry(entry.getKey().replace("String_Node_Str","String_Node_Str") + "String_Node_Str"));
      output.write(data);
      output.closeEntry();
    }
    for (    Entry<String,byte[]> entry : resources.entrySet()) {
      output.putNextEntry(new JarEntry(entry.getKey()));
      output.write(entry.getValue());
      output.closeEntry();
    }
  }
 }
Program: 170742
Project: 170742
Buggy source:
/** 
 * Load node from the node map.
 * @param type
 * @return
 */
private ClassNode loadNode(String type){
  if (type == null) {
    return null;
  }
 else   if (nodes.containsKey(type)) {
    return nodes.get(type);
  }
  String nameStr=type.replace("String_Node_Str","String_Node_Str");
  try {
    Class<?> clazz=Class.forName(nameStr);
    if (clazz == null) {
      return null;
    }
    return recaf.asm.getNode(clazz);
  }
 catch (  IOException e) {
    return null;
  }
catch (  ClassNotFoundException e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Load node from the node map.
 * @param type
 * @return
 */
private ClassNode loadNode(String type){
  if (type == null) {
    return null;
  }
 else   if (nodes.containsKey(type)) {
    return nodes.get(type);
  }
  String nameStr=type.replace("String_Node_Str","String_Node_Str");
  try {
    Class<?> clazz=Class.forName(nameStr);
    if (clazz != null) {
      return recaf.asm.getNode(clazz);
    }
  }
 catch (  ClassNotFoundException|IOException e) {
    e.printStackTrace();
  }
  return null;
}
Program: 170743
Project: 170743
Buggy source:
@Override public void onClick(View v){
  if (blog.getBlogUrl() != null) {
    Intent intent=new Intent();
    intent.setAction(Intent.ACTION_VIEW);
    intent.addCategory(Intent.CATEGORY_BROWSABLE);
    intent.setData(Uri.parse(blog.getBlogUrl()));
    itemView.getContext().startActivity(intent);
  }
}

Fixed version (ground truth):
@Override public void onClick(View v){
  if (blog.getBlogUrl() != null) {
    try {
      Intent intent=new Intent();
      intent.setAction(Intent.ACTION_VIEW);
      intent.addCategory(Intent.CATEGORY_BROWSABLE);
      intent.setData(Uri.parse(blog.getBlogUrl()));
      itemView.getContext().startActivity(intent);
    }
 catch (    Exception e) {
      AppLogger.d("String_Node_Str");
    }
  }
}
Program: 170744
Project: 170744
Buggy source:
public void onBind(int position){
  super.onBind(position);
  final BlogResponse.Blog blog=mBlogResponseList.get(position);
  if (blog.getCoverImgUrl() != null) {
    Glide.with(itemView.getContext()).load(blog.getCoverImgUrl()).asBitmap().centerCrop().into(coverImageView);
  }
  if (blog.getTitle() != null) {
    titleTextView.setText(blog.getTitle());
  }
  if (blog.getAuthor() != null) {
    authorTextView.setText(blog.getAuthor());
  }
  if (blog.getDate() != null) {
    dateTextView.setText(blog.getDate());
  }
  if (blog.getDescription() != null) {
    contentTextView.setText(blog.getDescription());
  }
  itemView.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (blog.getBlogUrl() != null) {
        Intent intent=new Intent();
        intent.setAction(Intent.ACTION_VIEW);
        intent.addCategory(Intent.CATEGORY_BROWSABLE);
        intent.setData(Uri.parse(blog.getBlogUrl()));
        itemView.getContext().startActivity(intent);
      }
    }
  }
);
}

Fixed version (ground truth):
public void onBind(int position){
  super.onBind(position);
  final BlogResponse.Blog blog=mBlogResponseList.get(position);
  if (blog.getCoverImgUrl() != null) {
    Glide.with(itemView.getContext()).load(blog.getCoverImgUrl()).asBitmap().centerCrop().into(coverImageView);
  }
  if (blog.getTitle() != null) {
    titleTextView.setText(blog.getTitle());
  }
  if (blog.getAuthor() != null) {
    authorTextView.setText(blog.getAuthor());
  }
  if (blog.getDate() != null) {
    dateTextView.setText(blog.getDate());
  }
  if (blog.getDescription() != null) {
    contentTextView.setText(blog.getDescription());
  }
  itemView.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (blog.getBlogUrl() != null) {
        try {
          Intent intent=new Intent();
          intent.setAction(Intent.ACTION_VIEW);
          intent.addCategory(Intent.CATEGORY_BROWSABLE);
          intent.setData(Uri.parse(blog.getBlogUrl()));
          itemView.getContext().startActivity(intent);
        }
 catch (        Exception e) {
          AppLogger.d("String_Node_Str");
        }
      }
    }
  }
);
}
Program: 170747
Project: 170747
Buggy source:
@Override public byte[] getMessage(){
  List<ParcelOperationDAO> parcelOperationDaos=overview.retrievedParcelOperations();
  parcelPoolElementDao.operations=parcelOperationDaos;
  String responseBody=new GsonBuilder().create().toJson(parcelPoolElementDao);
  int bodyStart=requestInfo.getBodyOffset();
  byte[] header=Arrays.copyOfRange(content,0,bodyStart);
  return Bytes.concat(header,responseBody.getBytes());
}

Fixed version (ground truth):
@Override public byte[] getMessage(){
  List<ParcelOperationDAO> parcelOperationDaos=overview.retrievedParcelOperations();
  if (isModified()) {
    parcelPoolElementDao.operations=parcelOperationDaos;
    String responseBody=new GsonBuilder().create().toJson(parcelPoolElementDao);
    int bodyStart=requestInfo.getBodyOffset();
    byte[] header=Arrays.copyOfRange(content,0,bodyStart);
    return Bytes.concat(header,responseBody.getBytes());
  }
 else {
    return content;
  }
}
Program: 170748
Project: 170748
Buggy source:
public void setByteArray(ArrayList byteArray){
  StringBuilder builder=new StringBuilder();
  for (  Object element : byteArray) {
    builder.append(String.format("String_Node_Str",((Double)element).byteValue()));
    builder.append("String_Node_Str");
  }
  this.byteArray.setText(builder.toString());
}

Fixed version (ground truth):
public void setByteArray(ArrayList byteArray){
  StringBuilder builder=new StringBuilder();
  if (byteArray != null) {
    for (    Object element : byteArray) {
      builder.append(String.format("String_Node_Str",((Double)element).byteValue()));
      builder.append("String_Node_Str");
    }
  }
  this.byteArray.setText(builder.toString());
}
Program: 170749
Project: 170749
Buggy source:
public void rebuild(){
  panel.removeAll();
  Object[] columnNames={"String_Node_Str","String_Node_Str"};
  Object[][] data=new Object[parcelOperations.size()][];
  for (int i=0; i < parcelOperations.size(); i++) {
    ParcelOperationDAO parcelOperationDAO=parcelOperations.get(i);
    data[i]=new Object[]{parcelOperationDAO.parcelType.toString(),parcelOperationDAO.value};
  }
  table=new JTable(data,columnNames);
  table.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
    public void valueChanged(    ListSelectionEvent event){
      int selectedRow=table.getSelectedRow();
      String operation=(String)table.getValueAt(selectedRow,0);
      Object value=parcelOperations.get(selectedRow).value;
      details.removeAll();
      if (operation.equals("String_Node_Str") || operation.equals("String_Node_Str")) {
        details.add(new ParcelByteArrDetails((LinkedTreeMap)value));
      }
 else {
        details.removeAll();
      }
      details.revalidate();
      details.repaint();
    }
  }
);
  panel.add(table.getTableHeader(),BorderLayout.PAGE_START);
  panel.add(table,BorderLayout.CENTER);
  panel.add(table);
  table.getColumnModel().getColumn(0).setWidth(5);
  table.getColumnModel().getColumn(1).setWidth(95);
  revalidate();
  repaint();
}

Fixed version (ground truth):
public void rebuild(){
  panel.removeAll();
  if (details != null) {
    details.removeAll();
  }
  Object[] columnNames={"String_Node_Str","String_Node_Str"};
  Object[][] data=new Object[parcelOperations.size()][];
  for (int i=0; i < parcelOperations.size(); i++) {
    ParcelOperationDAO parcelOperationDAO=parcelOperations.get(i);
    data[i]=new Object[]{parcelOperationDAO.parcelType.toString(),parcelOperationDAO.value};
  }
  table=new JTable(data,columnNames);
  table.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
    public void valueChanged(    ListSelectionEvent event){
      int selectedRow=table.getSelectedRow();
      String operation=(String)table.getValueAt(selectedRow,0);
      Object value=parcelOperations.get(selectedRow).value;
      details.removeAll();
      if (operation.equals("String_Node_Str") || operation.equals("String_Node_Str")) {
        details.add(new ParcelByteArrDetails((LinkedTreeMap)value));
      }
 else {
        details.removeAll();
      }
      details.revalidate();
      details.repaint();
    }
  }
);
  panel.add(table.getTableHeader(),BorderLayout.PAGE_START);
  panel.add(table,BorderLayout.CENTER);
  panel.add(table);
  table.getColumnModel().getColumn(0).setWidth(5);
  table.getColumnModel().getColumn(1).setWidth(95);
  revalidate();
  repaint();
}
Program: 170750
Project: 170750
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  findViewById(R.id.add_card).setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      Luhn.startLuhn(MainActivity.this,new LuhnCallback(){
        @Override public void cardDetailsRetrieved(        Context luhnContext,        LuhnCard creditCard,        final LuhnCardVerifier cardVerifier){
          cardVerifier.startProgress();
          new Handler().postDelayed(new Runnable(){
            @Override public void run(){
              cardVerifier.requestOTP(4);
            }
          }
,2500);
        }
        @Override public void otpRetrieved(        Context luhnContext,        final LuhnCardVerifier cardVerifier,        int otp){
          cardVerifier.startProgress();
          new Handler().postDelayed(new Runnable(){
            @Override public void run(){
              cardVerifier.onCardVerified(false,getString(R.string.verification_error),getString(R.string.verification_error));
            }
          }
,2500);
        }
        @Override public void onFinished(){
        }
      }
,R.style.LuhnStyle);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  findViewById(R.id.add_card).setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      Luhn.startLuhn(MainActivity.this,new LuhnCallback(){
        @Override public void cardDetailsRetrieved(        Context luhnContext,        LuhnCard creditCard,        final LuhnCardVerifier cardVerifier){
          cardVerifier.startProgress();
          new Handler().postDelayed(new Runnable(){
            @Override public void run(){
              cardVerifier.requestOTP(4);
            }
          }
,2500);
        }
        @Override public void otpRetrieved(        Context luhnContext,        final LuhnCardVerifier cardVerifier,        String otp){
          cardVerifier.startProgress();
          new Handler().postDelayed(new Runnable(){
            @Override public void run(){
              cardVerifier.onCardVerified(false,getString(R.string.verification_error),getString(R.string.verification_error));
            }
          }
,2500);
        }
        @Override public void onFinished(){
        }
      }
,R.style.LuhnStyle);
    }
  }
);
}
Program: 170751
Project: 170751
Buggy source:
@Override public void onClick(View v){
  Luhn.startLuhn(MainActivity.this,new LuhnCallback(){
    @Override public void cardDetailsRetrieved(    Context luhnContext,    LuhnCard creditCard,    final LuhnCardVerifier cardVerifier){
      cardVerifier.startProgress();
      new Handler().postDelayed(new Runnable(){
        @Override public void run(){
          cardVerifier.requestOTP(4);
        }
      }
,2500);
    }
    @Override public void otpRetrieved(    Context luhnContext,    final LuhnCardVerifier cardVerifier,    int otp){
      cardVerifier.startProgress();
      new Handler().postDelayed(new Runnable(){
        @Override public void run(){
          cardVerifier.onCardVerified(false,getString(R.string.verification_error),getString(R.string.verification_error));
        }
      }
,2500);
    }
    @Override public void onFinished(){
    }
  }
,R.style.LuhnStyle);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  Luhn.startLuhn(MainActivity.this,new LuhnCallback(){
    @Override public void cardDetailsRetrieved(    Context luhnContext,    LuhnCard creditCard,    final LuhnCardVerifier cardVerifier){
      cardVerifier.startProgress();
      new Handler().postDelayed(new Runnable(){
        @Override public void run(){
          cardVerifier.requestOTP(4);
        }
      }
,2500);
    }
    @Override public void otpRetrieved(    Context luhnContext,    final LuhnCardVerifier cardVerifier,    String otp){
      cardVerifier.startProgress();
      new Handler().postDelayed(new Runnable(){
        @Override public void run(){
          cardVerifier.onCardVerified(false,getString(R.string.verification_error),getString(R.string.verification_error));
        }
      }
,2500);
    }
    @Override public void onFinished(){
    }
  }
,R.style.LuhnStyle);
}
Program: 170752
Project: 170752
Buggy source:
@Override public void otpRetrieved(Context luhnContext,final LuhnCardVerifier cardVerifier,int otp){
  cardVerifier.startProgress();
  new Handler().postDelayed(new Runnable(){
    @Override public void run(){
      cardVerifier.onCardVerified(false,getString(R.string.verification_error),getString(R.string.verification_error));
    }
  }
,2500);
}

Fixed version (ground truth):
@Override public void otpRetrieved(Context luhnContext,final LuhnCardVerifier cardVerifier,String otp){
  cardVerifier.startProgress();
  new Handler().postDelayed(new Runnable(){
    @Override public void run(){
      cardVerifier.onCardVerified(false,getString(R.string.verification_error),getString(R.string.verification_error));
    }
  }
,2500);
}
Program: 170753
Project: 170753
Buggy source:
@Override public void onBackPressed(){
  if (bottomSheetBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED) {
    bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
    return;
  }
  super.onBackPressed();
}

Fixed version (ground truth):
@Override public void onBackPressed(){
  if (bottomSheetBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED) {
    bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
    return;
  }
  super.onBackPressed();
  sLuhnCallback.onFinished(false);
}
Program: 170754
Project: 170754
Buggy source:
@Override public void onCardVerified(boolean isSuccessFul,String errorTitle,String errorMessage){
  dismissProgress();
  if (isSuccessFul) {
    finish();
  }
 else {
    showInfo(errorTitle,errorMessage,null,true);
  }
}

Fixed version (ground truth):
@Override public void onCardVerified(boolean isSuccessFul,String errorTitle,String errorMessage){
  dismissProgress();
  if (isSuccessFul) {
    sLuhnCallback.onFinished(isSuccessFul);
  }
 else {
    showInfo(errorTitle,errorMessage,null,true);
  }
}
Program: 170755
Project: 170755
Buggy source:
void onFinished();

Fixed version (ground truth):
void onFinished(boolean isVerified);
Program: 170756
Project: 170756
Buggy source:
/** 
 * @param mouseButton one of the MOUSE_* constants of this class.
 */
public void sendMouseEvent(int mouseButton,int column,int row,boolean pressed){
  if (column < 1)   column=1;
  if (column > mColumns)   column=mColumns;
  if (row < 1)   row=1;
  if (row > mRows)   row=mRows;
  if (mouseButton == MOUSE_LEFT_BUTTON_MOVED && !isDecsetInternalBitSet(DECSET_BIT_MOUSE_TRACKING_BUTTON_EVENT)) {
  }
 else   if (isDecsetInternalBitSet(DECSET_BIT_MOUSE_PROTOCOL_SGR)) {
    mSession.write(String.format("String_Node_Str" + (pressed ? 'M' : 'm'),mouseButton,column,row));
  }
 else {
    mouseButton=pressed ? mouseButton : 3;
    boolean out_of_bounds=column > 255 - 32 || row > 255 - 32;
    if (!out_of_bounds) {
      byte[] data={'\033','[','M',(byte)(32 + mouseButton),(byte)(32 + column),(byte)(32 + row)};
      mSession.write(data,0,data.length);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param mouseButton one of the MOUSE_* constants of this class.
 */
public void sendMouseEvent(int mouseButton,int column,int row,boolean pressed){
  if (column < 1)   column=1;
  if (column > mColumns)   column=mColumns;
  if (row < 1)   row=1;
  if (row > mRows)   row=mRows;
  if (mouseButton == MOUSE_LEFT_BUTTON_MOVED && !isDecsetInternalBitSet(DECSET_BIT_MOUSE_TRACKING_BUTTON_EVENT)) {
  }
 else   if (isDecsetInternalBitSet(DECSET_BIT_MOUSE_PROTOCOL_SGR)) {
    mSession.write(String.format("String_Node_Str" + (pressed ? 'M' : 'm'),mouseButton,column,row));
  }
 else {
    mouseButton=pressed ? mouseButton : 3;
    boolean outOfBounds=column > 255 - 32 || row > 255 - 32;
    if (!outOfBounds) {
      byte[] data={'\033','[','M',(byte)(32 + mouseButton),(byte)(32 + column),(byte)(32 + row)};
      mSession.write(data,0,data.length);
    }
  }
}
Program: 170757
Project: 170757
Buggy source:
public void setProvider(SearchProvider _provider){
  provider=_provider;
}

Fixed version (ground truth):
public void setProvider(PluginInterface _pi,SearchProvider _provider){
  provider=_provider;
  if (plugin_id == null) {
    plugin_id=_pi.getPluginID();
  }
}
Program: 170758
Project: 170758
Buggy source:
@Override public Map exportToBencodedMap(boolean generic) throws IOException {
  Map res=new HashMap();
  super.exportToBencodedMap(res,generic);
  return (res);
}

Fixed version (ground truth):
@Override public Map exportToBencodedMap(boolean generic) throws IOException {
  Map res=new HashMap();
  super.exportToBencodedMap(res,generic);
  if (plugin_id != null) {
    MapUtils.setMapString(res,"String_Node_Str",plugin_id);
  }
  return (res);
}
Program: 170759
Project: 170759
Buggy source:
protected PluginEngine(MetaSearchImpl _meta_search,Map _map) throws IOException {
  super(_meta_search,_map);
  if (getRankBias() == 0.0f) {
    setRankBias(1.0f);
  }
  setSource(ENGINE_SOURCE_LOCAL);
}

Fixed version (ground truth):
protected PluginEngine(MetaSearchImpl _meta_search,Map _map) throws IOException {
  super(_meta_search,_map);
  plugin_id=MapUtils.getMapString(_map,"String_Node_Str",null);
  if (getRankBias() == 0.0f) {
    setRankBias(1.0f);
  }
  setSource(ENGINE_SOURCE_LOCAL);
}
Program: 170760
Project: 170760
Buggy source:
protected byte[] exportShortIDs(List<Download> downloads){
  byte[] res=new byte[SHORT_ID_SIZE * downloads.size()];
  for (int i=0; i < downloads.size(); i++) {
    Download download=downloads.get(i);
    downloadData download_data=(downloadData)download.getUserData(BuddyPluginTracker.class);
    if (download_data != null) {
      System.arraycopy(download_data.getID().getBytes(),0,res,i * SHORT_ID_SIZE,SHORT_ID_SIZE);
    }
  }
  return (res);
}

Fixed version (ground truth):
protected byte[] exportShortIDs(List<Download> downloads){
  byte[] res=new byte[SHORT_ID_SIZE * downloads.size()];
  for (int i=0; i < downloads.size(); i++) {
    Download download=downloads.get(i);
    downloadData download_data=(downloadData)download.getUserData(BuddyPluginTracker.class);
    if (download_data == null) {
      download_data=new downloadData(download);
    }
    System.arraycopy(download_data.getID().getBytes(),0,res,i * SHORT_ID_SIZE,SHORT_ID_SIZE);
  }
  return (res);
}
Program: 170761
Project: 170761
Buggy source:
protected byte[][] exportFullIDs(List<Download> downloads){
  byte[] hashes=new byte[FULL_ID_SIZE * downloads.size()];
  byte[] states=new byte[downloads.size()];
  for (int i=0; i < downloads.size(); i++) {
    Download download=downloads.get(i);
    downloadData download_data=(downloadData)download.getUserData(BuddyPluginTracker.class);
    if (download_data != null) {
      System.arraycopy(download_data.getID().getBytes(),0,hashes,i * FULL_ID_SIZE,FULL_ID_SIZE);
      states[i]=download.isComplete(false) ? (byte)0x01 : (byte)0x00;
    }
  }
  return (new byte[][]{hashes,states});
}

Fixed version (ground truth):
protected byte[][] exportFullIDs(List<Download> downloads){
  byte[] hashes=new byte[FULL_ID_SIZE * downloads.size()];
  byte[] states=new byte[downloads.size()];
  for (int i=0; i < downloads.size(); i++) {
    Download download=downloads.get(i);
    downloadData download_data=(downloadData)download.getUserData(BuddyPluginTracker.class);
    if (download_data == null) {
      download_data=new downloadData(download);
    }
    System.arraycopy(download_data.getID().getBytes(),0,hashes,i * FULL_ID_SIZE,FULL_ID_SIZE);
    states[i]=download.isComplete(false) ? (byte)0x01 : (byte)0x00;
  }
  return (new byte[][]{hashes,states});
}
Program: 170762
Project: 170762
Buggy source:
@Override public void downloadRemoved(Download download){
  download.removeListener(download_listener);
  download.removeTrackerListener(download_tracker_listener);
  download.removeActivationListener(download_activation_listener);
  DefaultRankCalculator dlData=downloadDataMap.remove(download);
  if (dlData != null) {
    sortedArrayCache=null;
    dlData.destroy();
  }
  requestProcessCycle(null);
  if (bDebugLog)   log.log(download.getTorrent(),LoggerChannel.LT_INFORMATION,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void downloadRemoved(Download download){
  download.removeListener(download_listener);
  download.removeTrackerListener(download_tracker_listener);
  download.removeActivationListener(download_activation_listener);
  DefaultRankCalculator dlData=downloadDataMap.remove(download);
  if (dlData != null) {
    dlData.getCoreDownloadObject().getDownloadState().removeListener(download_state_attribute_listener,DownloadManagerState.AT_TRANSIENT_FLAGS,DownloadManagerStateAttributeListener.WRITTEN);
    sortedArrayCache=null;
    dlData.destroy();
  }
  requestProcessCycle(null);
  if (bDebugLog)   log.log(download.getTorrent(),LoggerChannel.LT_INFORMATION,"String_Node_Str");
}
Program: 170763
Project: 170763
Buggy source:
public StartStopDMListener(){
  download_tracker_listener=new StartStopDMTrackerListener();
  download_listener=new StartStopDownloadListener();
  download_activation_listener=new StartStopDownloadActivationListener();
}

Fixed version (ground truth):
public StartStopDMListener(){
  download_tracker_listener=new StartStopDMTrackerListener();
  download_listener=new StartStopDownloadListener();
  download_activation_listener=new StartStopDownloadActivationListener();
  download_state_attribute_listener=new StartStopDownloadStateAttributeListener();
}
Program: 170764
Project: 170764
Buggy source:
@Override public void downloadAdded(Download download){
  DefaultRankCalculator dlData=null;
  if (downloadDataMap.containsKey(download)) {
    dlData=downloadDataMap.get(download);
  }
 else {
    dlData=new DefaultRankCalculator(StartStopRulesDefaultPlugin.this,download);
    sortedArrayCache=null;
    downloadDataMap.put(download,dlData);
    download.addListener(download_listener);
    download.addTrackerListener(download_tracker_listener,false);
    download.addActivationListener(download_activation_listener);
  }
  if (dlData != null) {
    requestProcessCycle(dlData);
    if (bDebugLog)     log.log(download.getTorrent(),LoggerChannel.LT_INFORMATION,"String_Node_Str" + sStates.charAt(download.getState()));
  }
}

Fixed version (ground truth):
@Override public void downloadAdded(Download download){
  DefaultRankCalculator dlData=null;
  if (downloadDataMap.containsKey(download)) {
    dlData=downloadDataMap.get(download);
  }
 else {
    dlData=new DefaultRankCalculator(StartStopRulesDefaultPlugin.this,download);
    sortedArrayCache=null;
    downloadDataMap.put(download,dlData);
    download.addListener(download_listener);
    download.addTrackerListener(download_tracker_listener,false);
    download.addActivationListener(download_activation_listener);
    dlData.getCoreDownloadObject().getDownloadState().addListener(download_state_attribute_listener,DownloadManagerState.AT_TRANSIENT_FLAGS,DownloadManagerStateAttributeListener.WRITTEN);
  }
  if (dlData != null) {
    requestProcessCycle(dlData);
    if (bDebugLog)     log.log(download.getTorrent(),LoggerChannel.LT_INFORMATION,"String_Node_Str" + sStates.charAt(download.getState()));
  }
}
Program: 170767
Project: 170767
Buggy source:
/** 
 * flushes the cache to disk but retains entries
 * @throws CacheFileManagerException
 */
public void flushCache() throws CacheFileManagerException ;

Fixed version (ground truth):
public void flushCache(long offset,int length) throws CacheFileManagerException ;
Program: 170768
Project: 170768
Buggy source:
@Override public void flushCache() throws CacheFileManagerException {
  try {
    flushCachePublic(false,-1);
    file.flush();
  }
 catch (  FMFileManagerException e) {
    manager.rethrow(this,e);
  }
}

Fixed version (ground truth):
public void flushCache(long file_position,int length) throws CacheFileManagerException {
  try {
    flushCache(file_position,length,false,-1,0,-1);
    file.flush();
  }
 catch (  FMFileManagerException e) {
    manager.rethrow(this,e);
  }
}
Program: 170769
Project: 170769
Buggy source:
@Override public void flushCache() throws CacheFileManagerException {
  try {
    file.flush();
  }
 catch (  FMFileManagerException e) {
    manager.rethrow(this,e);
  }
}

Fixed version (ground truth):
public void flushCache(long offset,int length) throws CacheFileManagerException {
  flushCache();
}
Program: 170770
Project: 170770
Buggy source:
@Override public void flushCache() throws CacheFileManagerException {
  try {
    base_file.flush();
  }
 catch (  FMFileManagerException e) {
    manager.rethrow(this,e);
  }
}

Fixed version (ground truth):
public void flushCache(long offset,int length) throws CacheFileManagerException {
  flushCache();
}
Program: 170775
Project: 170775
Buggy source:
@Override public boolean eventOccurred(UISWTViewEvent event){
switch (event.getType()) {
case UISWTViewEvent.TYPE_CREATE:
{
      if (event instanceof UISWTViewEventImpl) {
        String parent=((UISWTViewEventImpl)event).getParentID();
        enable_tabs=parent != null && parent.equals(UISWTInstance.VIEW_TORRENT_DETAILS);
      }
      break;
    }
case UISWTViewEvent.TYPE_FOCUSGAINED:
  String id="String_Node_Str";
setFocused(true);
if (manager != null) {
if (manager.getTorrent() != null) {
  id+="String_Node_Str" + manager.getInternalName();
}
 else {
  id+="String_Node_Str" + manager.getSize();
}
SelectedContentManager.changeCurrentlySelectedContent(id,new SelectedContent[]{new SelectedContent(manager)});
}
 else {
SelectedContentManager.changeCurrentlySelectedContent(id,null);
}
break;
case UISWTViewEvent.TYPE_FOCUSLOST:
setFocused(false);
SelectedContentManager.clearCurrentlySelectedContent();
break;
}
return (super.eventOccurred(event));
}

Fixed version (ground truth):
@Override public boolean eventOccurred(UISWTViewEvent event){
switch (event.getType()) {
case UISWTViewEvent.TYPE_CREATE:
{
      if (event instanceof UISWTViewEventImpl) {
        String parent=((UISWTViewEventImpl)event).getParentID();
        enable_tabs=parent != null && parent.equals(UISWTInstance.VIEW_TORRENT_DETAILS);
      }
      break;
    }
case UISWTViewEvent.TYPE_FOCUSGAINED:
  updateSelectedContent();
break;
case UISWTViewEvent.TYPE_FOCUSLOST:
setFocused(false);
SelectedContentManager.clearCurrentlySelectedContent();
break;
}
return (super.eventOccurred(event));
}
Program: 170776
Project: 170776
Buggy source:
protected TableViewSWT<PEPeer> initYourTableView(String table_id,boolean enable_tabs){
  if (table_id == TableManager.TABLE_TORRENT_PEERS) {
    tv=TableViewFactory.createTableViewSWT(Peer.class,TableManager.TABLE_TORRENT_PEERS,getPropertiesPrefix(),basicItems,"String_Node_Str",SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL);
  }
 else {
    TableColumnCore[] items=PeersView.getBasicColumnItems(TableManager.TABLE_ALL_PEERS);
    TableColumnCore[] basicItems=new TableColumnCore[items.length + 1];
    System.arraycopy(items,0,basicItems,0,items.length);
    basicItems[items.length]=new DownloadNameItem(TableManager.TABLE_ALL_PEERS);
    TableColumnManager tcManager=TableColumnManager.getInstance();
    tcManager.setDefaultColumnNames(TableManager.TABLE_ALL_PEERS,basicItems);
    tv=TableViewFactory.createTableViewSWT(Peer.class,TableManager.TABLE_ALL_PEERS,getPropertiesPrefix(),basicItems,"String_Node_Str",SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL);
  }
  tv.setRowDefaultHeightEM(1);
  tv.setEnableTabViews(enable_tabs,true,null);
  UIFunctionsSWT uiFunctions=UIFunctionsManagerSWT.getUIFunctionsSWT();
  if (uiFunctions != null) {
    UISWTInstance pluginUI=uiFunctions.getUISWTInstance();
    registerPluginViews(table_id,pluginUI);
  }
  tv.addLifeCycleListener(this);
  tv.addMenuFillListener(this);
  return tv;
}

Fixed version (ground truth):
protected TableViewSWT<PEPeer> initYourTableView(String table_id,boolean enable_tabs){
  if (table_id == TableManager.TABLE_TORRENT_PEERS) {
    tv=TableViewFactory.createTableViewSWT(Peer.class,TableManager.TABLE_TORRENT_PEERS,getPropertiesPrefix(),basicItems,"String_Node_Str",SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL);
  }
 else {
    TableColumnCore[] items=PeersView.getBasicColumnItems(TableManager.TABLE_ALL_PEERS);
    TableColumnCore[] basicItems=new TableColumnCore[items.length + 1];
    System.arraycopy(items,0,basicItems,0,items.length);
    basicItems[items.length]=new DownloadNameItem(TableManager.TABLE_ALL_PEERS);
    TableColumnManager tcManager=TableColumnManager.getInstance();
    tcManager.setDefaultColumnNames(TableManager.TABLE_ALL_PEERS,basicItems);
    tv=TableViewFactory.createTableViewSWT(Peer.class,TableManager.TABLE_ALL_PEERS,getPropertiesPrefix(),basicItems,"String_Node_Str",SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL);
  }
  tv.setRowDefaultHeightEM(1);
  tv.setEnableTabViews(enable_tabs,true,null);
  UIFunctionsSWT uiFunctions=UIFunctionsManagerSWT.getUIFunctionsSWT();
  if (uiFunctions != null) {
    UISWTInstance pluginUI=uiFunctions.getUISWTInstance();
    registerPluginViews(table_id,pluginUI);
  }
  tv.addLifeCycleListener(this);
  tv.addMenuFillListener(this);
  tv.addSelectionListener(this,false);
  return tv;
}
Program: 170777
Project: 170777
Buggy source:
@Override public TableViewSWT<PEPiece> initYourTableView(){
  tv=TableViewFactory.createTableViewSWT(PEPiece.class,TableManager.TABLE_TORRENT_PIECES,getPropertiesPrefix(),basicItems,basicItems[0].getName(),SWT.SINGLE | SWT.FULL_SELECTION | SWT.VIRTUAL);
  tv.setEnableTabViews(enable_tabs,true,null);
  UIFunctionsSWT uiFunctions=UIFunctionsManagerSWT.getUIFunctionsSWT();
  if (uiFunctions != null) {
    UISWTInstance pluginUI=uiFunctions.getUISWTInstance();
    registerPluginViews(pluginUI);
  }
  tv.addTableDataSourceChangedListener(this,true);
  tv.addMenuFillListener(this);
  tv.addLifeCycleListener(this);
  return tv;
}

Fixed version (ground truth):
@Override public TableViewSWT<PEPiece> initYourTableView(){
  tv=TableViewFactory.createTableViewSWT(PEPiece.class,TableManager.TABLE_TORRENT_PIECES,getPropertiesPrefix(),basicItems,basicItems[0].getName(),SWT.SINGLE | SWT.FULL_SELECTION | SWT.VIRTUAL);
  tv.setEnableTabViews(enable_tabs,true,null);
  UIFunctionsSWT uiFunctions=UIFunctionsManagerSWT.getUIFunctionsSWT();
  if (uiFunctions != null) {
    UISWTInstance pluginUI=uiFunctions.getUISWTInstance();
    registerPluginViews(pluginUI);
  }
  tv.addTableDataSourceChangedListener(this,true);
  tv.addMenuFillListener(this);
  tv.addLifeCycleListener(this);
  tv.addSelectionListener(this,false);
  return tv;
}
Program: 170778
Project: 170778
Buggy source:
@Override public boolean eventOccurred(UISWTViewEvent event){
switch (event.getType()) {
case UISWTViewEvent.TYPE_CREATE:
{
      if (event instanceof UISWTViewEventImpl) {
        String parent=((UISWTViewEventImpl)event).getParentID();
        enable_tabs=parent != null && parent.equals(UISWTInstance.VIEW_TORRENT_DETAILS);
      }
      break;
    }
case UISWTViewEvent.TYPE_FOCUSGAINED:
  String id="String_Node_Str";
setFocused(true);
if (manager != null) {
if (manager.getTorrent() != null) {
  id+="String_Node_Str" + manager.getInternalName();
}
 else {
  id+="String_Node_Str" + manager.getSize();
}
SelectedContentManager.changeCurrentlySelectedContent(id,new SelectedContent[]{new SelectedContent(manager)});
}
 else {
SelectedContentManager.changeCurrentlySelectedContent(id,null);
}
break;
case UISWTViewEvent.TYPE_FOCUSLOST:
setFocused(false);
SelectedContentManager.clearCurrentlySelectedContent();
break;
}
return (super.eventOccurred(event));
}

Fixed version (ground truth):
@Override public boolean eventOccurred(UISWTViewEvent event){
switch (event.getType()) {
case UISWTViewEvent.TYPE_CREATE:
{
      if (event instanceof UISWTViewEventImpl) {
        String parent=((UISWTViewEventImpl)event).getParentID();
        enable_tabs=parent != null && parent.equals(UISWTInstance.VIEW_TORRENT_DETAILS);
      }
      break;
    }
case UISWTViewEvent.TYPE_FOCUSGAINED:
  setFocused(true);
updateSelectedContent();
break;
case UISWTViewEvent.TYPE_FOCUSLOST:
setFocused(false);
SelectedContentManager.clearCurrentlySelectedContent();
break;
}
return (super.eventOccurred(event));
}
Program: 170779
Project: 170779
Buggy source:
public static void relayoutUp(Composite c){
  while (c != null && !c.isDisposed()) {
    Composite newParent=c.getParent();
    if (newParent == null) {
      break;
    }
    try {
      newParent.layout(new Control[]{c});
    }
 catch (    SWTException e) {
    }
catch (    NullPointerException e) {
    }
    c=newParent;
  }
}

Fixed version (ground truth):
public static void relayoutUp(Composite c){
  while (c != null && !c.isDisposed()) {
    Composite newParent=c.getParent();
    if (newParent == null) {
      break;
    }
    if (newParent.getData(RELAYOUT_UP_STOP_HERE) != null) {
      break;
    }
    try {
      newParent.layout(new Control[]{c});
    }
 catch (    SWTException e) {
    }
catch (    NullPointerException e) {
    }
    c=newParent;
  }
}
Program: 170783
Project: 170783
Buggy source:
private void swt_triggerInitialize(){
  if (haveSentInitialize) {
    return;
  }
  if (!created) {
    triggerBooleanEvent(UISWTViewEvent.TYPE_CREATE,this);
  }
  if (composite != null) {
    composite.setRedraw(false);
    composite.setLayoutDeferred(true);
    triggerEvent(UISWTViewEvent.TYPE_INITIALIZE,composite);
    if (composite.getLayout() instanceof GridLayout) {
      Control[] children=composite.getChildren();
      for (int i=0; i < children.length; i++) {
        Control control=children[i];
        Object layoutData=control.getLayoutData();
        if (layoutData == null || !(layoutData instanceof GridData)) {
          if (layoutData != null) {
            Logger.log(new LogEvent(LogIDs.PLUGIN,LogEvent.LT_WARNING,"String_Node_Str" + id + "String_Node_Str"+ control+ "String_Node_Str"+ layoutData.getClass().getName()));
          }
          GridData gridData;
          if (children.length == 1) {
            gridData=new GridData(SWT.FILL,SWT.FILL,true,true);
          }
 else {
            gridData=new GridData();
          }
          control.setLayoutData(gridData);
        }
      }
    }
    composite.layout();
    composite.setLayoutDeferred(false);
    composite.setRedraw(true);
  }
}

Fixed version (ground truth):
private void swt_triggerInitialize(){
  if (haveSentInitialize) {
    return;
  }
  if (!created) {
    triggerBooleanEvent(UISWTViewEvent.TYPE_CREATE,this);
  }
  if (composite != null) {
    composite.setRedraw(false);
    composite.setLayoutDeferred(true);
    triggerEvent(UISWTViewEvent.TYPE_INITIALIZE,composite);
    if (composite.getLayout() instanceof GridLayout) {
      Control[] children=composite.getChildren();
      for (int i=0; i < children.length; i++) {
        Control control=children[i];
        Object layoutData=control.getLayoutData();
        if (layoutData == null || !(layoutData instanceof GridData)) {
          if (layoutData != null) {
            Logger.log(new LogEvent(LogIDs.PLUGIN,LogEvent.LT_WARNING,"String_Node_Str" + id + "String_Node_Str"+ control+ "String_Node_Str"+ layoutData.getClass().getName()));
          }
          GridData gridData;
          if (children.length == 1) {
            gridData=new GridData(SWT.FILL,SWT.FILL,true,true);
          }
 else {
            gridData=new GridData();
          }
          control.setLayoutData(gridData);
        }
      }
    }
    composite.layout();
    composite.setLayoutDeferred(false);
    Utils.relayoutUp(composite);
    composite.setRedraw(true);
  }
}
Program: 170790
Project: 170790
Buggy source:
public void updateUI(){
  if (skinButton != null) {
    skinButton.setImage(base.getImageID());
    String tt=base.getTooltipID();
    if (tt == null) {
      String temp=base.getTextID();
      if (temp != null) {
        String test=temp + "String_Node_Str";
        if (MessageText.keyExists(test)) {
          temp=test;
        }
      }
      tt=temp;
    }
    skinButton.setTooltipID(tt);
  }
  if (skinTitle != null) {
    skinTitle.setTextID(base.getTextID());
  }
  if (base.isAlwaysAvailable()) {
    setEnabled(true);
  }
 else {
    long state=base.getState();
    setEnabled((state & UIToolBarItem.STATE_ENABLED) > 0);
    isDown=(state & UIToolBarItem.STATE_DOWN) > 0;
    if (skinButton != null) {
      skinButton.getSkinObject().switchSuffix(isDown ? "String_Node_Str" : "String_Node_Str",4,false);
    }
  }
}

Fixed version (ground truth):
public void updateUI(){
  if (skinButton != null) {
    skinButton.setImage(base.getImageID());
    String tt=base.getToolTipID();
    if (tt == null) {
      String temp=base.getTextID();
      if (temp != null) {
        String test=temp + "String_Node_Str";
        if (MessageText.keyExists(test)) {
          temp=test;
        }
      }
      tt=temp;
    }
    skinButton.setTooltipID(tt);
  }
  if (skinTitle != null) {
    skinTitle.setTextID(base.getTextID());
  }
  if (base.isAlwaysAvailable()) {
    setEnabled(true);
  }
 else {
    long state=base.getState();
    setEnabled((state & UIToolBarItem.STATE_ENABLED) > 0);
    isDown=(state & UIToolBarItem.STATE_DOWN) > 0;
    if (skinButton != null) {
      skinButton.getSkinObject().switchSuffix(isDown ? "String_Node_Str" : "String_Node_Str",4,false);
    }
  }
}
Program: 170795
Project: 170795
Buggy source:
protected void addExplicitSources(){
  for (int i=0; i < sources.length; i++) {
    try {
      contactFound(db.importContact(sources[i]));
    }
 catch (    Throwable e) {
      Debug.printStackTrace(e);
    }
  }
}

Fixed version (ground truth):
protected void addExplicitSources(){
  for (int i=0; i < sources.length; i++) {
    try {
      InetSocketAddress source=sources[i];
      if (AENetworkClassifier.categoriseAddress(source) == AENetworkClassifier.AT_PUBLIC) {
        contactFound(db.importContact(sources[i]));
      }
    }
 catch (    Throwable e) {
      Debug.printStackTrace(e);
    }
  }
}