nus-yam/ex-repair huggingface dataset:
Program: 93055
Project: 93055
Buggy source:
private void populateColumnList(Table table) throws SQLException {
  Statement statement=connection.createStatement();
  String sql="String_Node_Str";
  ResultSet rs=statement.executeQuery(sql);
  Mediator.getLogger(ShadowSchemaMiner.class.getName()).log(Level.FINEST,sql);
  while (rs.next()) {
    Column column=new Column(rs.getInt("String_Node_Str"),rs.getString("String_Node_Str"),rs.getInt("String_Node_Str"),rs.getString("String_Node_Str"),rs.getInt("String_Node_Str"),rs.getBoolean("String_Node_Str"));
    column.setTable(table);
    table.getColumnList().add(column);
  }
  rs.close();
  statement.close();
}

Fixed version (ground truth):
private void populateColumnList(Table table) throws SQLException {
  Statement statement=connection.createStatement();
  String sql="String_Node_Str" + table.getId() + "String_Node_Str";
  Mediator.getLogger(ShadowSchemaMiner.class.getName()).log(Level.FINEST,sql);
  ResultSet rs=statement.executeQuery(sql);
  while (rs.next()) {
    Column column=new Column(rs.getInt("String_Node_Str"),rs.getString("String_Node_Str"),rs.getInt("String_Node_Str"),rs.getString("String_Node_Str"),rs.getInt("String_Node_Str"),rs.getBoolean("String_Node_Str"));
    column.setTable(table);
    table.getColumnList().add(column);
  }
  rs.close();
  statement.close();
}
Program: 93056
Project: 93056
Buggy source:
private void populateReplicableColumnList(Table table) throws SQLException {
  Statement statement=connection.createStatement();
  String sql="String_Node_Str" + table.getId() + "String_Node_Str";
  ResultSet rs=statement.executeQuery(sql);
  Mediator.getLogger(ShadowSchemaMiner.class.getName()).log(Level.FINEST,sql);
  while (rs.next()) {
    Column cs=new Column(rs.getInt("String_Node_Str"),rs.getString("String_Node_Str"),rs.getInt("String_Node_Str"),rs.getString("String_Node_Str"),rs.getInt("String_Node_Str"),rs.getBoolean("String_Node_Str"));
    cs.setTable(table);
    table.getColumnList().add(cs);
  }
  rs.close();
  statement.close();
}

Fixed version (ground truth):
private void populateReplicableColumnList(Table table) throws SQLException {
  Statement statement=connection.createStatement();
  String sql="String_Node_Str" + table.getId() + "String_Node_Str";
  Mediator.getLogger(ShadowSchemaMiner.class.getName()).log(Level.FINEST,sql);
  ResultSet rs=statement.executeQuery(sql);
  while (rs.next()) {
    Column cs=new Column(rs.getInt("String_Node_Str"),rs.getString("String_Node_Str"),rs.getInt("String_Node_Str"),rs.getString("String_Node_Str"),rs.getInt("String_Node_Str"),rs.getBoolean("String_Node_Str"));
    cs.setTable(table);
    table.getColumnList().add(cs);
  }
  rs.close();
  statement.close();
}
Program: 93058
Project: 93058
Buggy source:
/** 
 * Executes any SQL statement on a database connection.
 * @param conn Connection to use.
 * @param sql SQL statement.
 * @return true if there was no exception, otherwise false.
 */
public static boolean execute(Connection conn,String sql){
  Mediator.getLogger(Sql.class.getName()).log(Level.FINE,"String_Node_Str",sql);
  boolean returnValue=true;
  try {
    PreparedStatement stmt=conn.prepareStatement(sql);
    stmt.execute();
    int updateCount=stmt.getUpdateCount();
    Mediator.getLogger(Sql.class.getName()).log(Level.FINE,"String_Node_Str",updateCount);
  }
 catch (  SQLException ex) {
    Logger.getLogger(Mpi.class.getName()).log(Level.SEVERE,"String_Node_Str" + sql,ex);
    returnValue=false;
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Executes any SQL statement on a database connection.
 * @param conn Connection to use.
 * @param sql SQL statement.
 * @return true if there was no exception, otherwise false.
 */
public static boolean execute(Connection conn,String sql){
  Mediator.getLogger(Sql.class.getName()).log(Level.FINE,"String_Node_Str",sql);
  boolean returnValue=true;
  try {
    PreparedStatement stmt=conn.prepareStatement(sql);
    stmt.execute();
    int updateCount=stmt.getUpdateCount();
    Mediator.getLogger(Sql.class.getName()).log(Level.FINE,"String_Node_Str",updateCount);
    stmt.close();
  }
 catch (  SQLException ex) {
    Logger.getLogger(Mpi.class.getName()).log(Level.SEVERE,"String_Node_Str" + sql,ex);
    returnValue=false;
  }
  return returnValue;
}
Program: 93059
Project: 93059
Buggy source:
/** 
 * Creates a connection to the MPI(/LPI) database. For a query that is run while the results are being fetched from another query, a separate connection is needed. <p> Connections are pooled for speed, and to avoid running out of connections.
 * @return the connection.
 */
public static Connection connect(){
  CachedConnection cc=null;
  Connection conn=null;
  try {
synchronized (connectionPool) {
      while ((cc=connectionPool.poll()) != null) {
        if (System.currentTimeMillis() - cc.cachedTime < WAIT_TIMEOUT_SECONDS * 1000) {
          conn=cc.connection;
          break;
        }
 else {
          cc.connection.close();
        }
      }
    }
    if (conn == null) {
      String url=Mediator.getProperty("String_Node_Str");
      String username=Mediator.getProperty("String_Node_Str");
      String password=Mediator.getProperty("String_Node_Str");
      conn=DriverManager.getConnection(url,username,password);
    }
  }
 catch (  Exception ex) {
    Logger.getLogger(Mpi.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
    System.exit(1);
  }
  return conn;
}

Fixed version (ground truth):
/** 
 * Creates a connection to the MPI(/LPI) database. For a query that is run while the results are being fetched from another query, a separate connection is needed. <p> Connections are pooled for speed, and to avoid running out of connections.
 * @return the connection.
 */
public static Connection connect(){
  CachedConnection cc=null;
  Connection conn=null;
  try {
synchronized (connectionPool) {
      while ((cc=connectionPool.poll()) != null) {
        if (System.currentTimeMillis() - cc.cachedTime < WAIT_TIMEOUT_SECONDS * 1000) {
          conn=cc.connection;
          Mediator.getLogger(Sql.class.getName()).log(Level.FINER,"String_Node_Str");
          break;
        }
 else {
          Mediator.getLogger(Sql.class.getName()).log(Level.FINER,"String_Node_Str");
          cc.connection.close();
        }
      }
    }
    if (conn == null) {
      String url=Mediator.getProperty("String_Node_Str");
      String username=Mediator.getProperty("String_Node_Str");
      String password=Mediator.getProperty("String_Node_Str");
      conn=DriverManager.getConnection(url,username,password);
      Mediator.getLogger(Sql.class.getName()).log(Level.FINER,"String_Node_Str");
    }
  }
 catch (  Exception ex) {
    Logger.getLogger(Mpi.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
    System.exit(1);
  }
  return conn;
}
Program: 93061
Project: 93061
Buggy source:
/** 
 * Executes any SQL statement on a database connection.
 * @param conn Connection to use.
 * @param sql SQL statement.
 * @return true if there was no exception, otherwise false.
 */
public static boolean execute(Connection conn,String sql){
  Mediator.getLogger(Sql.class.getName()).log(Level.FINE,"String_Node_Str",sql);
  boolean returnValue=true;
  try {
    PreparedStatement stmt=conn.prepareStatement(sql);
    returnValue=stmt.execute();
    int updateCount=stmt.getUpdateCount();
    Mediator.getLogger(Sql.class.getName()).log(Level.FINE,"String_Node_Str",updateCount);
  }
 catch (  SQLException ex) {
    Logger.getLogger(Mpi.class.getName()).log(Level.SEVERE,"String_Node_Str" + sql,ex);
    returnValue=false;
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Executes any SQL statement on a database connection.
 * @param conn Connection to use.
 * @param sql SQL statement.
 * @return true if there was no exception, otherwise false.
 */
public static boolean execute(Connection conn,String sql){
  Mediator.getLogger(Sql.class.getName()).log(Level.FINE,"String_Node_Str",sql);
  boolean returnValue=true;
  try {
    PreparedStatement stmt=conn.prepareStatement(sql);
    stmt.execute();
    int updateCount=stmt.getUpdateCount();
    Mediator.getLogger(Sql.class.getName()).log(Level.FINE,"String_Node_Str",updateCount);
  }
 catch (  SQLException ex) {
    Logger.getLogger(Mpi.class.getName()).log(Level.SEVERE,"String_Node_Str" + sql,ex);
    returnValue=false;
  }
  return returnValue;
}
Program: 93064
Project: 93064
Buggy source:
protected void loadDriver() throws DriverNotFoundException {
  try {
    Class.forName(driver);
  }
 catch (  ClassNotFoundException ex) {
    Logger.getLogger(DatabaseConnector.class.getName()).log(Level.SEVERE,null,ex);
    throw new DriverNotFoundException(ex);
  }
}

Fixed version (ground truth):
private void loadDriver() throws DriverNotFoundException {
  try {
    Class.forName(driver);
  }
 catch (  ClassNotFoundException ex) {
    Logger.getLogger(DatabaseConnector.class.getName()).log(Level.SEVERE,null,ex);
    throw new DriverNotFoundException(ex);
  }
}
Program: 93065
Project: 93065
Buggy source:
protected void connectToSource() throws SQLException, InaccessibleConfigurationFileException, DriverNotFoundException {
  loadConnectionProperties("String_Node_Str");
  loadDriver();
  connection=DriverManager.getConnection(url,username,password);
}

Fixed version (ground truth):
protected void connectToSource() throws SQLException, InaccessibleConfigurationFileException, DriverNotFoundException {
  connectToDatabase("String_Node_Str");
}
Program: 93066
Project: 93066
Buggy source:
protected void loadConnectionProperties(String propertiesFile) throws InaccessibleConfigurationFileException {
  try {
    Properties properties=new Properties();
    properties.load(new FileInputStream(propertiesFile));
    database=properties.getProperty("String_Node_Str");
    url=properties.getProperty("String_Node_Str");
    driver=properties.getProperty("String_Node_Str");
    username=properties.getProperty("String_Node_Str");
    password=properties.getProperty("String_Node_Str");
    schemaPattern=properties.getProperty("String_Node_Str");
    tableTypes=properties.getProperty("String_Node_Str");
    if (tableTypes == null) {
      tableTypes="String_Node_Str";
    }
  }
 catch (  IOException ex) {
    Logger.getLogger(DatabaseConnector.class.getName()).log(Level.SEVERE,null,ex);
    throw new InaccessibleConfigurationFileException(ex);
  }
}

Fixed version (ground truth):
private void loadConnectionProperties(String propertiesFile) throws InaccessibleConfigurationFileException {
  try {
    Properties properties=new Properties();
    properties.load(new FileInputStream(propertiesFile));
    database=properties.getProperty("String_Node_Str");
    url=properties.getProperty("String_Node_Str");
    driver=properties.getProperty("String_Node_Str");
    username=properties.getProperty("String_Node_Str");
    password=properties.getProperty("String_Node_Str");
    schemaPattern=properties.getProperty("String_Node_Str");
    tableTypes=properties.getProperty("String_Node_Str");
    if (tableTypes == null) {
      tableTypes="String_Node_Str";
    }
  }
 catch (  IOException ex) {
    Logger.getLogger(DatabaseConnector.class.getName()).log(Level.SEVERE,null,ex);
    throw new InaccessibleConfigurationFileException(ex);
  }
}
Program: 93067
Project: 93067
Buggy source:
protected void connectToShadow() throws SQLException, InaccessibleConfigurationFileException, DriverNotFoundException {
  loadConnectionProperties("String_Node_Str");
  loadDriver();
  connection=DriverManager.getConnection(url,username,password);
}

Fixed version (ground truth):
protected void connectToShadow() throws SQLException, InaccessibleConfigurationFileException, DriverNotFoundException {
  connectToDatabase("String_Node_Str");
}
Program: 93068
Project: 93068
Buggy source:
private void work() throws InaccessibleConfigurationFileException, DriverNotFoundException, SQLException {
  if (!working) {
    working=true;
    new SchemaSynchronizer().synchronize();
    new DataSynchronizer().synchronize();
    working=false;
  }
}

Fixed version (ground truth):
private void work() throws InaccessibleConfigurationFileException, DriverNotFoundException, SQLException {
  new SchemaSynchronizer().synchronize();
  new DataSynchronizer().synchronize();
  try {
    Thread.sleep(15000);
  }
 catch (  InterruptedException ex) {
    Logger.getLogger(Daemon.class.getName()).log(Level.SEVERE,null,ex);
  }
}
Program: 93069
Project: 93069
Buggy source:
public void start() throws SQLException, InaccessibleConfigurationFileException, DriverNotFoundException {
  connectToSource();
  statement=connection.createStatement();
}

Fixed version (ground truth):
public void start() throws SQLException, InaccessibleConfigurationFileException, DriverNotFoundException {
  connectToSource();
  statement=connection.createStatement();
  statement.setFetchSize(Integer.MIN_VALUE);
}
Program: 93070
Project: 93070
Buggy source:
/** 
 * Test of main method, of class Main.
 */
@Test public void testNotifyPersonChanged(){
  System.out.println("String_Node_Str");
  int requestTypeId=RequestTypeId.NOTIFY_PERSON_CHANGED;
  PersonRequest requestData=new PersonRequest();
  Person p=new Person();
  requestData.setPerson(p);
  List<PersonIdentifier> personIdentifierList=new ArrayList<PersonIdentifier>();
  PersonIdentifier personIdentifier=new PersonIdentifier();
  personIdentifier.setIdentifier("String_Node_Str");
  personIdentifier.setIdentifierType(PersonIdentifier.Type.cccLocalId);
  p.setPersonIdentifierList(personIdentifierList);
  p.setFirstName("String_Node_Str");
  p.setLastName("String_Node_Str");
  p.setMiddleName("String_Node_Str");
  p.setSex(Person.Sex.F);
  p.setPregnancyEndDate(parseDate("String_Node_Str"));
  p.setPregnancyOutcome(Person.PregnancyOutcome.multipleBirths);
  Visit visit=new Visit();
  visit.setAddress("String_Node_Str");
  visit.setVisitDate(new Date());
  p.setLastRegularVisit(visit);
  requestData.setDestinationName("String_Node_Str");
  requestData.setDestinationAddress("String_Node_Str");
  mediator.getData(requestTypeId,requestData);
}

Fixed version (ground truth):
/** 
 * Test of main method, of class Main.
 */
@Test public void testNotifyPersonChanged(){
  System.out.println("String_Node_Str");
  int requestTypeId=RequestTypeId.NOTIFY_PERSON_CHANGED;
  PersonRequest requestData=new PersonRequest();
  Person p=new Person();
  requestData.setPerson(p);
  List<PersonIdentifier> personIdentifierList=new ArrayList<PersonIdentifier>();
  PersonIdentifier personIdentifier=new PersonIdentifier();
  personIdentifier.setIdentifier("String_Node_Str");
  personIdentifier.setIdentifierType(PersonIdentifier.Type.cccLocalId);
  p.setPersonIdentifierList(personIdentifierList);
  p.setFirstName("String_Node_Str");
  p.setLastName("String_Node_Str");
  p.setMiddleName("String_Node_Str");
  p.setSex(Person.Sex.F);
  p.setVillageName("String_Node_Str");
  p.setPreviousVillageName("String_Node_Str");
  p.setLastMoveDate(parseDate("String_Node_Str"));
  Visit visit=new Visit();
  visit.setAddress("String_Node_Str");
  visit.setVisitDate(new Date());
  p.setLastRegularVisit(visit);
  requestData.setDestinationName("String_Node_Str");
  requestData.setDestinationAddress("String_Node_Str");
  mediator.getData(requestTypeId,requestData);
}
Program: 93071
Project: 93071
Buggy source:
/** 
 * Unpacks a generic HL7 person-related message into a <code>Document</code>. <p> Several of the HL7 person-related messages use the same formatting rules, even though the templates differ. (The templates differ only in the boilerplate parts that do not concern us directly.) These messages are: <p> CREATE PERSON <br> MODIFY PERSON <br> NOTIFY PERSON CHANGED
 * @param m the message contents to fill in
 * @param e root node of the person message <code>Document</code> parsed from XML
 */
private void unpackGenericPersonMessage(Message m,Element e){
  PersonRequest personRequest=new PersonRequest();
  personRequest.setXml(m.getXml());
  m.setData(personRequest);
  Person p=new Person();
  personRequest.setPerson(p);
  unpackHl7Header(m,e);
  Element ePerson=(Element)e.getElementsByTagName("String_Node_Str").item(0);
  m.setData(p);
  unpackPerson(p,ePerson);
}

Fixed version (ground truth):
/** 
 * Unpacks a generic HL7 person-related message into a <code>Document</code>. <p> Several of the HL7 person-related messages use the same formatting rules, even though the templates differ. (The templates differ only in the boilerplate parts that do not concern us directly.) These messages are: <p> CREATE PERSON <br> MODIFY PERSON <br> NOTIFY PERSON CHANGED
 * @param m the message contents to fill in
 * @param e root node of the person message <code>Document</code> parsed from XML
 */
private void unpackGenericPersonMessage(Message m,Element e){
  PersonRequest personRequest=new PersonRequest();
  personRequest.setXml(m.getXml());
  m.setData(personRequest);
  Person p=new Person();
  personRequest.setPerson(p);
  unpackHl7Header(m,e);
  Element ePerson=(Element)e.getElementsByTagName("String_Node_Str").item(0);
  unpackPerson(p,ePerson);
}
Program: 93072
Project: 93072
Buggy source:
/** 
 * Waits for a response to this queue entry. The thread will be suspended until either a matching response is received, or the message times out.
 * @param e the queue entry for which to wait.
 * @return the response message if there was one, otherwise null
 */
Message waitForResponse(Entry e){
synchronized (e) {
    if (e.response == null) {
      if (!timeoutThread.isAlive()) {
        timeoutThread.start();
      }
      try {
        e.wait();
      }
 catch (      InterruptedException ex) {
      }
    }
  }
  dequeue(e);
  return e.response;
}

Fixed version (ground truth):
/** 
 * Waits for a response to this queue entry. The thread will be suspended until either a matching response is received, or the message times out.
 * @param e the queue entry for which to wait.
 * @return the response message if there was one, otherwise null
 */
Message waitForResponse(Entry e){
synchronized (timeoutThread) {
    if (!timeoutThread.isAlive()) {
      timeoutThread.start();
    }
  }
synchronized (e) {
    if (e.response == null) {
      try {
        e.wait();
      }
 catch (      InterruptedException ex) {
      }
    }
  }
  dequeue(e);
  return e.response;
}
Program: 93073
Project: 93073
Buggy source:
/** 
 * Unpacks data from an element value. <pre>  {@code <subtree> .... <(tag)> (value) </(tag)> .... </subtree>} </pre>
 * @param subtree Document subtree in which to look for the element
 * @param tag name of the element from which to unpack the value
 * @return value value of the element. If the element was not found,returns null.
 */
private String unpackTagValue(Element subtree,String tag){
  Element e=(Element)subtree.getElementsByTagName(tag).item(0);
  if (e != null) {
    return e.getNodeValue();
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Unpacks data from an element value. <pre>  {@code <subtree> .... <(tag)> (value) </(tag)> .... </subtree>} </pre>
 * @param subtree Document subtree in which to look for the element
 * @param tag name of the element from which to unpack the value
 * @return value value of the element. If the element was not found,returns null.
 */
private String unpackTagValue(Element subtree,String tag){
  Element e=(Element)subtree.getElementsByTagName(tag).item(0);
  if (e != null) {
    return e.getTextContent();
  }
 else {
    return null;
  }
}
Program: 93074
Project: 93074
Buggy source:
/** 
 * Packs a value into a new <code>Element</code>, and links it to a parent <code>Element</code>. If the value is null , the new element is not added
 * @param doc the document we are packing into
 * @param parent parent element for our new element
 * @param elementName name of the new element to create
 * @param value value of the new element to create
 */
private void packNewElement(Document doc,Element parent,String elementName,String value){
  if (value != null) {
    Element element=doc.createElement(elementName);
    element.setNodeValue(value);
    parent.appendChild(element);
  }
}

Fixed version (ground truth):
/** 
 * Packs a value into a new <code>Element</code>, and links it to a parent <code>Element</code>. If the value is null , the new element is not added
 * @param doc the document we are packing into
 * @param parent parent element for our new element
 * @param elementName name of the new element to create
 * @param value value of the new element to create
 */
private void packNewElement(Document doc,Element parent,String elementName,String value){
  if (value != null) {
    Element element=doc.createElement(elementName);
    element.setTextContent(value);
    parent.appendChild(element);
  }
}
Program: 93075
Project: 93075
Buggy source:
/** 
 * Unpacks a Work message <code>Document</code> into message data. Uses Work message type.
 * @param m the message contents to fill in
 * @param e root of the person message <code>Document</code> parsed from XML
 */
private void unpackWorkMessage(Message m,Element e){
  Work work=new Work();
  m.setData(work);
  work.setSourceAddress(e.getElementsByTagName("String_Node_Str").item(0).getNodeValue());
  work.setSourceAddress(e.getElementsByTagName("String_Node_Str").item(0).getNodeValue());
  work.setSourceAddress(e.getElementsByTagName("String_Node_Str").item(0).getNodeValue());
}

Fixed version (ground truth):
/** 
 * Unpacks a Work message <code>Document</code> into message data. Uses Work message type.
 * @param m the message contents to fill in
 * @param e root of the person message <code>Document</code> parsed from XML
 */
private void unpackWorkMessage(Message m,Element e){
  Work work=new Work();
  m.setData(work);
  work.setSourceAddress(e.getElementsByTagName("String_Node_Str").item(0).getTextContent());
  work.setSourceAddress(e.getElementsByTagName("String_Node_Str").item(0).getTextContent());
  work.setSourceAddress(e.getElementsByTagName("String_Node_Str").item(0).getTextContent());
}
Program: 93076
Project: 93076
Buggy source:
/** 
 * Unpacks a Log Entry <code>Document</code> into message data. Uses LogEntry message type.
 * @param m the message contents to fill in
 * @param e root of the person message <code>Document</code> parsed from XML
 */
private void unpackLogEntryMessage(Message m,Element e){
  LogEntry logEntry=new LogEntry();
  m.setData(logEntry);
  logEntry.setSeverity(e.getElementsByTagName("String_Node_Str").item(0).getNodeValue());
  logEntry.setClassName(e.getElementsByTagName("String_Node_Str").item(0).getNodeValue());
  logEntry.setDateTime(unpackDateTime(e.getElementsByTagName("String_Node_Str").item(0).getNodeValue()));
  logEntry.setMessage(e.getElementsByTagName("String_Node_Str").item(0).getNodeValue());
  logEntry.setInstance(e.getElementsByTagName("String_Node_Str").item(0).getNodeValue());
}

Fixed version (ground truth):
/** 
 * Unpacks a Log Entry <code>Document</code> into message data. Uses LogEntry message type.
 * @param m the message contents to fill in
 * @param e root of the person message <code>Document</code> parsed from XML
 */
private void unpackLogEntryMessage(Message m,Element e){
  LogEntry logEntry=new LogEntry();
  m.setData(logEntry);
  logEntry.setSeverity(e.getElementsByTagName("String_Node_Str").item(0).getTextContent());
  logEntry.setClassName(e.getElementsByTagName("String_Node_Str").item(0).getTextContent());
  logEntry.setDateTime(unpackDateTime(e.getElementsByTagName("String_Node_Str").item(0).getTextContent()));
  logEntry.setMessage(e.getElementsByTagName("String_Node_Str").item(0).getTextContent());
  logEntry.setInstance(e.getElementsByTagName("String_Node_Str").item(0).getTextContent());
}
Program: 93077
Project: 93077
Buggy source:
/** 
 * Unpacks a person name into a <code>Person</code> object. For findPerson the tagname containing the name elements is "livingSubjectName". For other person messages the tagName is "name".
 * @param p the person data into which to put the person name.
 * @param e head of the <code>Document</code> subtree in which this person is found
 * @param tagName name of the enclosing element for the person's name
 */
private void unpackPersonName(Person p,Element e,String tagName){
  Element eName=(Element)e.getElementsByTagName("String_Node_Str").item(0);
  if (eName != null) {
    NodeList givenList=eName.getElementsByTagName("String_Node_Str");
    if (givenList.getLength() > 0) {
      p.setFirstName(givenList.item(0).getNodeValue());
      if (givenList.getLength() > 1) {
        p.setMiddleName(givenList.item(1).getNodeValue());
      }
    }
    p.setLastName(unpackTagValue(eName,"String_Node_Str"));
  }
}

Fixed version (ground truth):
/** 
 * Unpacks a person name into a <code>Person</code> object. For findPerson the tagname containing the name elements is "livingSubjectName". For other person messages the tagName is "name".
 * @param p the person data into which to put the person name.
 * @param e head of the <code>Document</code> subtree in which this person is found
 * @param tagName name of the enclosing element for the person's name
 */
private void unpackPersonName(Person p,Element e,String tagName){
  Element eName=(Element)e.getElementsByTagName("String_Node_Str").item(0);
  if (eName != null) {
    NodeList givenList=eName.getElementsByTagName("String_Node_Str");
    if (givenList.getLength() > 0) {
      p.setFirstName(givenList.item(0).getTextContent());
      if (givenList.getLength() > 1) {
        p.setMiddleName(givenList.item(1).getTextContent());
      }
    }
    p.setLastName(unpackTagValue(eName,"String_Node_Str"));
  }
}
Program: 93078
Project: 93078
Buggy source:
/** 
 * FindPerson test of getData method, of class Mediator.
 */
@Test public void testFindPerson(){
  System.out.println("String_Node_Str");
  String instanceName=Mediator.getProperty("String_Node_Str");
  System.out.println("String_Node_Str" + instanceName + "String_Node_Str");
  Mediator mediator=new Mediator();
  PersonRequest requestData=new PersonRequest();
  Person p=new Person();
  requestData.setPerson(p);
  Object result;
  PersonResponse pr;
  List<Person> pList;
  p.setClanName("String_Node_Str");
  result=mediator.getData(RequestTypeId.FIND_PERSON_MPI,requestData);
  assertNotNull(result);
  assertSame(PersonResponse.class,result.getClass());
  pr=(PersonResponse)result;
  assertTrue(pr.isSuccessful());
  assertNull(pr.getPersonList());
  p.setClanName("String_Node_Str");
  result=mediator.getData(RequestTypeId.FIND_PERSON_MPI,requestData);
  assertNotNull(result);
  assertSame(PersonResponse.class,result.getClass());
  pr=(PersonResponse)result;
  assertTrue(pr.isSuccessful());
  pList=pr.getPersonList();
  assertNotNull(pList);
  int pCount=pList.size();
  assertEquals(pCount,8);
  for (int i=0; i < pList.size(); i++) {
    Person person=pList.get(i);
    String guid=person.getPersonGuid();
    for (int j=0; j < i; j++) {
      assertFalse(pList.get(j).getPersonGuid().equals(guid));
    }
  }
  Person p0=pList.get(0);
  int score=p0.getMatchScore();
  assertEquals(score,100);
}

Fixed version (ground truth):
/** 
 * FindPerson test of getData method, of class Mediator.
 */
@Test public void testFindPerson(){
  System.out.println("String_Node_Str");
  String instanceName=Mediator.getProperty("String_Node_Str");
  System.out.println("String_Node_Str" + instanceName + "String_Node_Str");
  Mediator mediator=new Mediator();
  PersonRequest requestData=new PersonRequest();
  Person p=new Person();
  requestData.setPerson(p);
  Object result;
  PersonResponse pr;
  List<Person> pList;
  p.setClanName("String_Node_Str");
  result=mediator.getData(RequestTypeId.FIND_PERSON_MPI,requestData);
  assertNotNull(result);
  assertSame(PersonResponse.class,result.getClass());
  pr=(PersonResponse)result;
  assertTrue(pr.isSuccessful());
  assertNull(pr.getPersonList());
  p.setClanName("String_Node_Str");
  result=mediator.getData(RequestTypeId.FIND_PERSON_MPI,requestData);
  assertNotNull(result);
  assertSame(PersonResponse.class,result.getClass());
  pr=(PersonResponse)result;
  assertTrue(pr.isSuccessful());
  pList=pr.getPersonList();
  assertNotNull(pList);
  int pCount=pList.size();
  assertEquals(pCount,8);
  for (int i=0; i < pList.size(); i++) {
    Person person=pList.get(i);
    assertNotNull(person.getFirstName());
    assertNotNull(person.getMiddleName());
    assertNotNull(person.getLastName());
    String guid=person.getPersonGuid();
    for (int j=0; j < i; j++) {
      assertFalse(pList.get(j).getPersonGuid().equals(guid));
    }
  }
  Person p0=pList.get(0);
  int score=p0.getMatchScore();
  assertEquals(score,100);
}
Program: 93079
Project: 93079
Buggy source:
@Override public boolean appliesTo(Event event){
  return super.appliesTo(event) && event.type == SWT.MouseDoubleClick;
}

Fixed version (ground truth):
/** 
 * MouseDoubleClick event does not set event.item, so only event.widget should be checked. Also, single selection is necessary before MouseDoubleClick.
 */
@Override public boolean appliesTo(Event event){
  return event.widget instanceof Tree && event.type == SWT.MouseDoubleClick && ((Tree)event.widget).getSelectionCount() == 1;
}
Program: 93080
Project: 93080
Buggy source:
/** 
 * Double clicks on this node.
 * @return the current node.
 * @since 1.2
 */
public SWTBotTreeItem doubleClick(){
  waitForEnabled();
  log.debug(MessageFormat.format("String_Node_Str",this));
  notifyTree(SWT.MouseEnter,createMouseEvent(0,SWT.NONE,0));
  notifyTree(SWT.Activate,super.createEvent());
  syncExec(new VoidResult(){
    @Override public void run(){
      if (tree.getSelectionCount() != 1 || !tree.getSelection()[0].equals(widget)) {
        tree.setSelection(widget);
      }
      if (!tree.isFocusControl()) {
        tree.setFocus();
      }
    }
  }
);
  notifyTree(SWT.FocusIn,super.createEvent());
  notifyTree(SWT.MouseDown,createMouseEvent(1,SWT.NONE,1));
  notifyTree(SWT.Selection);
  notifyTree(SWT.MouseUp,createMouseEvent(1,SWT.BUTTON1,1));
  notifyTree(SWT.MouseDown,createMouseEvent(1,SWT.NONE,2));
  notifyTree(SWT.Selection);
  notifyTree(SWT.MouseDoubleClick,createMouseEvent(1,SWT.NONE,2));
  notifyTree(SWT.DefaultSelection);
  notifyTree(SWT.MouseUp,createMouseEvent(1,SWT.BUTTON1,2));
  notifyTree(SWT.MouseExit,createMouseEvent(0,SWT.NONE,0));
  notifyTree(SWT.Deactivate,super.createEvent());
  notifyTree(SWT.FocusOut,super.createEvent());
  log.debug(MessageFormat.format("String_Node_Str",this));
  return this;
}

Fixed version (ground truth):
/** 
 * Double clicks on this node.
 * @return the current node.
 * @since 1.2
 */
public SWTBotTreeItem doubleClick(){
  waitForEnabled();
  log.debug(MessageFormat.format("String_Node_Str",this));
  notifyTree(SWT.MouseEnter,createMouseEvent(0,SWT.NONE,0));
  notifyTree(SWT.Activate,super.createEvent());
  syncExec(new VoidResult(){
    @Override public void run(){
      if (tree.getSelectionCount() != 1 || !tree.getSelection()[0].equals(widget)) {
        tree.setSelection(widget);
      }
      if (!tree.isFocusControl()) {
        tree.setFocus();
      }
    }
  }
);
  notifyTree(SWT.FocusIn,super.createEvent());
  notifyTree(SWT.MouseDown,createMouseEvent(1,SWT.NONE,1));
  notifyTree(SWT.Selection);
  notifyTree(SWT.MouseUp,createMouseEvent(1,SWT.BUTTON1,1));
  notifyTree(SWT.MouseDown,createMouseEvent(1,SWT.NONE,2));
  notifyTree(SWT.MouseDoubleClick,createMouseEvent(1,SWT.NONE,2));
  notifyTree(SWT.DefaultSelection);
  notifyTree(SWT.MouseUp,createMouseEvent(1,SWT.BUTTON1,2));
  notifyTree(SWT.MouseExit,createMouseEvent(0,SWT.NONE,0));
  notifyTree(SWT.Deactivate,super.createEvent());
  notifyTree(SWT.FocusOut,super.createEvent());
  log.debug(MessageFormat.format("String_Node_Str",this));
  return this;
}
Program: 93081
Project: 93081
Buggy source:
@Test public void canRightClickOnANode() throws Exception {
  SWTBotTreeItem node=tree.expandNode("String_Node_Str").expandNode("String_Node_Str").expandNode("String_Node_Str");
  bot.button("String_Node_Str").click();
  node.contextMenu("String_Node_Str").click();
  assertEventMatches(listeners,"String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(0,tree.widget) + "String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void canRightClickOnANode() throws Exception {
  SWTBotTreeItem node=tree.expandNode("String_Node_Str").expandNode("String_Node_Str").expandNode("String_Node_Str");
  bot.button("String_Node_Str").click();
  node.contextMenu("String_Node_Str").click();
  assertEventMatches(listeners,"String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(SWT.BUTTON1,tree.widget) + "String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str");
}
Program: 93082
Project: 93082
Buggy source:
/** 
 * Selects the given index items. Replaces the current selection. If there is more than one item to select, the table must have the SWT.MULTI style.
 * @param indices the row indices to select in the table.
 */
public void select(final int... indices){
  waitForEnabled();
  if (indices.length > 1) {
    assertMultiSelect();
  }
 else   if (indices.length == 0) {
    unselect();
    return;
  }
  setFocus();
  log.debug(MessageFormat.format("String_Node_Str",StringUtils.join(indices,"String_Node_Str"),this));
  for (int i=0; i < indices.length; i++) {
    assertIsLegalRowIndex(indices[i]);
  }
  asyncExec(new VoidResult(){
    public void run(){
      for (int i=0; i < indices.length; i++) {
        lastSelectionItem=widget.getItem(indices[i]);
        if (i == 0) {
          widget.setSelection(indices[0]);
          notifySelect();
        }
 else {
          widget.select(indices[i]);
          notifySelect(true);
        }
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Selects the given index items. Replaces the current selection. If there is more than one item to select, the table must have the SWT.MULTI style.
 * @param indices the row indices to select in the table.
 */
public void select(final int... indices){
  waitForEnabled();
  if (indices.length > 1) {
    assertMultiSelect();
  }
 else   if (indices.length == 0) {
    unselect();
    return;
  }
  setFocus();
  log.debug(MessageFormat.format("String_Node_Str",Arrays.toString(indices),this));
  for (int i=0; i < indices.length; i++) {
    assertIsLegalRowIndex(indices[i]);
  }
  final List<TableItem> selection=new ArrayList<TableItem>();
  for (  int index : indices) {
    selection.add(getItem(index));
  }
  for (int i=0; i < selection.size(); i++) {
    boolean add=(i != 0);
    processSelection(selection.get(i),add);
    notifySelect(add);
  }
}
Program: 93083
Project: 93083
Buggy source:
/** 
 * Unselects the given row.
 * @param row index of the row to unselect
 */
private void unselect(final int row){
  waitForEnabled();
  setFocus();
  asyncExec(new VoidResult(){
    public void run(){
      if (widget.isSelected(row)) {
        log.debug(MessageFormat.format("String_Node_Str",row,widget));
        widget.deselect(row);
        lastSelectionItem=widget.getItem(row);
        notifySelect(true);
      }
 else {
        log.debug(MessageFormat.format("String_Node_Str",widget));
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Unselects the given table item.
 * @param item table item to unselect
 */
private void unselect(final TableItem item){
  asyncExec(new VoidResult(){
    public void run(){
      widget.deselect(widget.indexOf(item));
      lastSelectionItem=item;
    }
  }
);
}
Program: 93084
Project: 93084
Buggy source:
/** 
 * Selects the indices provided. Replaces the current selection. If there is more than one item to select, the tree must have the SWT.MULTI style.
 * @param indices the indices to select.
 * @return this same instance.
 */
public SWTBotTree select(final int... indices){
  waitForEnabled();
  setFocus();
  if (indices.length > 1) {
    assertMultiSelect();
  }
 else   if (indices.length == 0) {
    return unselect();
  }
  asyncExec(new VoidResult(){
    public void run(){
      log.debug(MessageFormat.format("String_Node_Str",StringUtils.join(indices,"String_Node_Str"),this));
      for (int i=0; i < indices.length; i++) {
        lastSelectionItem=widget.getItem(indices[i]);
        processSelection(i);
      }
    }
  }
);
  return this;
}

Fixed version (ground truth):
/** 
 * Selects the indices provided. Replaces the current selection. If there is more than one item to select, the tree must have the SWT.MULTI style.
 * @param indices the indices to select.
 * @return this same instance.
 */
public SWTBotTree select(final int... indices){
  waitForEnabled();
  setFocus();
  if (indices.length > 1) {
    assertMultiSelect();
  }
 else   if (indices.length == 0) {
    return unselect();
  }
  final List<TreeItem> selection=new ArrayList<TreeItem>();
  for (  int index : indices) {
    selection.add(getItem(index));
  }
  log.debug(MessageFormat.format("String_Node_Str",Arrays.toString(indices),this));
  for (int i=0; i < selection.size(); i++) {
    boolean add=(i != 0);
    processSelection(selection.get(i),add);
    notifySelect(add);
  }
  return this;
}
Program: 93085
Project: 93085
Buggy source:
/** 
 * Unselects the selection in the tree.
 * @return this same instance.
 */
public SWTBotTree unselect(){
  waitForEnabled();
  asyncExec(new VoidResult(){
    public void run(){
      log.debug(MessageFormat.format("String_Node_Str",widget));
      TreeItem[] items=widget.getSelection();
      for (      TreeItem item : items) {
        widget.deselect(item);
        lastSelectionItem=item;
        notifySelect(true);
      }
    }
  }
);
  return this;
}

Fixed version (ground truth):
/** 
 * Unselects the given tree item.
 * @param item tree item to unselect
 */
private void unselect(final TreeItem item){
  asyncExec(new VoidResult(){
    public void run(){
      widget.deselect(item);
      lastSelectionItem=item;
    }
  }
);
}
Program: 93086
Project: 93086
Buggy source:
/** 
 * Selects widget and notifies selection
 * @param i index of item getting selected
 */
private void processSelection(int i){
  if (i == 0) {
    widget.setSelection(lastSelectionItem);
    notifySelect();
  }
 else {
    widget.select(lastSelectionItem);
    notifySelect(true);
  }
}

Fixed version (ground truth):
/** 
 * Selects a tree item
 * @param item the tree item to select
 * @param add true to add to current selection
 */
private void processSelection(final TreeItem item,final boolean add){
  syncExec(new VoidResult(){
    public void run(){
      if (add) {
        widget.select(item);
      }
 else {
        widget.setSelection(item);
      }
      lastSelectionItem=item;
    }
  }
);
}
Program: 93087
Project: 93087
Buggy source:
@Test public void clicksOnALinkWithHyperlinkTextAndHREF() throws Exception {
  link.click("String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(0,link.widget) + "String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(0,link.widget) + "String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(524288,link.widget) + "String_Node_Str");
}

Fixed version (ground truth):
@Test public void clicksOnALinkWithHyperlinkTextAndHREF() throws Exception {
  link.click("String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(0,link.widget) + "String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(0,link.widget) + "String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(0,link.widget) + "String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(SWT.BUTTON1,link.widget) + "String_Node_Str");
}
Program: 93088
Project: 93088
Buggy source:
@Test public void clicksOnALinkWithHyperlinkTextAndNoHREF() throws Exception {
  link.click("String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(0,link.widget) + "String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(0,link.widget) + "String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(524288,link.widget) + "String_Node_Str");
}

Fixed version (ground truth):
@Test public void clicksOnALinkWithHyperlinkTextAndNoHREF() throws Exception {
  link.click("String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(0,link.widget) + "String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(0,link.widget) + "String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(0,link.widget) + "String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(SWT.BUTTON1,link.widget) + "String_Node_Str");
}
Program: 93089
Project: 93089
Buggy source:
@Test public void clicksOnALink() throws Exception {
  link.click();
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(0,link.widget) + "String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(524288,link.widget) + "String_Node_Str");
}

Fixed version (ground truth):
@Test public void clicksOnALink() throws Exception {
  link.click();
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(0,link.widget) + "String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(0,link.widget) + "String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(0,link.widget) + "String_Node_Str");
  assertEventMatches(listeners,"String_Node_Str" + toStateMask(SWT.BUTTON1,link.widget) + "String_Node_Str");
}
Program: 93090
Project: 93090
Buggy source:
/** 
 * Clicks on the hyperlink with the specified text.
 * @param hyperlinkText the text of the hyperlink in case there are more than one hyperlinks.
 * @return itself.
 */
public AbstractSWTBot<Link> click(String hyperlinkText){
  String text=getText();
  boolean isText=text.contains("String_Node_Str" + hyperlinkText + "String_Node_Str");
  Assert.isLegal(isText,"String_Node_Str" + hyperlinkText + "String_Node_Str"+ text+ "String_Node_Str");
  hyperlinkText=extractHyperlinkTextOrHREF(hyperlinkText,text);
  notify(SWT.MouseDown,createMouseEvent(0,0,1,SWT.NONE,1));
  notify(SWT.Selection,createHyperlinkEvent(hyperlinkText));
  notify(SWT.MouseUp,createMouseEvent(0,0,1,SWT.BUTTON1,1));
  return this;
}

Fixed version (ground truth):
/** 
 * Clicks on the hyperlink with the specified text.
 * @param hyperlinkText the text of the hyperlink in case there are more than one hyperlinks.
 * @return itself.
 */
public AbstractSWTBot<Link> click(String hyperlinkText){
  String text=getText();
  boolean isText=text.contains("String_Node_Str" + hyperlinkText + "String_Node_Str");
  Assert.isLegal(isText,"String_Node_Str" + hyperlinkText + "String_Node_Str"+ text+ "String_Node_Str");
  hyperlinkText=extractHyperlinkTextOrHREF(hyperlinkText,text);
  notify(SWT.MouseEnter,createMouseEvent(0,0,0,SWT.NONE,0));
  notify(SWT.Activate,createEvent());
  notify(SWT.FocusIn,createEvent());
  notify(SWT.MouseDown,createMouseEvent(0,0,1,SWT.NONE,1));
  notify(SWT.Selection,createHyperlinkEvent(hyperlinkText));
  notify(SWT.MouseUp,createMouseEvent(0,0,1,SWT.BUTTON1,1));
  return this;
}
Program: 93091
Project: 93091
Buggy source:
/** 
 * Unselects the given table item.
 * @param item table item to unselect
 */
private void unselect(final TableItem item){
  asyncExec(new VoidResult(){
    public void run(){
      widget.deselect(widget.indexOf(item));
      lastSelectionItem=item;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Unselects the given table item.
 * @param item table item to unselect
 */
private void unselect(final TableItem item){
  syncExec(new VoidResult(){
    public void run(){
      widget.deselect(widget.indexOf(item));
      lastSelectionItem=item;
    }
  }
);
}
Program: 93092
Project: 93092
Buggy source:
/** 
 * Unselects the given tree item.
 * @param item tree item to unselect
 */
private void unselect(final TreeItem item){
  asyncExec(new VoidResult(){
    public void run(){
      widget.deselect(item);
      lastSelectionItem=item;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Unselects the given tree item.
 * @param item tree item to unselect
 */
private void unselect(final TreeItem item){
  syncExec(new VoidResult(){
    public void run(){
      widget.deselect(item);
      lastSelectionItem=item;
    }
  }
);
}
Program: 93093
Project: 93093
Buggy source:
@Override public boolean appliesTo(Event event){
  return event.widget instanceof Button && (((Button)event.widget).getStyle() & SWT.RADIO) != 0 && event.type == SWT.Selection;
}

Fixed version (ground truth):
@Override public boolean appliesTo(Event event){
  return event.widget instanceof Button && (((Button)event.widget).getStyle() & SWT.CHECK) != 0 && event.type == SWT.Selection;
}
Program: 93094
Project: 93094
Buggy source:
/** 
 * @param menu
 * @param matcher
 * @param recursive
 * @return
 */
private List<MenuItem> findMenusInternal(final Menu menu,final Matcher<MenuItem> matcher,final boolean recursive){
  LinkedHashSet<MenuItem> result=new LinkedHashSet<MenuItem>();
  if (menu != null) {
    MenuItem[] items=menu.getItems();
    for (    MenuItem menuItem : items) {
      if (menuItem.isDisposed() || isSeparator(menuItem)) {
        continue;
      }
      boolean matches=matcher.matches(menuItem);
      if (matches) {
        menuItem.notifyListeners(SWT.Arm,createEvent(menuItem));
        Menu subMenu=menuItem.getMenu();
        if (subMenu != null) {
          subMenu.notifyListeners(SWT.Show,createEvent(subMenu));
        }
        result.add(menuItem);
      }
      if (recursive) {
        Menu subMenu=menuItem.getMenu();
        if (subMenu != null) {
          if (!matches) {
            menuItem.notifyListeners(SWT.Arm,createEvent(menuItem));
            menu.notifyListeners(SWT.Show,createEvent(menu));
          }
          List<MenuItem> menuItems=findMenusInternal(menuItem.getMenu(),matcher,recursive);
          if (!menuItems.isEmpty()) {
            result.addAll(menuItems);
          }
 else {
            menu.notifyListeners(SWT.Hide,createEvent(menu));
          }
        }
      }
    }
  }
  return new ArrayList<MenuItem>(result);
}

Fixed version (ground truth):
/** 
 * @param menu
 * @param matcher
 * @param recursive
 * @return
 */
private List<MenuItem> findMenusInternal(final Menu menu,final Matcher<MenuItem> matcher,final boolean recursive){
  LinkedHashSet<MenuItem> result=new LinkedHashSet<MenuItem>();
  if (menu != null) {
    MenuItem[] items=menu.getItems();
    for (    MenuItem menuItem : items) {
      if (menuItem.isDisposed() || isSeparator(menuItem)) {
        continue;
      }
      boolean matches=matcher.matches(menuItem);
      if (matches) {
        menuItem.notifyListeners(SWT.Arm,createEvent(menuItem));
        Menu subMenu=menuItem.getMenu();
        if (subMenu != null) {
          subMenu.notifyListeners(SWT.Show,createEvent(subMenu));
        }
        result.add(menuItem);
      }
      if (recursive) {
        Menu subMenu=menuItem.getMenu();
        if (subMenu != null) {
          if (!matches) {
            menuItem.notifyListeners(SWT.Arm,createEvent(menuItem));
            subMenu.notifyListeners(SWT.Show,createEvent(subMenu));
          }
          List<MenuItem> menuItems=findMenusInternal(subMenu,matcher,recursive);
          if (!menuItems.isEmpty()) {
            result.addAll(menuItems);
          }
 else           if (!matches) {
            subMenu.notifyListeners(SWT.Hide,createEvent(subMenu));
          }
        }
      }
    }
  }
  return new ArrayList<MenuItem>(result);
}
Program: 93095
Project: 93095
Buggy source:
/** 
 * Gets the menubar for the given shell.
 * @see org.eclipse.swtbot.swt.finder.finders.MenuFinder#menuBar(org.eclipse.swt.widgets.Shell)
 * @param shell The shell to find the menu bar for.
 * @return The menu bar found.
 */
@Override protected Menu menuBar(final Shell shell){
  return UIThreadRunnable.syncExec(display,new WidgetResult<Menu>(){
    public Menu run(){
      return control.getMenu();
    }
  }
);
}

Fixed version (ground truth):
@Override protected Menu menuBar(final Shell shell){
  return UIThreadRunnable.syncExec(display,new WidgetResult<Menu>(){
    public Menu run(){
      return control.getMenu();
    }
  }
);
}