nus-yam/ex-repair huggingface dataset:
Program: 97619
Project: 97619
Buggy source:
/** 
 * <p> This test needs to be re-evaluated or discarded if OSEE decides to implement their <br/> own requirement storage and DSL. </p>
 * @throws Exception
 */
@org.junit.Test public void testEditUsingWordTemplateRender() throws Exception {
  SevereLoggingMonitor monitorLog=TestUtil.severeLoggingStart();
  Artifact artifact=createArtifact(branch,ARTIFACT_NAME_1);
  artifact.persist(getClass().getSimpleName());
  String testData=Lib.fileToString(getClass(),TEST_WORD_EDIT_FILE_NAME);
  Assert.assertNotNull(testData);
  String expected=replaceGuidMarkers(testData,artifact.getGuid());
  FileSystemRenderer renderer=new WordTemplateRenderer();
  IFile editFile=openArtifactForEdit(renderer,artifact);
  writeNewContentAndWaitForSave(artifact,editFile,expected);
  String actual=getRenderedStoredContent(renderer,artifact);
  Assert.assertEquals(expected,actual);
  TestUtil.severeLoggingEnd(monitorLog);
}

Fixed version (ground truth):
@Test public void testEditUsingWordTemplateRender() throws Exception {
  SevereLoggingMonitor monitorLog=TestUtil.severeLoggingStart();
  Artifact artifact=createArtifact(branch,ARTIFACT_NAME_1);
  artifact.persist(getClass().getSimpleName());
  String testData=Lib.fileToString(getClass(),TEST_WORD_EDIT_FILE_NAME);
  Assert.assertNotNull(testData);
  String expected=replaceGuidMarkers(testData,artifact.getGuid());
  FileSystemRenderer renderer=new WordTemplateRenderer();
  IFile editFile=openArtifactForEdit(renderer,artifact);
  writeNewContentAndWaitForSave(artifact,editFile,expected);
  String actual=getRenderedStoredContent(renderer,artifact);
  Assert.assertEquals(expected,actual);
  TestUtil.severeLoggingEnd(monitorLog);
}
Program: 97620
Project: 97620
Buggy source:
public static byte[] getFormattedContent(Element formattedItemElement) throws XMLStreamException {
  ByteArrayOutputStream data=new ByteArrayOutputStream((int)Math.pow(2,10));
  XMLStreamWriter xmlWriter=null;
  try {
    xmlWriter=XMLOutputFactory.newInstance().createXMLStreamWriter(data);
    for (    Element e : Jaxp.getChildDirects(formattedItemElement)) {
      Jaxp.writeNode(xmlWriter,e,false);
    }
  }
  finally {
    if (xmlWriter != null) {
      xmlWriter.flush();
      xmlWriter.close();
    }
  }
  return data.toByteArray();
}

Fixed version (ground truth):
public static byte[] getFormattedContent(Element formattedItemElement) throws XMLStreamException {
  ByteArrayOutputStream data=new ByteArrayOutputStream((int)Math.pow(2,10));
  XMLStreamWriter xmlWriter=null;
  try {
    xmlWriter=XMLOutputFactory.newInstance().createXMLStreamWriter(data,"String_Node_Str");
    for (    Element e : Jaxp.getChildDirects(formattedItemElement)) {
      Jaxp.writeNode(xmlWriter,e,false);
    }
  }
  finally {
    if (xmlWriter != null) {
      xmlWriter.flush();
      xmlWriter.close();
    }
  }
  return data.toByteArray();
}
Program: 97622
Project: 97622
Buggy source:
public void cleanup(){
  filename=null;
  unitNumber=null;
  if (coverageDataFile != null) {
    coverageDataFile.cleanup();
  }
  if (vcpSourceLisFile != null) {
    vcpSourceLisFile.cleanup();
  }
}

Fixed version (ground truth):
public void cleanup(){
  unitNumber=null;
  if (coverageDataFile != null) {
    coverageDataFile.cleanup();
  }
  if (vcpSourceLisFile != null) {
    vcpSourceLisFile.cleanup();
  }
}
Program: 97623
Project: 97623
Buggy source:
public static Date getDate(Object object) throws OseeCoreException {
  if (Artifacts.isOfType(object,AtsArtifactTypes.Action)) {
    getDate(ActionManager.getFirstTeam(object));
  }
 else   if (object instanceof AbstractWorkflowArtifact) {
    AbstractWorkflowArtifact awa=(AbstractWorkflowArtifact)object;
    if (((AbstractWorkflowArtifact)object).isCancelled()) {
      Date date=((AbstractWorkflowArtifact)object).internalGetCancelledDate();
      if (date == null) {
        OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,"String_Node_Str" + awa.getHumanReadableId());
      }
      return date;
    }
  }
  return null;
}

Fixed version (ground truth):
public static Date getDate(Object object) throws OseeCoreException {
  if (Artifacts.isOfType(object,AtsArtifactTypes.Action)) {
    getDate(ActionManager.getFirstTeam(object));
  }
 else   if (object instanceof AbstractWorkflowArtifact) {
    AbstractWorkflowArtifact awa=(AbstractWorkflowArtifact)object;
    if (((AbstractWorkflowArtifact)object).isCancelled()) {
      Date date=((AbstractWorkflowArtifact)object).internalGetCancelledDate();
      if (date == null) {
        OseeLog.log(Activator.class,Level.SEVERE,"String_Node_Str" + awa.getHumanReadableId());
      }
      return date;
    }
  }
  return null;
}
Program: 97624
Project: 97624
Buggy source:
public static Date getDate(Object object) throws OseeCoreException {
  if (Artifacts.isOfType(object,AtsArtifactTypes.Action)) {
    getDate(ActionManager.getFirstTeam(object));
  }
 else   if (object instanceof AbstractWorkflowArtifact) {
    AbstractWorkflowArtifact awa=(AbstractWorkflowArtifact)object;
    if (((AbstractWorkflowArtifact)object).isCompleted()) {
      Date date=((AbstractWorkflowArtifact)object).getCompletedDate();
      if (date == null) {
        OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,"String_Node_Str" + awa.getHumanReadableId());
      }
      return date;
    }
  }
  return null;
}

Fixed version (ground truth):
public static Date getDate(Object object) throws OseeCoreException {
  if (Artifacts.isOfType(object,AtsArtifactTypes.Action)) {
    getDate(ActionManager.getFirstTeam(object));
  }
 else   if (object instanceof AbstractWorkflowArtifact) {
    AbstractWorkflowArtifact awa=(AbstractWorkflowArtifact)object;
    if (((AbstractWorkflowArtifact)object).isCompleted()) {
      Date date=((AbstractWorkflowArtifact)object).getCompletedDate();
      if (date == null) {
        OseeLog.log(Activator.class,Level.SEVERE,"String_Node_Str" + awa.getHumanReadableId());
      }
      return date;
    }
  }
  return null;
}
Program: 97625
Project: 97625
Buggy source:
@Override public IStatus run(IProgressMonitor monitor) throws Exception {
  File outfile=AWorkspace.iFileToFile(file);
  if (outfile.length() > _20_MB) {
    OseeLog.logf(MarkerPlugin.class,Level.WARNING,"String_Node_Str",file.getName(),outfile.length(),_20_MB);
    return Status.OK_STATUS;
  }
  if (!file.isSynchronized(0)) {
    OseeLog.logf(MarkerPlugin.class,Level.WARNING,"String_Node_Str",file.getName());
    file.refreshLocal(0,monitor);
  }
  monitor.setTaskName(String.format("String_Node_Str",file.getName()));
  FileInputStream contents=new FileInputStream(outfile);
  boolean hadParseException=false;
  int numberOfTries=0;
  do {
    try {
      hadParseException=false;
      parseContents(contents);
    }
 catch (    SAXParseException ex) {
      hadParseException=true;
      System.out.println("String_Node_Str" + numberOfTries);
    }
 finally {
      numberOfTries++;
    }
  }
 while (hadParseException && (numberOfTries < 5));
  OteMarkerHelper helper=new OteMarkerHelper(this.testPointDatas);
  MarkerPlugin.updateMarkerInfo(file,helper.getMarkers());
  return Status.OK_STATUS;
}

Fixed version (ground truth):
@Override public IStatus run(IProgressMonitor monitor) throws Exception {
  File outfile=AWorkspace.iFileToFile(file);
  if (outfile.length() > _20_MB) {
    OseeLog.logf(MarkerPlugin.class,Level.WARNING,"String_Node_Str",file.getName(),outfile.length(),_20_MB);
    return Status.OK_STATUS;
  }
  if (!file.isSynchronized(0)) {
    OseeLog.logf(MarkerPlugin.class,Level.WARNING,"String_Node_Str",file.getName());
    file.refreshLocal(0,monitor);
  }
  monitor.setTaskName(String.format("String_Node_Str",file.getName()));
  boolean hadParseException=false;
  int numberOfTries=0;
  do {
    FileInputStream contents=new FileInputStream(outfile);
    try {
      hadParseException=false;
      parseContents(contents);
    }
 catch (    Exception ex) {
      hadParseException=true;
      System.out.println("String_Node_Str" + numberOfTries);
    }
 finally {
      numberOfTries++;
      Thread.sleep(1000);
    }
  }
 while (hadParseException && (numberOfTries < 5));
  if (numberOfTries > 1) {
    FileInputStream contents=new FileInputStream(outfile);
    parseContents(contents);
  }
  OteMarkerHelper helper=new OteMarkerHelper(this.testPointDatas);
  MarkerPlugin.updateMarkerInfo(file,helper.getMarkers());
  return Status.OK_STATUS;
}
Program: 97626
Project: 97626
Buggy source:
/** 
 * This should NOT be called directly, users should call the HostDataStore's disconnect.
 */
public boolean disconnect(ConnectionEvent event){
  connectedEnv=null;
  sessionKey=null;
  guidToScriptTask.clear();
  return false;
}

Fixed version (ground truth):
/** 
 * This should NOT be called directly, users should call the HostDataStore's disconnect.
 */
public boolean disconnect(ConnectionEvent event){
  connectedEnv=null;
  sessionKey=null;
  guidToScriptTask.clear();
  statusListenerImpl.unregisterEventListener();
  return false;
}
Program: 97627
Project: 97627
Buggy source:
public TestManagerStatusListener(TestManagerEditor testManagerEditor,ScriptManager userEnvironment){
  this.testManagerServiceDataVisitor=new TestManagerServiceStatusDataVisitor(userEnvironment,testManagerEditor);
  Hashtable<String,Object> properties=new Hashtable<String,Object>();
  properties.put("String_Node_Str","String_Node_Str");
  FrameworkUtil.getBundle(getClass()).getBundleContext().registerService(EventHandler.class.getName(),this,properties);
}

Fixed version (ground truth):
public TestManagerStatusListener(TestManagerEditor testManagerEditor,ScriptManager userEnvironment){
  this.testManagerServiceDataVisitor=new TestManagerServiceStatusDataVisitor(userEnvironment,testManagerEditor);
  Hashtable<String,Object> properties=new Hashtable<String,Object>();
  properties.put("String_Node_Str","String_Node_Str");
  eventReference=FrameworkUtil.getBundle(getClass()).getBundleContext().registerService(EventHandler.class.getName(),this,properties);
}
Program: 97628
Project: 97628
Buggy source:
/** 
 * @return true if the user accepts the purging of the attributes and relations that are not compatible for the newartifact type else false.
 */
private static boolean doesUserAcceptArtifactChange(final Artifact artifact,final ArtifactType artifactType){
  if ((!relationsToDelete.isEmpty() || !attributesToPurge.isEmpty()) && !userAnsweredYesToAll) {
    StringBuffer sb=new StringBuffer(50);
    getConflictString(sb,artifact,artifactType);
    try {
      Object result=DebugPlugin.getDefault().getStatusHandler(promptStatus).handleStatus(promptStatus,sb.toString());
      MutableBoolean answer=null;
      if (result instanceof Pair<?,?>) {
        Pair<?,?> value=(Pair<?,?>)result;
        answer=(MutableBoolean)value.getFirst();
        Integer kindOfAnswer=(Integer)value.getSecond();
        userAnsweredYesToAll=kindOfAnswer == 1 && answer.getValue();
      }
      return answer == null ? false : answer.getValue();
    }
 catch (    Exception ex) {
      OseeLog.log(Activator.class,Level.SEVERE,ex);
      return false;
    }
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
/** 
 * @return true if the user accepts the deletion of the attributes and relations that are not compatible for the newartifact type else false.
 */
private boolean doesUserAcceptArtifactChange(IArtifactType artifactType) throws OseeCoreException {
  if (!relationTypes.isEmpty() || !attributeTypes.isEmpty()) {
    StringBuilder sb=new StringBuilder(1024);
    getConflictString(sb,artifactType);
    Object result;
    try {
      result=DebugPlugin.getDefault().getStatusHandler(promptStatus).handleStatus(promptStatus,sb.toString());
    }
 catch (    CoreException ex) {
      OseeExceptions.wrapAndThrow(ex);
      return false;
    }
    return (Boolean)result;
  }
 else {
    return true;
  }
}
Program: 97629
Project: 97629
Buggy source:
private static void getConflictString(StringBuffer results,Artifact artifact,IArtifactType artifactType){
  results.append("String_Node_Str" + artifact.getGuid() + "String_Node_Str"+ artifact.getName()+ "String_Node_Str"+ "String_Node_Str"+ artifactType.getName()+ "String_Node_Str"+ "String_Node_Str");
  for (  RelationLink relationLink : relationsToDelete) {
    results.append("String_Node_Str" + relationLink + "String_Node_Str");
  }
  for (  Attribute<?> attribute : attributesToPurge) {
    results.append("String_Node_Str" + attribute.getAttributeType().getName() + "String_Node_Str"+ attribute.toString()+ "String_Node_Str");
  }
  results.append("String_Node_Str");
}

Fixed version (ground truth):
private void getConflictString(StringBuilder message,IArtifactType artifactType){
  message.append("String_Node_Str" + artifactType.getName() + "String_Node_Str");
  message.append("String_Node_Str");
  message.append("String_Node_Str" + attributeTypes + "String_Node_Str");
  message.append("String_Node_Str");
  message.append("String_Node_Str" + relationTypes + "String_Node_Str");
}
Program: 97630
Project: 97630
Buggy source:
/** 
 * Changes the descriptor of the artifacts to the provided artifact descriptor
 */
public static void changeArtifactType(Collection<? extends Artifact> artifacts,IArtifactType artifactTypeToken) throws OseeCoreException {
  if (artifacts.isEmpty()) {
    throw new OseeArgumentException("String_Node_Str");
  }
  ArtifactType artifactType=ArtifactTypeManager.getType(artifactTypeToken);
  List<Artifact> artifactsUserAccepted=new ArrayList<Artifact>();
  Set<EventBasicGuidArtifact> artifactChanges=new HashSet<EventBasicGuidArtifact>();
  for (  Artifact artifact : artifacts) {
    processAttributes(artifact,artifactType);
    processRelations(artifact,artifactType);
    artifactsUserAccepted.add(artifact);
    if (userAnsweredYesToAll || doesUserAcceptArtifactChange(artifact,artifactType)) {
      ArtifactType originalType=artifact.getArtifactType();
      boolean success=changeArtifactTypeThroughHistory(artifact,artifactType);
      if (success) {
        artifactChanges.add(new EventChangeTypeBasicGuidArtifact(artifact.getBranch().getGuid(),originalType.getGuid(),artifactType.getGuid(),artifact.getGuid()));
      }
    }
  }
  ArtifactEvent artifactEvent=new ArtifactEvent(artifacts.iterator().next().getBranch());
  for (  EventBasicGuidArtifact guidArt : artifactChanges) {
    artifactEvent.getArtifacts().add(guidArt);
  }
  OseeEventManager.kickPersistEvent(ChangeArtifactType.class,artifactEvent);
}

Fixed version (ground truth):
public static void changeArtifactType(Collection<? extends Artifact> inputArtifacts,IArtifactType newArtifactTypeToken) throws OseeCoreException {
  ChangeArtifactType app=new ChangeArtifactType();
  if (inputArtifacts.isEmpty()) {
    throw new OseeArgumentException("String_Node_Str");
  }
  if (newArtifactTypeToken == null) {
    throw new OseeArgumentException("String_Node_Str");
  }
  ArtifactType newArtifactType=ArtifactTypeManager.getType(newArtifactTypeToken);
  try {
    app.internalChangeArtifactType(inputArtifacts,newArtifactType);
  }
 catch (  Exception ex) {
    ArtifactQuery.reloadArtifacts(app.modifiedArtifacts);
    OseeExceptions.wrapAndThrow(ex);
  }
}
Program: 97633
Project: 97633
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=0;
  try {
    result=prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
  }
 catch (  OseeCoreException ex) {
    OseeLog.log(Activator.class,Level.SEVERE,ex);
  }
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=0;
  int userIdHashCode=0;
  try {
    userIdHashCode=(getUserId() == null) ? 0 : getUserId().hashCode();
  }
 catch (  OseeCoreException ex) {
  }
  result=prime * result + userIdHashCode;
  return result;
}
Program: 97634
Project: 97634
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  try {
    String objUserId=null;
    if (obj instanceof IAtsUser) {
      objUserId=((IAtsUser)obj).getUserId();
    }
 else     if (obj instanceof User) {
      objUserId=((User)obj).getUserId();
    }
    if (!Strings.isValid(objUserId)) {
      return false;
    }
    if (getUserId() == null) {
      if (objUserId != null) {
        return false;
      }
    }
 else     if (!getUserId().equals(objUserId)) {
      return false;
    }
  }
 catch (  OseeCoreException ex) {
    OseeLog.log(Activator.class,Level.SEVERE,ex);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  try {
    String objUserId=null;
    if (obj instanceof IAtsUser) {
      objUserId=((IAtsUser)obj).getUserId();
    }
 else     if (obj instanceof User) {
      objUserId=((User)obj).getUserId();
    }
 else {
      return false;
    }
    String thisUserId=getUserId();
    if (thisUserId == null) {
      if (objUserId != null) {
        return false;
      }
    }
 else     if (!thisUserId.equals(objUserId)) {
      return false;
    }
  }
 catch (  OseeCoreException ex) {
    return false;
  }
  return true;
}
Program: 97635
Project: 97635
Buggy source:
@Override public int compareTo(Object other){
  try {
    String otherName=null;
    if (other instanceof IAtsUser) {
      otherName=((IAtsUser)other).getName();
    }
 else     if (other instanceof IAtsUser) {
      otherName=((IAtsUser)other).getName();
    }
    if (otherName != null && getUserId() != null) {
      return getName().compareTo(otherName);
    }
  }
 catch (  OseeCoreException ex) {
    OseeLog.log(Activator.class,Level.SEVERE,ex);
  }
  return -1;
}

Fixed version (ground truth):
@Override public int compareTo(Object other){
  int result=other != null ? -1 : 1;
  if (other instanceof IAtsUser) {
    String otherName=((IAtsUser)other).getName();
    String thisName=user != null ? getName() : null;
    if (thisName == null && otherName == null) {
      result=0;
    }
 else     if (thisName != null && otherName == null) {
      result=1;
    }
 else     if (thisName != null && otherName != null) {
      result=thisName.compareTo(otherName);
    }
  }
 else   if (other instanceof User) {
    result=user != null ? user.compareTo((User)other) : -1;
  }
  return result;
}
Program: 97636
Project: 97636
Buggy source:
@Test public void testCompareTo(){
  Assert.assertEquals(-8,Guest.instance.compareTo(SystemUser.instance));
  Assert.assertEquals(-1,Guest.instance.compareTo(null));
  Assert.assertEquals(-1,Guest.instance.compareTo("String_Node_Str"));
  TestUser user=new TestUser();
  user.setName(null);
  Assert.assertEquals(-1,Guest.instance.compareTo(user));
  Assert.assertEquals(-1,user.compareTo(Guest.instance));
  Assert.assertEquals(-1,user.compareTo(user));
}

Fixed version (ground truth):
@Test public void testCompareTo(){
  Assert.assertEquals(-8,Guest.instance.compareTo(SystemUser.instance));
  Assert.assertEquals(1,Guest.instance.compareTo(null));
  Assert.assertEquals(-1,Guest.instance.compareTo("String_Node_Str"));
  TestUser user=new TestUser();
  user.setName(null);
  Assert.assertEquals(1,Guest.instance.compareTo(user));
  Assert.assertEquals(-1,user.compareTo(Guest.instance));
  Assert.assertEquals(0,user.compareTo(user));
}
Program: 97637
Project: 97637
Buggy source:
@Test public void testEqualsObject(){
  TestUser user=new TestUser();
  user.setUserId("String_Node_Str");
  Assert.assertTrue(SystemUser.instance.equals(user));
  user.setUserId("String_Node_Str");
  Assert.assertFalse(SystemUser.instance.equals(user));
  Assert.assertFalse(SystemUser.instance.equals("String_Node_Str"));
  Assert.assertFalse(SystemUser.instance.equals(null));
  Assert.assertTrue(SystemUser.instance.equals(SystemUser.instance));
  user.setUserId(null);
  Assert.assertFalse(user.equals(SystemUser.instance));
  TestUser user2=new TestUser();
  user2.setUserId(null);
  Assert.assertFalse(user.equals(user2));
}

Fixed version (ground truth):
@Test public void testEqualsObject(){
  TestUser user=new TestUser();
  user.setUserId("String_Node_Str");
  Assert.assertTrue(SystemUser.instance.equals(user));
  user.setUserId("String_Node_Str");
  Assert.assertFalse(SystemUser.instance.equals(user));
  Assert.assertFalse(SystemUser.instance.equals("String_Node_Str"));
  Assert.assertFalse(SystemUser.instance.equals(null));
  Assert.assertTrue(SystemUser.instance.equals(SystemUser.instance));
  user.setUserId(null);
  Assert.assertFalse(user.equals(SystemUser.instance));
  TestUser user2=new TestUser();
  user2.setUserId(null);
  Assert.assertTrue(user.equals(user2));
}
Program: 97638
Project: 97638
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (!(obj instanceof IAtsUser)) {
    return false;
  }
  IAtsUser other=(IAtsUser)obj;
  try {
    if (userId == null) {
      if (other.getUserId() != null) {
        return false;
      }
 else {
        return false;
      }
    }
 else     if (!userId.equals(other.getUserId())) {
      return false;
    }
  }
 catch (  OseeCoreException ex) {
    OseeLog.log(Activator.class,Level.SEVERE,ex);
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (!(obj instanceof IAtsUser)) {
    return false;
  }
  try {
    String thisUserId=getUserId();
    String objUserId=((IAtsUser)obj).getUserId();
    if (thisUserId == null) {
      if (objUserId != null) {
        return false;
      }
    }
 else     if (!thisUserId.equals(objUserId)) {
      return false;
    }
  }
 catch (  OseeCoreException ex) {
    return false;
  }
  return true;
}
Program: 97639
Project: 97639
Buggy source:
@Override public int compareTo(Object other){
  if (other != null && other instanceof IAtsUser && ((IAtsUser)other).getName() != null && getName() != null) {
    return getName().compareTo(((IAtsUser)other).getName());
  }
  return -1;
}

Fixed version (ground truth):
@Override public int compareTo(Object other){
  int result=other != null ? -1 : 1;
  if (other instanceof IAtsUser) {
    String otherName=((IAtsUser)other).getName();
    String thisName=getName();
    if (thisName == null && otherName == null) {
      result=0;
    }
 else     if (thisName != null && otherName == null) {
      result=1;
    }
 else     if (thisName != null && otherName != null) {
      result=thisName.compareTo(otherName);
    }
  }
  return result;
}
Program: 97640
Project: 97640
Buggy source:
public static void outputXmlDocument(Node node,StreamResult output,Properties outputProperties) throws TransformerException {
  Transformer transformer=TransformerFactory.newInstance().newTransformer();
  transformer.setOutputProperties(outputProperties);
  transformer.transform(new DOMSource(node),output);
}

Fixed version (ground truth):
public static void outputXmlDocument(Node node,OutputStream output,Properties outputProperties) throws TransformerException {
  Transformer transformer=TransformerFactory.newInstance().newTransformer();
  transformer.setOutputProperties(outputProperties);
  transformer.transform(new DOMSource(node),new StreamResult(output));
}
Program: 97641
Project: 97641
Buggy source:
/** 
 * Writes the XML document 'document' to the 'file'.
 * @param document The XML document to output
 * @param file Where to put the output
 * @param prettyOutput If true, turns on indentation so the output is more easily readable, if False turns indentationoff to save space.
 * @throws TransformerException
 */
public static void writeXmlDocument(Document document,File file,Properties format) throws TransformerException, IOException {
  BufferedWriter out=new BufferedWriter(new FileWriter(file));
  outputXmlDocument(document,out,format);
  out.close();
}

Fixed version (ground truth):
/** 
 * Writes the XML document 'document' to the 'file'.
 * @param document The XML document to output
 * @param file Where to put the output
 * @param prettyOutput If true, turns on indentation so the output is more easily readable, if False turnsindentation off to save space.
 * @throws TransformerException
 */
public static void writeXmlDocument(Document document,File file,Properties format) throws TransformerException, IOException {
  BufferedWriter out=new BufferedWriter(new FileWriter(file));
  outputXmlDocument(document,out,format);
  out.close();
}
Program: 97642
Project: 97642
Buggy source:
/** 
 * @return format that is compact (no extra whitepsace)
 */
public static Properties getCompactFormat(){
  Properties format=new Properties();
  format.put(OutputKeys.METHOD,"String_Node_Str");
  format.put(OutputKeys.INDENT,"String_Node_Str");
  return format;
}

Fixed version (ground truth):
/** 
 * @return format that is compact (no extra whitespace)
 */
public static Properties getCompactFormat(){
  Properties format=new Properties();
  format.put(OutputKeys.METHOD,"String_Node_Str");
  format.put(OutputKeys.INDENT,"String_Node_Str");
  return format;
}
Program: 97643
Project: 97643
Buggy source:
/** 
 * Gets the XML document 'document' as a string
 * @param document The XML document to output
 * @param file Where to put the output
 * @param prettyOutput If true, turns on indentation so the output is more easily readable, if False turns indentationoff and is assumed to provide the XML as compactly as possible.
 * @throws TransformerException
 */
public static String xmlToString(Document document,boolean prettyOutput) throws TransformerException {
  StringWriter stringWriter=new StringWriter();
  Properties format=prettyOutput ? getPrettyFormat() : getCompactFormat();
  outputXmlDocument(document,stringWriter,format);
  return stringWriter.toString();
}

Fixed version (ground truth):
/** 
 * Gets the XML document 'document' as a string
 * @param document The XML document to output
 * @param file Where to put the output
 * @param prettyOutput If true, turns on indentation so the output is more easily readable, if False turnsindentation off and is assumed to provide the XML as compactly as possible.
 * @throws TransformerException
 */
public static String xmlToString(Document document,boolean prettyOutput) throws TransformerException {
  StringWriter stringWriter=new StringWriter();
  Properties format=prettyOutput ? getPrettyFormat() : getCompactFormat();
  outputXmlDocument(document,stringWriter,format);
  return stringWriter.toString();
}
Program: 97644
Project: 97644
Buggy source:
private void multiArtifactTest(List<WordExtractorData> actuals,List<String> expected) throws IOException {
  for (int i=0; i < actuals.size(); i++) {
    String artContent=WordUtil.textOnly(Lib.inputStreamToString(new ByteArrayInputStream(WordTemplateRenderer.getFormattedContent(actuals.get(i).getParentEelement()))));
    Assert.assertTrue("String_Node_Str" + expected.get(i) + "String_Node_Str"+ artContent+ "String_Node_Str",expected.get(i).equals(artContent));
  }
}

Fixed version (ground truth):
private void multiArtifactTest(List<WordExtractorData> actuals,List<String> expected) throws IOException, XMLStreamException {
  for (int i=0; i < actuals.size(); i++) {
    String artContent=WordUtil.textOnly(Lib.inputStreamToString(new ByteArrayInputStream(WordTemplateRenderer.getFormattedContent(actuals.get(i).getParentEelement()))));
    Assert.assertTrue("String_Node_Str" + expected.get(i) + "String_Node_Str"+ artContent+ "String_Node_Str",expected.get(i).equals(artContent));
  }
}
Program: 97645
Project: 97645
Buggy source:
@org.junit.Test public void testEditUsingWordTemplateRender() throws Exception {
  SevereLoggingMonitor monitorLog=TestUtil.severeLoggingStart();
  Artifact artifact=createArtifact(branch,ARTIFACT_NAME_1);
  artifact.persist(getClass().getSimpleName());
  String testData=Lib.fileToString(getClass(),TEST_WORD_EDIT_FILE_NAME);
  Assert.assertNotNull(testData);
  String expected=replaceGuidMarkers(testData,artifact.getGuid());
  FileSystemRenderer renderer=new WordTemplateRenderer();
  IFile editFile=openArtifactForEdit(renderer,artifact);
  writeNewContentAndWaitForSave(artifact,editFile,expected);
  String actual=getRenderedStoredContent(renderer,artifact);
  Assert.assertEquals(expected,actual);
  TestUtil.severeLoggingEnd(monitorLog);
}

Fixed version (ground truth):
/** 
 * <p> This test needs to be re-evaluated or discarded if OSEE decides to implement their <br/> own requirement storage and DSL. </p>
 * @throws Exception
 */
@org.junit.Test public void testEditUsingWordTemplateRender() throws Exception {
  SevereLoggingMonitor monitorLog=TestUtil.severeLoggingStart();
  Artifact artifact=createArtifact(branch,ARTIFACT_NAME_1);
  artifact.persist(getClass().getSimpleName());
  String testData=Lib.fileToString(getClass(),TEST_WORD_EDIT_FILE_NAME);
  Assert.assertNotNull(testData);
  String expected=replaceGuidMarkers(testData,artifact.getGuid());
  FileSystemRenderer renderer=new WordTemplateRenderer();
  IFile editFile=openArtifactForEdit(renderer,artifact);
  writeNewContentAndWaitForSave(artifact,editFile,expected);
  String actual=getRenderedStoredContent(renderer,artifact);
  Assert.assertEquals(expected,actual);
  TestUtil.severeLoggingEnd(monitorLog);
}
Program: 97646
Project: 97646
Buggy source:
public static void outputXmlDocument(Node node,OutputStream output,Properties outputProperties) throws TransformerException {
  Transformer transformer=TransformerFactory.newInstance().newTransformer();
  transformer.setOutputProperties(outputProperties);
  transformer.transform(new DOMSource(node),new StreamResult(output));
}

Fixed version (ground truth):
/** 
 * Sends the XML to the output
 * @param node The source XML
 * @param output Where the XML is 'printed' to
 * @param format The format style to use
 * @throws TransformerException
 */
public static void outputXmlDocument(Node node,Writer output,Properties outputProperties) throws TransformerException {
  Transformer transformer=TransformerFactory.newInstance().newTransformer();
  transformer.setOutputProperties(outputProperties);
  transformer.transform(new DOMSource(node),new StreamResult(output));
}
Program: 97647
Project: 97647
Buggy source:
public static OseeCoverageUnitFileContentsProvider getInstance(IOseeBranch branch){
  if (instance == null) {
    instance=new OseeCoverageUnitFileContentsProvider(branch);
  }
  return instance;
}

Fixed version (ground truth):
public static OseeCoverageUnitFileContentsProvider getInstance(IOseeBranch branch){
  if (instance == null || !instance.getBranch().equals(branch)) {
    instance=new OseeCoverageUnitFileContentsProvider(branch);
  }
  return instance;
}
Program: 97648
Project: 97648
Buggy source:
/** 
 * Delete attribute if exactly one exists. Does nothing if attribute does not exist and throw MultipleAttributesExist is more than one instance of the attribute type exsits for this artifact
 */
public final void deleteSoleAttribute(IAttributeType attributeType) throws OseeCoreException {
  Attribute<?> attribute=getSoleAttribute(attributeType);
  if (attribute != null) {
    if (!attribute.isInDb()) {
      attributes.removeValue(attributeType,attribute);
    }
 else {
      attribute.delete();
    }
  }
}

Fixed version (ground truth):
/** 
 * Delete attribute if exactly one exists. Does nothing if attribute does not exist and throw MultipleAttributesExist is more than one instance of the attribute type exsits for this artifact
 */
public final void deleteSoleAttribute(IAttributeType attributeType) throws OseeCoreException {
  Attribute<?> attribute=getSoleAttribute(attributeType);
  if (attribute != null) {
    deleteAttribute(attribute);
  }
}
Program: 97649
Project: 97649
Buggy source:
public final void deleteAttribute(int attributeId) throws OseeCoreException {
  for (  Attribute<?> attribute : getAttributes()) {
    if (attribute.getId() == attributeId) {
      attribute.delete();
      break;
    }
  }
}

Fixed version (ground truth):
public final void deleteAttribute(Attribute<?> attribute) throws OseeCoreException {
  if (attribute.isInDb()) {
    attribute.delete();
  }
 else {
    attributes.removeValue(attribute.getAttributeType(),attribute);
  }
}
Program: 97650
Project: 97650
Buggy source:
/** 
 * Deletes the attribute
 */
public final void delete(){
  markAsChanged(ModificationType.DELETED);
}

Fixed version (ground truth):
/** 
 * Deletes the attribute
 */
public final void delete() throws OseeCoreException {
  if (isInDb()) {
    markAsChanged(ModificationType.DELETED);
  }
 else {
    getArtifact().deleteAttribute(this);
  }
}
Program: 97651
Project: 97651
Buggy source:
private void createDeleteMenuItem(Menu parentMenu){
  deleteItem=new MenuItem(parentMenu,SWT.PUSH);
  deleteItem.setImage(null);
  deleteItem.setText("String_Node_Str");
  deleteItem.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      Attribute<?> attribute=getSelectedAttribute();
      attribute.delete();
      editor.onDirtied();
      notifyModifyAttribuesListeners();
      tableViewer.refresh();
    }
  }
);
}

Fixed version (ground truth):
private void createDeleteMenuItem(Menu parentMenu){
  deleteItem=new MenuItem(parentMenu,SWT.PUSH);
  deleteItem.setImage(null);
  deleteItem.setText("String_Node_Str");
  deleteItem.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      try {
        Attribute<?> attribute=getSelectedAttribute();
        attribute.delete();
        editor.onDirtied();
        notifyModifyAttribuesListeners();
        tableViewer.refresh();
      }
 catch (      OseeCoreException ex) {
        OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,ex);
      }
    }
  }
);
}
Program: 97652
Project: 97652
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  Attribute<?> attribute=getSelectedAttribute();
  attribute.delete();
  editor.onDirtied();
  notifyModifyAttribuesListeners();
  tableViewer.refresh();
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  try {
    Attribute<?> attribute=getSelectedAttribute();
    attribute.delete();
    editor.onDirtied();
    notifyModifyAttribuesListeners();
    tableViewer.refresh();
  }
 catch (  OseeCoreException ex) {
    OseeLog.log(Activator.class,OseeLevel.SEVERE_POPUP,ex);
  }
}
Program: 97654
Project: 97654
Buggy source:
@Override protected void onPreExecute(){
  mProgressDialog=new MaterialDialog.Builder(getContext()).content(R.string.loading).progress(true,0).show();
}

Fixed version (ground truth):
@Override protected void onPreExecute(){
  mProgressDialog=new MaterialDialog.Builder(getActivity()).content(R.string.loading).progress(true,0).show();
}
Program: 97655
Project: 97655
Buggy source:
private boolean checkPermissions(){
  if (ActivityCompat.checkSelfPermission(getActivity(),Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
    requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},WRITE_EXTERNAL_PERMISSION);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean checkPermissions(){
  if (ActivityCompat.checkSelfPermission(getActivity(),Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
    FragmentCompat.requestPermissions(this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},WRITE_EXTERNAL_PERMISSION);
    return true;
  }
  return false;
}
Program: 97656
Project: 97656
Buggy source:
private boolean checkPermissions(){
  if (ActivityCompat.checkSelfPermission(this.getContext(),Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
    fragment.requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},WRITE_EXTERNAL_PERMISSION);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean checkPermissions(){
  if (ActivityCompat.checkSelfPermission(this.getContext(),Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
    FragmentCompat.requestPermissions(fragment,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},WRITE_EXTERNAL_PERMISSION);
    return true;
  }
  return false;
}
Program: 97657
Project: 97657
Buggy source:
private void reloadXposedProp(){
  Map<String,String> map=Collections.emptyMap();
  if (XPOSED_PROP_FILE.canRead() || XPOSED_PROP_FILE_SYSTEMLESS.canRead() || XPOSED_PROP_FILE_SYSTEMLESS_2.canRead()) {
    File file=null;
    if (XPOSED_PROP_FILE.canRead()) {
      file=XPOSED_PROP_FILE;
    }
 else     if (XPOSED_PROP_FILE_SYSTEMLESS.canRead()) {
      file=XPOSED_PROP_FILE_SYSTEMLESS;
    }
 else     if (XPOSED_PROP_FILE_SYSTEMLESS_2.canRead()) {
      file=XPOSED_PROP_FILE_SYSTEMLESS_2;
    }
    if (file != null) {
      FileInputStream is=null;
      try {
        is=new FileInputStream(file);
        map=parseXposedProp(is);
      }
 catch (      IOException e) {
        Log.e(XposedApp.TAG,"String_Node_Str" + file.getPath(),e);
      }
 finally {
        if (is != null) {
          try {
            is.close();
          }
 catch (          IOException ignored) {
          }
        }
      }
    }
  }
synchronized (this) {
    mXposedProp=map;
  }
}

Fixed version (ground truth):
private void reloadXposedProp(){
  Map<String,String> map=Collections.emptyMap();
  if (XPOSED_PROP_FILE.canRead() || XPOSED_PROP_FILE_SYSTEMLESS.canRead() || XPOSED_PROP_FILE_SYSTEMLESS_2.canRead()|| XPOSED_PROP_FILE_SYSTEMLESS_3.canRead()) {
    File file=null;
    if (XPOSED_PROP_FILE.canRead()) {
      file=XPOSED_PROP_FILE;
    }
 else     if (XPOSED_PROP_FILE_SYSTEMLESS.canRead()) {
      file=XPOSED_PROP_FILE_SYSTEMLESS;
    }
 else     if (XPOSED_PROP_FILE_SYSTEMLESS_2.canRead()) {
      file=XPOSED_PROP_FILE_SYSTEMLESS_2;
    }
 else     if (XPOSED_PROP_FILE_SYSTEMLESS_3.canRead()) {
      file=XPOSED_PROP_FILE_SYSTEMLESS_3;
    }
    if (file != null) {
      FileInputStream is=null;
      try {
        is=new FileInputStream(file);
        map=parseXposedProp(is);
      }
 catch (      IOException e) {
        Log.e(XposedApp.TAG,"String_Node_Str" + file.getPath(),e);
      }
 finally {
        if (is != null) {
          try {
            is.close();
          }
 catch (          IOException ignored) {
          }
        }
      }
    }
  }
synchronized (this) {
    mXposedProp=map;
  }
}
Program: 97658
Project: 97658
Buggy source:
private static void showDownloadDialog(final Builder b,final long id){
  final Context context=b.mContext;
  final DownloadDialog dialog=new DownloadDialog(new MaterialDialog.Builder(context).title(b.mTitle).content(R.string.download_view_waiting).progress(false,0,true).progressNumberFormat(context.getString(R.string.download_progress)).canceledOnTouchOutside(false).negativeText(R.string.download_view_cancel).onNegative(new SingleButtonCallback(){
    @Override public void onClick(    @NonNull MaterialDialog dialog,    @NonNull DialogAction which){
      dialog.cancel();
    }
  }
).cancelListener(new DialogInterface.OnCancelListener(){
    @Override public void onCancel(    DialogInterface dialog){
      removeById(context,id);
    }
  }
));
  dialog.setShowProcess(false);
  dialog.show();
  new Thread("String_Node_Str"){
    @Override public void run(){
      while (true) {
        try {
          Thread.sleep(100);
        }
 catch (        InterruptedException e) {
          return;
        }
        final DownloadInfo info=getById(context,id);
        if (info == null) {
          dialog.cancel();
          return;
        }
 else         if (info.status == DownloadManager.STATUS_FAILED) {
          dialog.cancel();
          Toast.makeText(context,context.getString(R.string.download_view_failed,info.reason),Toast.LENGTH_LONG).show();
          return;
        }
 else         if (info.status == DownloadManager.STATUS_SUCCESSFUL) {
          dialog.dismiss();
          new File(info.localFilename).setExecutable(false);
          if (b.mCallback != null) {
            b.mCallback.onDownloadFinished(context,info);
          }
          return;
        }
        XposedApp.runOnUiThread(new Runnable(){
          @Override public void run(){
            if (info.totalSize <= 0 || info.status != DownloadManager.STATUS_RUNNING) {
              dialog.setContent(R.string.download_view_waiting);
              dialog.setShowProcess(false);
            }
 else {
              dialog.setContent(R.string.download_running);
              dialog.setProgress(info.bytesDownloaded / 1024);
              dialog.setMaxProgress(info.totalSize / 1024);
              dialog.setShowProcess(true);
            }
          }
        }
);
      }
    }
  }
.start();
}

Fixed version (ground truth):
private static void showDownloadDialog(final Builder b,final long id){
}
Program: 97660
Project: 97660
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mPref=XposedApp.getPreferences();
  mRepoLoader=RepoLoader.getInstance();
  mModuleUtil=ModuleUtil.getInstance();
  mAdapter=new DownloadsAdapter(getActivity());
  mAdapter.setFilterQueryProvider(new FilterQueryProvider(){
    @Override public Cursor runQuery(    CharSequence constraint){
      return RepoDb.queryModuleOverview(mSortingOrder,constraint);
    }
  }
);
  mSortingOrder=mPref.getInt("String_Node_Str",RepoDb.SORT_STATUS);
  setHasOptionsMenu(true);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mPref=XposedApp.getPreferences();
  mRepoLoader=RepoLoader.getInstance();
  mModuleUtil=ModuleUtil.getInstance();
  mAdapter=new DownloadsAdapter(getActivity());
  mAdapter.setFilterQueryProvider(new FilterQueryProvider(){
    @Override public Cursor runQuery(    CharSequence constraint){
      return RepoDb.queryModuleOverview(mSortingOrder,constraint);
    }
  }
);
  mSortingOrder=mPref.getInt("String_Node_Str",RepoDb.SORT_STATUS);
  mIgnoredUpdatesPref=getContext().getSharedPreferences("String_Node_Str",MODE_PRIVATE);
  setHasOptionsMenu(true);
}
Program: 97661
Project: 97661
Buggy source:
@Override public void onResume(){
  super.onResume();
  if (mAdapter != null && mListView != null) {
    mListView.setAdapter(mAdapter);
  }
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  mIgnoredUpdatesPref.registerOnSharedPreferenceChangeListener(this);
  if (changed) {
    reloadItems();
    changed=!changed;
  }
}
Program: 97662
Project: 97662
Buggy source:
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
}

Fixed version (ground truth):
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  if (mAdapter != null && mListView != null) {
    mListView.setAdapter(mAdapter);
  }
}
Program: 97663
Project: 97663
Buggy source:
public DownloadsAdapter(Context context){
  super(context,null,0);
  mContext=context;
  mInflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mPrefs=context.getSharedPreferences("String_Node_Str",Context.MODE_PRIVATE);
  Resources res=context.getResources();
  sectionHeadersStatus=new String[]{res.getString(R.string.download_section_framework),res.getString(R.string.download_section_update_available),res.getString(R.string.download_section_installed),res.getString(R.string.download_section_not_installed)};
  sectionHeadersDate=new String[]{res.getString(R.string.download_section_24h),res.getString(R.string.download_section_7d),res.getString(R.string.download_section_30d),res.getString(R.string.download_section_older)};
}

Fixed version (ground truth):
public DownloadsAdapter(Context context){
  super(context,null,0);
  mContext=context;
  mInflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mPrefs=context.getSharedPreferences("String_Node_Str",MODE_PRIVATE);
  Resources res=context.getResources();
  sectionHeadersStatus=new String[]{res.getString(R.string.download_section_framework),res.getString(R.string.download_section_update_available),res.getString(R.string.download_section_installed),res.getString(R.string.download_section_not_installed)};
  sectionHeadersDate=new String[]{res.getString(R.string.download_section_24h),res.getString(R.string.download_section_7d),res.getString(R.string.download_section_30d),res.getString(R.string.download_section_older)};
}
Program: 97664
Project: 97664
Buggy source:
@Override protected void onPreExecute(){
  mProgressDialog=new MaterialDialog.Builder(getContext()).content("String_Node_Str").progress(true,0).show();
}

Fixed version (ground truth):
@Override protected void onPreExecute(){
  mProgressDialog=new MaterialDialog.Builder(getContext()).content(R.string.loading).progress(true,0).show();
}
Program: 97665
Project: 97665
Buggy source:
@Override public void onInstalledModulesReloaded(ModuleUtil moduleUtil){
  getActivity().runOnUiThread(reloadModules);
}

Fixed version (ground truth):
@Override public void onInstalledModulesReloaded(ModuleUtil moduleUtil){
  new ReloadModules().execute();
}
Program: 97666
Project: 97666
Buggy source:
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  installedXposedVersion=XposedApp.getXposedVersion();
  if (installedXposedVersion <= 0) {
    View notActiveNote=getActivity().getLayoutInflater().inflate(R.layout.xposed_not_active_note,getListView(),false);
    notActiveNote.setTag(NOT_ACTIVE_NOTE_TAG);
    getListView().addHeaderView(notActiveNote);
  }
  mRootUtil=new RootUtil();
  mAdapter=new ModuleAdapter(getActivity());
  reloadModules.run();
  setListAdapter(mAdapter);
  setEmptyText(getActivity().getString(R.string.no_xposed_modules_found));
  registerForContextMenu(getListView());
  mModuleUtil.addListener(this);
  ActionBar actionBar=((WelcomeActivity)getActivity()).getSupportActionBar();
  DisplayMetrics metrics=getResources().getDisplayMetrics();
  int sixDp=(int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,6,metrics);
  int eightDp=(int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,8,metrics);
  int toolBarDp=actionBar.getHeight() == 0 ? 196 : actionBar.getHeight();
  getListView().setDivider(null);
  getListView().setDividerHeight(sixDp);
  getListView().setPadding(eightDp,toolBarDp + eightDp,eightDp,eightDp);
  getListView().setClipToPadding(false);
  setHasOptionsMenu(true);
}

Fixed version (ground truth):
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  installedXposedVersion=XposedApp.getXposedVersion();
  if (installedXposedVersion <= 0) {
    View notActiveNote=getActivity().getLayoutInflater().inflate(R.layout.xposed_not_active_note,getListView(),false);
    notActiveNote.setTag(NOT_ACTIVE_NOTE_TAG);
    getListView().addHeaderView(notActiveNote);
  }
  mRootUtil=new RootUtil();
  mAdapter=new ModuleAdapter(getActivity());
  new ReloadModules().execute();
  setListAdapter(mAdapter);
  setEmptyText(getActivity().getString(R.string.no_xposed_modules_found));
  registerForContextMenu(getListView());
  mModuleUtil.addListener(this);
  ActionBar actionBar=((WelcomeActivity)getActivity()).getSupportActionBar();
  DisplayMetrics metrics=getResources().getDisplayMetrics();
  int sixDp=(int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,6,metrics);
  int eightDp=(int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,8,metrics);
  int toolBarDp=actionBar.getHeight() == 0 ? 196 : actionBar.getHeight();
  getListView().setDivider(null);
  getListView().setDividerHeight(sixDp);
  getListView().setPadding(eightDp,toolBarDp + eightDp,eightDp,eightDp);
  getListView().setClipToPadding(false);
  setHasOptionsMenu(true);
}
Program: 97667
Project: 97667
Buggy source:
@Override public void onSingleInstalledModuleReloaded(ModuleUtil moduleUtil,String packageName,InstalledModule module){
  getActivity().runOnUiThread(reloadModules);
}

Fixed version (ground truth):
@Override public void onSingleInstalledModuleReloaded(ModuleUtil moduleUtil,String packageName,InstalledModule module){
  new ReloadModules().execute();
}