Program: 39552
Project: 39552
Buggy source:
@Override protected TOExecutionResult pomExecution(File transformedAppFolder,TransformationContext transformationContext) throws XmlPullParserException, XMLStreamException, IOException {
  File pomFile=getAbsoluteFile(transformedAppFolder,transformationContext);
  Parent existingParent=getModel(pomFile).getParent();
  String details;
  String relativePomFile=getRelativePath(transformedAppFolder,pomFile);
  if (existingParent != null) {
    String message=String.format("String_Node_Str",relativePomFile);
switch (ifPresent) {
case WarnNotAdd:
      return TOExecutionResult.warning(this,message);
case NoOp:
    return TOExecutionResult.noOp(this,message);
case Fail:
  return TOExecutionResult.error(this,new TransformationOperationException(message));
}
}
if (groupId == null && artifactId == null && version == null) {
throw new IllegalStateException("String_Node_Str");
}
Parent newParent=new Parent();
newParent.setGroupId(groupId);
newParent.setArtifactId(artifactId);
newParent.setVersion(version);
XMLEventReader reader=getReader(transformedAppFolder,transformationContext);
XMLEventWriter writer=getWriter(transformedAppFolder,transformationContext);
XMLEvent indentation=getIndentation(transformedAppFolder,transformationContext);
TOExecutionResult result=null;
if (existingParent != null) {
copyUntil(reader,writer,new StartElementEventCondition("String_Node_Str"),true);
skipUntil(reader,new EndElementEventCondition("String_Node_Str"));
writer.add(LINE_FEED);
writeNewParent(writer,indentation);
writer.add(indentation);
writer.add(eventFactory.createEndElement("String_Node_Str","String_Node_Str","String_Node_Str"));
details=String.format("String_Node_Str",relativePomFile,newParent);
if (ifPresent.equals(IfPresent.Overwrite)) {
result=TOExecutionResult.success(this,details);
}
 else if (ifPresent.equals(IfPresent.WarnButAdd)) {
result=TOExecutionResult.warning(this,details);
}
}
 else {
copyUntil(reader,writer,new StartElementEventCondition("String_Node_Str"),true);
writer.add(LINE_FEED);
writer.add(LINE_FEED);
writer.add(indentation);
writer.add(eventFactory.createStartElement("String_Node_Str","String_Node_Str","String_Node_Str"));
writer.add(LINE_FEED);
writeNewParent(writer,indentation);
writer.add(indentation);
writer.add(eventFactory.createEndElement("String_Node_Str","String_Node_Str","String_Node_Str"));
writer.add(LINE_FEED);
details=String.format("String_Node_Str",relativePomFile,newParent);
result=TOExecutionResult.success(this,details);
}
writer.add(reader);
return result;
}

Fixed version (ground truth):
@Override protected TOExecutionResult pomExecution(File transformedAppFolder,TransformationContext transformationContext) throws XmlPullParserException, XMLStreamException, IOException {
  File pomFile=getAbsoluteFile(transformedAppFolder,transformationContext);
  Parent existingParent=getModel(pomFile).getParent();
  String details;
  String relativePomFile=getRelativePath(transformedAppFolder,pomFile);
  if (existingParent != null) {
    String message=String.format("String_Node_Str",relativePomFile);
switch (ifPresent) {
case WarnNotAdd:
      return TOExecutionResult.warning(this,message);
case NoOp:
    return TOExecutionResult.noOp(this,message);
case Fail:
  return TOExecutionResult.error(this,new TransformationOperationException(message));
default :
break;
}
}
if (groupId == null && artifactId == null && version == null) {
throw new IllegalStateException("String_Node_Str");
}
Parent newParent=new Parent();
newParent.setGroupId(groupId);
newParent.setArtifactId(artifactId);
newParent.setVersion(version);
XMLEventReader reader=getReader(transformedAppFolder,transformationContext);
XMLEventWriter writer=getWriter(transformedAppFolder,transformationContext);
XMLEvent indentation=getIndentation(transformedAppFolder,transformationContext);
TOExecutionResult result=null;
if (existingParent != null) {
copyUntil(reader,writer,new StartElementEventCondition("String_Node_Str"),true);
skipUntil(reader,new EndElementEventCondition("String_Node_Str"));
writer.add(LINE_FEED);
writeNewParent(writer,indentation);
writer.add(indentation);
writer.add(eventFactory.createEndElement("String_Node_Str","String_Node_Str","String_Node_Str"));
details=String.format("String_Node_Str",relativePomFile,newParent);
if (ifPresent.equals(IfPresent.Overwrite)) {
result=TOExecutionResult.success(this,details);
}
 else if (ifPresent.equals(IfPresent.WarnButAdd)) {
result=TOExecutionResult.warning(this,details);
}
}
 else {
copyUntil(reader,writer,new StartElementEventCondition("String_Node_Str"),true);
writer.add(LINE_FEED);
writer.add(LINE_FEED);
writer.add(indentation);
writer.add(eventFactory.createStartElement("String_Node_Str","String_Node_Str","String_Node_Str"));
writer.add(LINE_FEED);
writeNewParent(writer,indentation);
writer.add(indentation);
writer.add(eventFactory.createEndElement("String_Node_Str","String_Node_Str","String_Node_Str"));
writer.add(LINE_FEED);
details=String.format("String_Node_Str",relativePomFile,newParent);
result=TOExecutionResult.success(this,details);
}
writer.add(reader);
return result;
}