nus-yam/ex-repair huggingface dataset:
Program: 11916
Project: 11916
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public void setReferenceValue(EObject newReferenceValue){
  EObject oldReferenceValue=basicGetReferenceValue();
  value=newReferenceValue;
  valueString=null;
  if (eNotificationRequired())   eNotify(new ENotificationImpl(this,Notification.SET,ChangePackage.FEATURE_CHANGE__REFERENCE_VALUE,oldReferenceValue,newReferenceValue));
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public void setReferenceValue(EObject newReferenceValue){
  EObject oldReferenceValue=basicGetReferenceValue();
  value=newReferenceValue;
  if (value instanceof EEnumLiteral) {
    eFlags&=~REFVALUE_FEATURECHANGE;
  }
 else {
    eFlags|=REFVALUE_FEATURECHANGE;
  }
  valueString=null;
  if (eNotificationRequired())   eNotify(new ENotificationImpl(this,Notification.SET,ChangePackage.FEATURE_CHANGE__REFERENCE_VALUE,oldReferenceValue,newReferenceValue));
}
Program: 11917
Project: 11917
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public EObject basicGetReferenceValue(){
  return value instanceof EObject ? (EObject)value : null;
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public EObject basicGetReferenceValue(){
  return (eFlags & REFVALUE_FEATURECHANGE) != 0 ? (EObject)value : null;
}
Program: 11918
Project: 11918
Buggy source:
protected void setValue(Object value){
  EStructuralFeature feature=getFeature();
  if (!eNotificationRequired() || feature.isMany()) {
    valueString=null;
    this.value=value;
  }
 else {
    if (feature instanceof EAttribute) {
      EDataType type=(EDataType)feature.getEType();
      setDataValue(EcoreUtil.convertToString(type,value));
      this.value=value;
    }
 else {
      setReferenceValue((EObject)value);
    }
  }
}

Fixed version (ground truth):
protected void setValue(Object value){
  EStructuralFeature feature=getFeature();
  if (!eNotificationRequired() || feature.isMany()) {
    valueString=null;
    this.value=value;
    if (value instanceof EObject && !(value instanceof EEnumLiteral)) {
      eFlags|=REFVALUE_FEATURECHANGE;
    }
 else {
      eFlags&=~REFVALUE_FEATURECHANGE;
    }
  }
 else {
    if (feature instanceof EAttribute) {
      EDataType type=(EDataType)feature.getEType();
      setDataValue(EcoreUtil.convertToString(type,value));
      this.value=value;
      eFlags&=~REFVALUE_FEATURECHANGE;
    }
 else {
      setReferenceValue((EObject)value);
    }
  }
}
Program: 11919
Project: 11919
Buggy source:
/** 
 * Updates the UUID with the current time, compensating for the fact that the clock resolution may be less than 100 ns. The byte array will have its first eight bytes populated with the time in the correct sequence of bytes, as per the specification.
 */
private static void updateCurrentTime(){
  long currentTime=System.currentTimeMillis() + EPOCH_ADJUSTMENT;
  if (lastTime > currentTime) {
    ++clockSequence;
    if (16384 == clockSequence) {
      clockSequence=0;
    }
    updateClockSequence();
  }
 else   if (lastTime == currentTime) {
    ++timeAdjustment;
    if (timeAdjustment > 9999) {
      try {
        Thread.sleep(1);
      }
 catch (      InterruptedException exception) {
      }
      timeAdjustment=0;
      currentTime=System.currentTimeMillis() + EPOCH_ADJUSTMENT;
      if (lastTime == currentTime) {
        throw new Error("String_Node_Str");
      }
    }
  }
 else {
    timeAdjustment=0;
  }
  lastTime=currentTime;
  currentTime*=10000;
  currentTime+=timeAdjustment;
  currentTime|=0x1000000000000000L;
  for (int i=0; i < 4; ++i) {
    uuid[i]=(byte)((currentTime >> 8 * (3 - i)) & 0xFFL);
  }
  for (int i=0; i < 2; ++i) {
    uuid[i + 4]=(byte)((currentTime >> 8 * (1 - i) + 32) & 0xFFL);
  }
  for (int i=0; i < 2; ++i) {
    uuid[i + 6]=(byte)((currentTime >> 8 * (1 - i) + 48) & 0xFFL);
  }
}

Fixed version (ground truth):
/** 
 * Updates the UUID with the current time, compensating for the fact that the clock resolution may be less than 100 ns. The byte array will have its first eight bytes populated with the time in the correct sequence of bytes, as per the specification.
 */
private static void updateCurrentTime(){
  long currentTime=System.currentTimeMillis() + EPOCH_ADJUSTMENT;
  if (lastTime > currentTime) {
    ++clockSequence;
    if (16384 == clockSequence) {
      clockSequence=0;
    }
    updateClockSequence();
  }
 else   if (lastTime == currentTime) {
    ++timeAdjustment;
    if (timeAdjustment > 9999) {
      try {
        Thread.sleep(sleepTime);
      }
 catch (      InterruptedException exception) {
      }
      timeAdjustment=0;
      currentTime=System.currentTimeMillis() + EPOCH_ADJUSTMENT;
      while (lastTime == currentTime) {
        try {
          ++sleepTime;
          Thread.sleep(1);
        }
 catch (        InterruptedException exception) {
        }
        currentTime=System.currentTimeMillis() + EPOCH_ADJUSTMENT;
      }
    }
  }
 else {
    timeAdjustment=0;
  }
  lastTime=currentTime;
  currentTime*=10000;
  currentTime+=timeAdjustment;
  currentTime|=0x1000000000000000L;
  for (int i=0; i < 4; ++i) {
    uuid[i]=(byte)((currentTime >> 8 * (3 - i)) & 0xFFL);
  }
  for (int i=0; i < 2; ++i) {
    uuid[i + 4]=(byte)((currentTime >> 8 * (1 - i) + 32) & 0xFFL);
  }
  for (int i=0; i < 2; ++i) {
    uuid[i + 6]=(byte)((currentTime >> 8 * (1 - i) + 48) & 0xFFL);
  }
}
Program: 11921
Project: 11921
Buggy source:
public static String readFile(File file){
  StringBuffer stringBuffer=new StringBuffer();
  try {
    BufferedReader in=new BufferedReader(new FileReader(file));
    String str=null;
    try {
      while ((str=in.readLine()) != null) {
        stringBuffer.append(str).append("String_Node_Str");
      }
    }
  finally {
      if (in != null) {
        in.close();
      }
    }
  }
 catch (  IOException exception) {
    throw new RuntimeException(exception);
  }
  int length=stringBuffer.length();
  if (length > 0) {
    stringBuffer.deleteCharAt(length - 1);
  }
  return stringBuffer.toString();
}

Fixed version (ground truth):
public static String readFile(File file,boolean useSystemLineSeparator){
  StringBuffer stringBuffer=new StringBuffer();
  try {
    BufferedReader in=new BufferedReader(new FileReader(file));
    String str=null;
    try {
      while ((str=in.readLine()) != null) {
        stringBuffer.append(str).append(useSystemLineSeparator ? System.getProperties().getProperty("String_Node_Str") : "String_Node_Str");
      }
    }
  finally {
      if (in != null) {
        in.close();
      }
    }
  }
 catch (  IOException exception) {
    throw new RuntimeException(exception);
  }
  int length=stringBuffer.length();
  if (length > 0) {
    stringBuffer.deleteCharAt(length - 1);
  }
  return stringBuffer.toString();
}
Program: 11922
Project: 11922
Buggy source:
private void assertGeneratedFile(File dir,File expectedDir,String file,String[] testTokenReplacements){
  File expectedFile=new File(expectedDir,file);
  File generatedFile=new File(dir,file);
  assertTrue("String_Node_Str" + expectedFile,expectedFile.isFile());
  assertTrue("String_Node_Str" + generatedFile,generatedFile.isFile());
  String expectedContent=TestUtil.readFile(expectedFile);
  if (testTokenReplacements != null) {
    for (int i=testTokenReplacements.length - 1; i >= 0; i--) {
      String replacement=testTokenReplacements[i];
      expectedContent=expectedContent.replaceAll(TEST_TOKEN + i,replacement.replaceAll("String_Node_Str","String_Node_Str"));
    }
  }
  String generatedContent=TestUtil.readFile(generatedFile);
  expectedContent=expectedContent.replaceAll("String_Node_Str","String_Node_Str");
  generatedContent=generatedContent.replaceAll("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str" + file,expectedContent,generatedContent);
}

Fixed version (ground truth):
private void assertGeneratedFile(File dir,File expectedDir,String file,String[] testTokenReplacements){
  File expectedFile=new File(expectedDir,file);
  File generatedFile=new File(dir,file);
  assertTrue("String_Node_Str" + expectedFile,expectedFile.isFile());
  assertTrue("String_Node_Str" + generatedFile,generatedFile.isFile());
  String expectedContent=TestUtil.readFile(expectedFile,true);
  if (testTokenReplacements != null) {
    for (int i=testTokenReplacements.length - 1; i >= 0; i--) {
      String replacement=testTokenReplacements[i];
      expectedContent=expectedContent.replaceAll(TEST_TOKEN + i,replacement.replaceAll("String_Node_Str","String_Node_Str"));
    }
  }
  String generatedContent=TestUtil.readFile(generatedFile,true);
  expectedContent=expectedContent.replaceAll("String_Node_Str","String_Node_Str");
  generatedContent=generatedContent.replaceAll("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str" + file,expectedContent,generatedContent);
}
Program: 11924
Project: 11924
Buggy source:
public void testMerge() throws Exception {
  assertTrue("String_Node_Str" + MERGE_XML.getAbsolutePath(),MERGE_XML.isFile());
  assertTrue("String_Node_Str" + MERGE_SOURCE.getAbsolutePath(),MERGE_SOURCE.isFile());
  assertTrue("String_Node_Str" + MERGE_TARGET.getAbsolutePath(),MERGE_TARGET.isFile());
  assertTrue("String_Node_Str" + MERGE_EXPECTED.getAbsolutePath(),MERGE_TARGET.isFile());
  jMerger=new JMerger();
  JControlModel controlModel=new JControlModel(MERGE_XML.getAbsolutePath());
  jMerger.setControlModel(controlModel);
  jMerger.setSourceCompilationUnit(jMerger.createCompilationUnitForContents(TestUtil.readFile(MERGE_SOURCE)));
  jMerger.setTargetCompilationUnit(jMerger.createCompilationUnitForInputStream(new FileInputStream(MERGE_TARGET)));
  jMerger.merge();
  StringBuffer mergeResult=new StringBuffer(jMerger.getTargetCompilationUnitContents());
  for (int i=mergeResult.length() - 1; i >= 0; i--) {
    if ('\r' == mergeResult.charAt(i)) {
      mergeResult.deleteCharAt(i);
    }
  }
  String expectedMerge=TestUtil.readFile(MERGE_EXPECTED);
  assertEquals("String_Node_Str",expectedMerge,mergeResult.toString());
}

Fixed version (ground truth):
public void testMerge() throws Exception {
  assertTrue("String_Node_Str" + MERGE_XML.getAbsolutePath(),MERGE_XML.isFile());
  assertTrue("String_Node_Str" + MERGE_SOURCE.getAbsolutePath(),MERGE_SOURCE.isFile());
  assertTrue("String_Node_Str" + MERGE_TARGET.getAbsolutePath(),MERGE_TARGET.isFile());
  assertTrue("String_Node_Str" + MERGE_EXPECTED.getAbsolutePath(),MERGE_TARGET.isFile());
  jMerger=new JMerger();
  JControlModel controlModel=new JControlModel(MERGE_XML.getAbsolutePath());
  jMerger.setControlModel(controlModel);
  jMerger.setSourceCompilationUnit(jMerger.createCompilationUnitForContents(TestUtil.readFile(MERGE_SOURCE,false)));
  jMerger.setTargetCompilationUnit(jMerger.createCompilationUnitForInputStream(new FileInputStream(MERGE_TARGET)));
  jMerger.merge();
  StringBuffer mergeResult=new StringBuffer(jMerger.getTargetCompilationUnitContents());
  for (int i=mergeResult.length() - 1; i >= 0; i--) {
    if ('\r' == mergeResult.charAt(i)) {
      mergeResult.deleteCharAt(i);
    }
  }
  String expectedMerge=TestUtil.readFile(MERGE_EXPECTED,false);
  assertEquals("String_Node_Str",expectedMerge,mergeResult.toString());
}
Program: 11925
Project: 11925
Buggy source:
public static String readFile(File file,boolean useSystemLineSeparator){
  StringBuffer stringBuffer=new StringBuffer();
  try {
    BufferedReader in=new BufferedReader(new FileReader(file));
    String str=null;
    try {
      while ((str=in.readLine()) != null) {
        stringBuffer.append(str).append(useSystemLineSeparator ? System.getProperties().getProperty("String_Node_Str") : "String_Node_Str");
      }
    }
  finally {
      if (in != null) {
        in.close();
      }
    }
  }
 catch (  IOException exception) {
    throw new RuntimeException(exception);
  }
  int length=stringBuffer.length();
  if (length > 0) {
    stringBuffer.deleteCharAt(length - 1);
  }
  return stringBuffer.toString();
}

Fixed version (ground truth):
public static String readFile(File file,boolean useSystemLineSeparator){
  StringBuffer stringBuffer=new StringBuffer();
  try {
    BufferedReader in=new BufferedReader(new FileReader(file));
    String str=null;
    try {
      String nl=useSystemLineSeparator ? System.getProperties().getProperty("String_Node_Str") : "String_Node_Str";
      while ((str=in.readLine()) != null) {
        stringBuffer.append(str).append(nl);
      }
    }
  finally {
      if (in != null) {
        in.close();
      }
    }
  }
 catch (  IOException exception) {
    throw new RuntimeException(exception);
  }
  int length=stringBuffer.length();
  if (length > 0) {
    stringBuffer.deleteCharAt(length - 1);
  }
  return stringBuffer.toString();
}
Program: 11926
Project: 11926
Buggy source:
private void assertGeneratedFile(File dir,File expectedDir,String file,String[] testTokenReplacements){
  File expectedFile=new File(expectedDir,file);
  File generatedFile=new File(dir,file);
  assertTrue("String_Node_Str" + expectedFile,expectedFile.isFile());
  assertTrue("String_Node_Str" + generatedFile,generatedFile.isFile());
  String expectedContent=TestUtil.readFile(expectedFile,true);
  if (testTokenReplacements != null) {
    for (int i=testTokenReplacements.length - 1; i >= 0; i--) {
      String replacement=testTokenReplacements[i];
      expectedContent=expectedContent.replaceAll(TEST_TOKEN + i,replacement.replaceAll("String_Node_Str","String_Node_Str"));
    }
  }
  String generatedContent=TestUtil.readFile(generatedFile,true);
  expectedContent=expectedContent.replaceAll("String_Node_Str","String_Node_Str");
  generatedContent=generatedContent.replaceAll("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str" + file,expectedContent,generatedContent);
}

Fixed version (ground truth):
private void assertGeneratedFile(File dir,File expectedDir,String file,String[] testTokenReplacements){
  File expectedFile=new File(expectedDir,file);
  File generatedFile=new File(dir,file);
  assertTrue("String_Node_Str" + expectedFile,expectedFile.isFile());
  assertTrue("String_Node_Str" + generatedFile,generatedFile.isFile());
  String expectedContent=TestUtil.readFile(expectedFile,true);
  if (testTokenReplacements != null) {
    for (int i=testTokenReplacements.length - 1; i >= 0; i--) {
      String replacement=testTokenReplacements[i];
      expectedContent=expectedContent.replaceAll(TEST_TOKEN + i,replacement.replaceAll("String_Node_Str","String_Node_Str"));
    }
  }
  String generatedContent=TestUtil.readFile(generatedFile,true);
  expectedContent=expectedContent.replaceAll("String_Node_Str","String_Node_Str");
  generatedContent=generatedContent.replaceAll("String_Node_Str","String_Node_Str");
  expectedContent=expectedContent.replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
  generatedContent=generatedContent.replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str" + file,expectedContent,generatedContent);
}
Program: 11927
Project: 11927
Buggy source:
public EObject getContainer(Node node){
  short type=node.getNodeType();
switch (type) {
case Node.ELEMENT_NODE:
    return (EObject)nodeToContainer.get(node);
case Node.TEXT_NODE:
case Node.CDATA_SECTION_NODE:
  return (EObject)nodeToContainer.get(node.getParentNode());
case Node.ATTRIBUTE_NODE:
return (EObject)nodeToEObject.get(((Attr)node).getOwnerElement());
default :
return null;
}
}

Fixed version (ground truth):
public EObject getContainer(Node node){
  short type=node.getNodeType();
switch (type) {
case Node.ELEMENT_NODE:
{
      Object o=nodeToObject.get(node);
      if (o != null && o instanceof EObject) {
        return ((EObject)o).eContainer();
      }
      return (EObject)nodeToObject.get(node.getParentNode());
    }
case Node.TEXT_NODE:
case Node.CDATA_SECTION_NODE:
{
    Object o=nodeToContainer.get(node);
    if (o != null) {
      return (EObject)o;
    }
    return (EObject)nodeToObject.get(node.getParentNode().getParentNode());
  }
case Node.ATTRIBUTE_NODE:
return (EObject)nodeToObject.get(((Attr)node).getOwnerElement());
default :
return null;
}
}
Program: 11928
Project: 11928
Buggy source:
public EStructuralFeature getEStructuralFeature(Node node){
  short type=node.getNodeType();
switch (type) {
case Node.ELEMENT_NODE:
    return (EStructuralFeature)nodeToFeature.get(node);
case Node.TEXT_NODE:
case Node.CDATA_SECTION_NODE:
  return (EStructuralFeature)nodeToFeature.get(node.getParentNode());
case Node.ATTRIBUTE_NODE:
{
  EObject obj=(EObject)nodeToEObject.get(((Attr)node).getOwnerElement());
  if (extendedMetaData == null) {
    return obj.eClass().getEStructuralFeature(node.getLocalName());
  }
 else {
    return extendedMetaData.getAttribute(obj.eClass(),node.getNamespaceURI(),node.getLocalName());
  }
}
default :
return null;
}
}

Fixed version (ground truth):
public EStructuralFeature getEStructuralFeature(Node node){
  short type=node.getNodeType();
switch (type) {
case Node.ELEMENT_NODE:
    return (EStructuralFeature)nodeToFeature.get(node);
case Node.ATTRIBUTE_NODE:
{
    EObject obj=(EObject)nodeToObject.get(((Attr)node).getOwnerElement());
    if (extendedMetaData == null) {
      return obj.eClass().getEStructuralFeature(node.getLocalName());
    }
 else     if (obj != null) {
      return extendedMetaData.getAttribute(obj.eClass(),node.getNamespaceURI(),node.getLocalName());
    }
  }
case Node.TEXT_NODE:
case Node.CDATA_SECTION_NODE:
{
  EStructuralFeature feature=(EStructuralFeature)nodeToFeature.get(node);
  if (feature == null) {
    feature=(EStructuralFeature)nodeToFeature.get(node.getParentNode());
  }
  return feature;
}
default :
return null;
}
}
Program: 11930
Project: 11930
Buggy source:
public void write(OutputStreamWriter os) throws IOException {
  int count=0;
  final int BUFFER_SIZE=8192;
  char[] buffer=new char[BUFFER_SIZE];
  int pos=0;
  for (Iterator i=doc.iterator(); i.hasNext(); ) {
    String s=(String)i.next();
    int slen=s.length();
    if (slen + pos >= buffer.length) {
      os.write(buffer,0,pos);
      pos=0;
      if (slen > buffer.length) {
        buffer=new char[slen];
      }
    }
    s.getChars(0,slen,buffer,pos);
    pos+=slen;
    count+=slen;
    if (count > flushThreshold) {
      os.flush();
      count=0;
    }
  }
  os.write(buffer,0,pos);
  String temporaryFileName=doc.getTemporaryFileName();
  if (temporaryFileName != null) {
    InputStreamReader reader=new InputStreamReader(new FileInputStream(temporaryFileName),"String_Node_Str");
    for (int length=reader.read(buffer,0,BUFFER_SIZE); length > 0; length=reader.read(buffer,0,BUFFER_SIZE)) {
      os.write(buffer,0,length);
      count+=length;
      if (count > flushThreshold) {
        os.flush();
        count=0;
      }
    }
    reader.close();
    new File(temporaryFileName).delete();
  }
}

Fixed version (ground truth):
public void write(OutputStreamWriter os) throws IOException {
  int count=0;
  final int BUFFER_SIZE=8192;
  char[] buffer=new char[BUFFER_SIZE];
  int pos=0;
  for (Iterator i=doc.iterator(); i.hasNext(); ) {
    String s=(String)i.next();
    int slen=s.length();
    if (slen + pos >= buffer.length) {
      os.write(buffer,0,pos);
      pos=0;
      if (slen > buffer.length) {
        buffer=new char[slen];
      }
    }
    s.getChars(0,slen,buffer,pos);
    pos+=slen;
    count+=slen;
    if (count > flushThreshold) {
      os.flush();
      count=0;
    }
  }
  os.write(buffer,0,pos);
  String temporaryFileName=doc.getTemporaryFileName();
  if (temporaryFileName != null) {
    InputStreamReader reader=new InputStreamReader(new FileInputStream(temporaryFileName),"String_Node_Str");
    for (int length=reader.read(buffer,0,BUFFER_SIZE); length > 0; length=reader.read(buffer,0,BUFFER_SIZE)) {
      os.write(buffer,0,length);
      count+=length;
      if (count > flushThreshold) {
        os.flush();
        count=0;
      }
    }
    reader.close();
    new File(temporaryFileName).delete();
  }
  os.flush();
}
Program: 11932
Project: 11932
Buggy source:
public void writeAscii(OutputStream os) throws IOException {
  int count=0;
  final int BUFFER_SIZE=8192;
  char[] buffer=new char[BUFFER_SIZE];
  byte[] bytes=new byte[BUFFER_SIZE];
  int pos=0;
  for (Iterator i=doc.iterator(); i.hasNext(); ) {
    String s=(String)i.next();
    int slen=s.length();
    if (slen + pos >= buffer.length) {
      for (int x=0; x < pos; x++) {
        bytes[x]=(byte)(buffer[x] & 0xFF);
      }
      os.write(bytes,0,pos);
      pos=0;
      if (slen > buffer.length) {
        buffer=new char[slen];
        bytes=new byte[slen];
      }
    }
    s.getChars(0,slen,buffer,pos);
    pos+=slen;
    count+=slen;
    if (count > flushThreshold) {
      os.flush();
      count=0;
    }
  }
  for (int x=0; x < pos; x++) {
    bytes[x]=(byte)(buffer[x] & 0xFF);
  }
  os.write(bytes,0,pos);
  String temporaryFileName=doc.getTemporaryFileName();
  if (temporaryFileName != null) {
    InputStream inputStream=new FileInputStream(temporaryFileName);
    for (int length=inputStream.read(bytes,0,BUFFER_SIZE); length > 0; length=inputStream.read(bytes,0,BUFFER_SIZE)) {
      os.write(bytes,0,length);
      count+=length;
      if (count > flushThreshold) {
        os.flush();
        count=0;
      }
    }
    inputStream.close();
    new File(temporaryFileName).delete();
  }
}

Fixed version (ground truth):
public void writeAscii(OutputStream os) throws IOException {
  int count=0;
  final int BUFFER_SIZE=8192;
  char[] buffer=new char[BUFFER_SIZE];
  byte[] bytes=new byte[BUFFER_SIZE];
  int pos=0;
  for (Iterator i=doc.iterator(); i.hasNext(); ) {
    String s=(String)i.next();
    int slen=s.length();
    if (slen + pos >= buffer.length) {
      for (int x=0; x < pos; x++) {
        bytes[x]=(byte)(buffer[x] & 0xFF);
      }
      os.write(bytes,0,pos);
      pos=0;
      if (slen > buffer.length) {
        buffer=new char[slen];
        bytes=new byte[slen];
      }
    }
    s.getChars(0,slen,buffer,pos);
    pos+=slen;
    count+=slen;
    if (count > flushThreshold) {
      os.flush();
      count=0;
    }
  }
  for (int x=0; x < pos; x++) {
    bytes[x]=(byte)(buffer[x] & 0xFF);
  }
  os.write(bytes,0,pos);
  String temporaryFileName=doc.getTemporaryFileName();
  if (temporaryFileName != null) {
    InputStream inputStream=new FileInputStream(temporaryFileName);
    for (int length=inputStream.read(bytes,0,BUFFER_SIZE); length > 0; length=inputStream.read(bytes,0,BUFFER_SIZE)) {
      os.write(bytes,0,length);
      count+=length;
      if (count > flushThreshold) {
        os.flush();
        count=0;
      }
    }
    inputStream.close();
    new File(temporaryFileName).delete();
  }
  os.flush();
}
Program: 11933
Project: 11933
Buggy source:
public EPackage[] packages(){
  Map map=new TreeMap();
  for (Iterator i=packages.entrySet().iterator(); i.hasNext(); ) {
    Map.Entry entry=(Map.Entry)i.next();
    EPackage conflict=(EPackage)map.put(entry.getValue(),entry.getKey());
    if (conflict != null && conflict.eResource() != null) {
      map.put(entry.getValue(),conflict);
    }
  }
  EPackage[] result=new EPackage[map.size()];
  map.values().toArray(result);
  return result;
}

Fixed version (ground truth):
public EPackage[] packages(){
  Map map=new TreeMap();
  for (Iterator i=packages.entrySet().iterator(); i.hasNext(); ) {
    Map.Entry entry=(Map.Entry)i.next();
    Object value=entry.getValue();
    if (value == null) {
      value="String_Node_Str";
    }
    EPackage conflict=(EPackage)map.put(value,entry.getKey());
    if (conflict != null && conflict.eResource() != null) {
      map.put(value,conflict);
    }
  }
  EPackage[] result=new EPackage[map.size()];
  map.values().toArray(result);
  return result;
}
Program: 11935
Project: 11935
Buggy source:
/** 
 * Method getExcludeFiles.
 * @return String
 */
private String getExcludeFile(int type){
  String file=File.separator + "String_Node_Str";
switch (type) {
case HTML:
    file+="String_Node_Str";
  break;
case PROPERTIES:
file+="String_Node_Str";
break;
case XML:
file+="String_Node_Str";
break;
default :
file+="String_Node_Str";
}
String fullPath="String_Node_Str" + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ file;
if (new File(fullPath).isFile()) {
return "String_Node_Str" + fullPath;
}
fullPath=EMFTestCorePlugin.getPlugin().getPluginDirectory() + file;
if (new File(fullPath).isFile()) {
return "String_Node_Str" + fullPath;
}
return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Method getExcludeFiles.
 * @return String
 */
private String getExcludeFile(int type){
  String file=File.separator + "String_Node_Str";
switch (type) {
case HTML:
    file+="String_Node_Str";
  break;
case PROPERTIES:
file+="String_Node_Str";
break;
case XML:
file+="String_Node_Str";
break;
default :
file+="String_Node_Str";
}
file=EMFTestCorePlugin.getPlugin().getPluginDirectory() + file;
if (new File(file).isFile()) {
return "String_Node_Str" + file;
}
return "String_Node_Str";
}
Program: 11936
Project: 11936
Buggy source:
/** 
 * Method getFilesToTest.
 * @param HTML
 * @return String
 */
private String getFilesToTest(int type){
  String sniffFolder=Platform.getInstanceLocation().toOSString();
  String aString=new File(sniffFolder).getPath() + File.separator;
switch (type) {
case HTML:
    return aString + "String_Node_Str";
case PROPERTIES:
  return aString + "String_Node_Str";
case XML:
return aString + "String_Node_Str";
default :
return aString + "String_Node_Str";
}
}

Fixed version (ground truth):
/** 
 * Method getFilesToTest.
 * @param HTML
 * @return String
 */
private String getFilesToTest(int type){
  String sniffFolder=Platform.getInstanceLocation().getURL().getFile();
  String aString=new File(sniffFolder).getPath() + File.separator;
switch (type) {
case HTML:
    return aString + "String_Node_Str";
case PROPERTIES:
  return aString + "String_Node_Str";
case XML:
return aString + "String_Node_Str";
default :
return aString + "String_Node_Str";
}
}
Program: 11937
Project: 11937
Buggy source:
public void execute(int method) throws Exception {
switch (method) {
case RestService.GET:
{
      String combinedParams="String_Node_Str";
      if (!params.isEmpty()) {
        combinedParams+="String_Node_Str";
        for (        NameValuePair p : params) {
          String paramString=p.getName() + "String_Node_Str" + URLEncoder.encode(p.getValue(),"String_Node_Str");
          if (combinedParams.length() > 1) {
            combinedParams+="String_Node_Str" + paramString;
          }
 else {
            combinedParams+=paramString;
          }
        }
      }
      request=new HttpGet(url + combinedParams);
      for (      NameValuePair h : headers) {
        request.addHeader(h.getName(),h.getValue());
      }
      commit();
      break;
    }
case RestService.POST:
{
    HttpPost request=new HttpPost(url);
    for (    NameValuePair h : headers) {
      request.addHeader(h.getName(),h.getValue());
    }
    if (!params.isEmpty()) {
      request.setEntity(new UrlEncodedFormEntity(params,HTTP.UTF_8));
    }
    commit();
    break;
  }
}
}

Fixed version (ground truth):
public void execute(int method) throws Exception {
switch (method) {
case RestService.GET:
{
      String combinedParams="String_Node_Str";
      if (!params.isEmpty()) {
        combinedParams+="String_Node_Str";
        for (        NameValuePair p : params) {
          String paramString=p.getName() + "String_Node_Str" + URLEncoder.encode(p.getValue(),"String_Node_Str");
          if (combinedParams.length() > 1) {
            combinedParams+="String_Node_Str" + paramString;
          }
 else {
            combinedParams+=paramString;
          }
        }
      }
      request=new HttpGet(url + combinedParams);
      for (      NameValuePair h : headers) {
        request.addHeader(h.getName(),h.getValue());
      }
      commit();
      break;
    }
case RestService.POST:
{
    request=new HttpPost(url);
    for (    NameValuePair h : headers) {
      request.addHeader(h.getName(),h.getValue());
    }
    if (!params.isEmpty()) {
      ((HttpPost)request).setEntity(new UrlEncodedFormEntity(params,HTTP.UTF_8));
    }
    commit();
    break;
  }
}
}
Program: 11939
Project: 11939
Buggy source:
private String getTopicDesc(Topic t){
  StringBuilder sb=new StringBuilder();
  sb.append(t.getUser().getLogin()).append("String_Node_Str");
  sb.append(howLongAgo(t.getCreatedAt()));
  sb.append(getContext().getString(R.string.fragment_at)).append(topic.getNodeName()).append(getContext().getString(R.string.fragment_created));
  return sb.toString();
}

Fixed version (ground truth):
private String getTopicDesc(Topic t){
  StringBuilder sb=new StringBuilder();
  sb.append(t.getUser().getLogin()).append("String_Node_Str");
  sb.append(getCreatedTime(t.getCreatedAt())).append("String_Node_Str");
  sb.append(getContext().getString(R.string.fragment_at)).append(topic.getNodeName()).append(getContext().getString(R.string.fragment_created));
  return sb.toString();
}
Program: 11941
Project: 11941
Buggy source:
private void refreshPage(List<Topic> topics,Node node){
  initializeNode(node);
  TopicAdapter adapter=new TopicAdapter(this,getActivity(),R.layout.topic_item,R.id.title,topics);
  setListAdapter(adapter);
  getListView().setDivider(getResources().getDrawable(R.drawable.list_divider));
  getListView().setDividerHeight(1);
}

Fixed version (ground truth):
private void refreshPage(List<Topic> topics,Node node){
  initializeNode(node);
  TopicAdapter adapter=new TopicAdapter(this,getActivity(),R.layout.topic_item,R.id.title,topics);
  topicList.setAdapter(adapter);
  topicList.setOnItemClickListener(new OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> parent,    View v,    int position,    long id){
      listener.onTopicSelected(((TopicAdapter)((HeaderViewListAdapter)parent.getAdapter()).getWrappedAdapter()).getItems(),position - 1);
    }
  }
);
}
Program: 11942
Project: 11942
Buggy source:
private void initializeNode(Node node){
  if (nodeSection == null) {
    nodeSection=(TextView)LayoutInflater.from(getActivity()).inflate(R.layout.node_section_header,null);
    getListView().addHeaderView(nodeSection,null,false);
  }
  nodeSection.setText(node.getName());
}

Fixed version (ground truth):
private void initializeNode(Node node){
  if (nodeSection == null) {
    nodeSection=(TextView)LayoutInflater.from(getActivity()).inflate(R.layout.node_section_header,null);
  }
  topicList.addHeaderView(nodeSection,null,false);
  nodeSection.setText(node.getName());
}
Program: 11944
Project: 11944
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  setActionBarContentView(R.layout.topic_detail_layout);
  addActionBarItem(Type.List,R.id.action_bar_replies);
  t=GlobalResource.INSTANCE.getCurTopics().get(getIntent().getIntExtra(POS,0));
  TextView title=(TextView)findViewById(R.id.title);
  title.setText(t.getTitle());
  ImageView avatar=(ImageView)findViewById(R.id.gravatar);
  Bitmap avatarBitmap=((RCApplication)getApplication()).getImgLoader().load(t.getUser().getAvatarUrl(),avatar);
  if (avatarBitmap != null) {
    avatar.setImageBitmap(avatarBitmap);
  }
  WebView webView=(WebView)findViewById(R.id.body_html);
  webView.getSettings().setJavaScriptEnabled(true);
  webView.getSettings().setBuiltInZoomControls(true);
  webView.getSettings().setDefaultTextEncodingName("String_Node_Str");
  webView.loadData(t.getBodyHTML(),"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  setActionBarContentView(R.layout.topic_detail_layout);
  addActionBarItem(Type.List,R.id.action_bar_replies);
  t=GlobalResource.INSTANCE.getCurTopics().get(getIntent().getIntExtra(POS,0));
  TextView title=(TextView)findViewById(R.id.title);
  title.setText(t.getTitle());
  ImageView gravatar=(ImageView)findViewById(R.id.gravatar);
  String avatar=t.getUser().getAvatarUrl();
  String hash=t.getUser().getGravatarHash();
  if (TextUtils.isEmpty(avatar)) {
    Bitmap ava=((RCApplication)getApplication()).getImgLoader().load(GravatarUtil.getBaseURL(hash),gravatar);
    if (ava != null) {
      gravatar.setImageBitmap(ava);
    }
 else {
      gravatar.setImageResource(R.drawable.default_gravatar);
    }
  }
 else {
    Bitmap ava=((RCApplication)getApplication()).getImgLoader().load(avatar,gravatar);
    if (ava != null) {
      gravatar.setImageBitmap(ava);
    }
 else {
      gravatar.setImageResource(R.drawable.default_gravatar);
    }
  }
  WebView webView=(WebView)findViewById(R.id.body_html);
  webView.getSettings().setJavaScriptEnabled(true);
  webView.getSettings().setBuiltInZoomControls(true);
  webView.getSettings().setDefaultTextEncodingName("String_Node_Str");
  webView.loadData(t.getBodyHTML(),"String_Node_Str","String_Node_Str");
}
Program: 11945
Project: 11945
Buggy source:
private void startTopicsRequest(int nodeId){
  if (request == null) {
    request=new HotTopicsRequest();
  }
  ((RCApplication)getApplication()).getAPIClient().request(request,new HotTopicsCallback());
  setProgressBarIndeterminateVisibility(true);
}

Fixed version (ground truth):
private void startTopicsRequest(int nodeId){
  if (request == null) {
    request=new HotTopicsRequest();
  }
  if (!(nodeId == HOT_TOPICS_NODE_ID)) {
    request.setNodeId(nodeId);
  }
  ((RCApplication)getApplication()).getAPIClient().request(request,new HotTopicsCallback());
  setProgressBarIndeterminateVisibility(true);
}
Program: 11946
Project: 11946
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  ViewHolder viewHolder;
  if (convertView == null) {
    viewHolder=new ViewHolder();
    convertView=LayoutInflater.from(context).inflate(resource,null);
    viewHolder.gravatar=(ImageView)convertView.findViewById(R.id.gravatar);
    viewHolder.title=(TextView)convertView.findViewById(R.id.title);
    viewHolder.replies=(TextView)convertView.findViewById(R.id.reply_count);
    convertView.setTag(viewHolder);
  }
 else {
    viewHolder=(ViewHolder)convertView.getTag();
  }
  Topic t=items.get(position);
  String avatar=t.getUser().getAvatarUrl();
  LogUtil.d(TAG,"String_Node_Str" + avatar);
  LogUtil.d(TAG,"String_Node_Str" + t.getUser().getGravatarHash());
  if (TextUtils.isEmpty(avatar)) {
    viewHolder.gravatar.setImageResource(R.drawable.default_gravatar);
  }
 else {
    Bitmap ava=((RCApplication)getApplication()).getImgLoader().load(avatar,viewHolder.gravatar);
    if (ava != null) {
      viewHolder.gravatar.setImageBitmap(ava);
    }
 else {
      viewHolder.gravatar.setImageResource(R.drawable.default_gravatar);
    }
  }
  viewHolder.title.setText(t.getTitle());
  viewHolder.replies.setText(t.getRepliesCount() + "String_Node_Str");
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  ViewHolder viewHolder;
  if (convertView == null) {
    viewHolder=new ViewHolder();
    convertView=LayoutInflater.from(context).inflate(resource,null);
    viewHolder.gravatar=(ImageView)convertView.findViewById(R.id.gravatar);
    viewHolder.title=(TextView)convertView.findViewById(R.id.title);
    viewHolder.replies=(TextView)convertView.findViewById(R.id.reply_count);
    convertView.setTag(viewHolder);
  }
 else {
    viewHolder=(ViewHolder)convertView.getTag();
  }
  Topic t=items.get(position);
  String avatar=t.getUser().getAvatarUrl();
  String hash=t.getUser().getGravatarHash();
  if (TextUtils.isEmpty(avatar)) {
    Bitmap ava=((RCApplication)getApplication()).getImgLoader().load(GravatarUtil.getBaseURL(hash),viewHolder.gravatar);
    if (ava != null) {
      viewHolder.gravatar.setImageBitmap(ava);
    }
 else {
      viewHolder.gravatar.setImageResource(R.drawable.default_gravatar);
    }
  }
 else {
    Bitmap ava=((RCApplication)getApplication()).getImgLoader().load(avatar,viewHolder.gravatar);
    if (ava != null) {
      viewHolder.gravatar.setImageBitmap(ava);
    }
 else {
      viewHolder.gravatar.setImageResource(R.drawable.default_gravatar);
    }
  }
  viewHolder.title.setText(t.getTitle());
  viewHolder.replies.setText(t.getRepliesCount() + "String_Node_Str");
  return convertView;
}
Program: 11947
Project: 11947
Buggy source:
@Override public void parse(String source){
  Log.d(TAG,source);
  try {
    JSONArray jsonReplies=new JSONObject(source).getJSONArray("String_Node_Str");
    List<Reply> replies=new ArrayList<Reply>();
    int length=jsonReplies.length();
    for (int i=0; i < length; i++) {
      replies.add(json2Reply(jsonReplies.getJSONObject(i)));
    }
    resp.setReplies(replies);
    resp.setSuccess(true);
  }
 catch (  JSONException e) {
    resp.setSuccess(false);
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void parse(String source){
  try {
    JSONArray jsonReplies=new JSONObject(source).getJSONArray("String_Node_Str");
    List<Reply> replies=new ArrayList<Reply>();
    int length=jsonReplies.length();
    for (int i=0; i < length; i++) {
      replies.add(json2Reply(jsonReplies.getJSONObject(i)));
    }
    resp.setReplies(replies);
    resp.setSuccess(true);
  }
 catch (  JSONException e) {
    resp.setSuccess(false);
    e.printStackTrace();
  }
}
Program: 11948
Project: 11948
Buggy source:
@Override public String getCacheRelativePathOrURL(){
  return makeCachePath("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Override public String getCacheRelativePathOrURL(){
  return makeCachePath("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",size + "String_Node_Str");
}
Program: 11949
Project: 11949
Buggy source:
@Override public Map<String,String> getTextParams(RCAPIContext context){
  HashMap<String,String> params=new HashMap<String,String>();
  return params;
}

Fixed version (ground truth):
@Override public Map<String,String> getTextParams(RCAPIContext context){
  HashMap<String,String> params=new HashMap<String,String>();
  params.put(SIZE_KEY,size + "String_Node_Str");
  return params;
}
Program: 11950
Project: 11950
Buggy source:
@Override public long getCacheTime(){
  return 60 * 60;
}

Fixed version (ground truth):
@Override public long getCacheTime(){
  return Cache.EXPIRED;
}
Program: 11951
Project: 11951
Buggy source:
protected Configuration getConfiguration(IPreferenceStore store,ISelection selection){
  Configuration config=null;
  StructuredSelection structuredSelection=null;
  if (selection instanceof StructuredSelection) {
    structuredSelection=(StructuredSelection)selection;
  }
  if (!isNotSelected(structuredSelection) && !isSelectedSeveral(structuredSelection)) {
    String projectName=getProjectName(structuredSelection);
    String projectRootPath=getWorkspaceRootAbsolutePath(getIWorkspaceRoot()) + StringValue.DirectorySeparator.General + projectName+ StringValue.DirectorySeparator.General;
    String configFilepath=projectRootPath + "String_Node_Str";
    File configProperites=new File(configFilepath);
    if (configProperites.exists()) {
      try {
        config=new ConfigurationLoader().load(configFilepath);
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
 else {
      config=new PreferenceLoader(store).getConfig();
    }
    String extConfigFilepath=projectRootPath + "String_Node_Str";
    File extConfigXML=new File(extConfigFilepath);
    if (extConfigXML.exists()) {
      try {
        ExtConfiguration extConfig=new ExtConfigurationLoader().load(extConfigFilepath);
        config.isExtensionEnabled=true;
        config.extConfiguration=extConfig;
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
  return config;
}

Fixed version (ground truth):
protected Configuration getConfiguration(IPreferenceStore store,ISelection selection){
  Configuration config=null;
  StructuredSelection structuredSelection=null;
  if (selection instanceof StructuredSelection) {
    structuredSelection=(StructuredSelection)selection;
  }
  if (!isNotSelected(structuredSelection) && !isSelectedSeveral(structuredSelection)) {
    String projectName=getProjectName(structuredSelection);
    String projectRootPath=getIWorkspaceRoot().findMember(projectName).getLocationURI().getPath() + StringValue.DirectorySeparator.General;
    String configFilepath=projectRootPath + "String_Node_Str";
    File configProperites=new File(configFilepath);
    if (configProperites.exists()) {
      try {
        config=new ConfigurationLoader().load(configFilepath);
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
 else {
      config=new PreferenceLoader(store).getConfig();
    }
    String extConfigFilepath=projectRootPath + "String_Node_Str";
    File extConfigXML=new File(extConfigFilepath);
    if (extConfigXML.exists()) {
      try {
        ExtConfiguration extConfig=new ExtConfigurationLoader().load(extConfigFilepath);
        config.isExtensionEnabled=true;
        config.extConfiguration=extConfig;
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
  return config;
}
Program: 11959
Project: 11959
Buggy source:
void appendExtensionSourceCode(StringBuilder buf,String code){
  Assertion.on("String_Node_Str").mustNotBeNull(buf);
  Assertion.on("String_Node_Str").mustNotBeNull(code);
  String[] separatedListBySemicolon=code.split(StringValue.Semicolon);
  for (  String separatedBySemicolon : separatedListBySemicolon) {
    if (separatedBySemicolon != null && separatedBySemicolon.trim().length() > 0) {
      separatedBySemicolon=separatedBySemicolon.trim().replaceAll(StringValue.CarriageReturn,"String_Node_Str");
      String[] lines=separatedBySemicolon.split(StringValue.LineFeed);
      for (int i=0; i < (lines.length - 1); i++) {
        String line=lines[i];
        if (line != null && line.trim().length() > 0) {
          appendTabs(buf,2);
          buf.append(line.trim());
          appendLineBreak(buf);
        }
      }
      String lastLine=lines[lines.length - 1];
      if (lastLine != null && lastLine.trim().length() > 0) {
        appendTabs(buf,2);
        buf.append(lastLine.trim());
        if (!lastLine.endsWith("String_Node_Str") && !lastLine.endsWith("String_Node_Str")) {
          buf.append(StringValue.Semicolon);
        }
        appendLineBreak(buf);
      }
    }
  }
}

Fixed version (ground truth):
void appendExtensionSourceCode(StringBuilder buf,String code){
  Assertion.on("String_Node_Str").mustNotBeNull(buf);
  Assertion.on("String_Node_Str").mustNotBeNull(code);
  String[] separatedListBySemicolon=code.split(StringValue.Semicolon);
  for (  String separatedBySemicolon : separatedListBySemicolon) {
    if (separatedBySemicolon != null && separatedBySemicolon.trim().length() > 0) {
      separatedBySemicolon=separatedBySemicolon.trim().replaceAll(StringValue.CarriageReturn,StringValue.Empty);
      String[] lines=separatedBySemicolon.split(StringValue.LineFeed);
      for (int i=0; i < (lines.length - 1); i++) {
        String line=lines[i];
        if (line != null && line.trim().length() > 0) {
          appendTabs(buf,2);
          buf.append(line.trim());
          appendLineBreak(buf);
        }
      }
      String lastLine=lines[lines.length - 1];
      if (lastLine != null && lastLine.trim().length() > 0) {
        appendTabs(buf,2);
        buf.append(lastLine.trim());
        if (!lastLine.endsWith("String_Node_Str") && !lastLine.endsWith("String_Node_Str")) {
          buf.append(StringValue.Semicolon);
        }
        appendLineBreak(buf);
      }
    }
  }
}
Program: 11963
Project: 11963
Buggy source:
static String getInstantiationSourceCode(Configuration config,TestMethodMeta testMethodMeta){
  Assertion.on("String_Node_Str").mustNotBeNull(config);
  Assertion.on("String_Node_Str").mustNotBeNull(testMethodMeta);
  if (config.isExtensionEnabled && config.extConfiguration.extInstantiations != null) {
    for (    ExtInstantiation ins : config.extConfiguration.extInstantiations) {
      if (isCanonicalClassNameUsed(ins.canonicalClassName,testMethodMeta.classMeta.name,testMethodMeta.classMeta)) {
        for (        String newImport : ins.importList) {
          testMethodMeta.classMeta.importedList.add(newImport);
        }
        StringBuilder buf=new StringBuilder();
        if (ins.preAssignCode != null && ins.preAssignCode.trim().length() > 0) {
          appendExtensionSourceCode(buf,ins.preAssignCode);
        }
        appendTabs(buf,2);
        buf.append(testMethodMeta.classMeta.name);
        buf.append("String_Node_Str");
        buf.append(ins.assignCode.trim());
        appendCRLF(buf);
        if (ins.postAssignCode != null && ins.postAssignCode.trim().length() > 0) {
          appendExtensionPostAssignSourceCode(buf,ins.postAssignCode,new String[]{"String_Node_Str"},"String_Node_Str");
        }
        return buf.toString();
      }
    }
  }
  return new DefaultConstructorGenerator().getFirstInstantiationSourceCode(config,testMethodMeta.classMeta);
}

Fixed version (ground truth):
static String getInstantiationSourceCode(Configuration config,TestMethodMeta testMethodMeta){
  Assertion.on("String_Node_Str").mustNotBeNull(config);
  Assertion.on("String_Node_Str").mustNotBeNull(testMethodMeta);
  if (config.isExtensionEnabled && config.extConfiguration.extInstantiations != null) {
    for (    ExtInstantiation ins : config.extConfiguration.extInstantiations) {
      if (isCanonicalClassNameUsed(ins.canonicalClassName,testMethodMeta.classMeta.name,testMethodMeta.classMeta)) {
        for (        String newImport : ins.importList) {
          testMethodMeta.classMeta.importedList.add(newImport);
        }
        StringBuilder buf=new StringBuilder();
        if (ins.preAssignCode != null && ins.preAssignCode.trim().length() > 0) {
          appendExtensionSourceCode(buf,ins.preAssignCode);
        }
        appendTabs(buf,2);
        buf.append(testMethodMeta.classMeta.name);
        buf.append("String_Node_Str");
        buf.append(ins.assignCode.trim());
        if (!ins.assignCode.trim().endsWith(StringValue.Semicolon)) {
          buf.append(StringValue.Semicolon);
        }
        appendCRLF(buf);
        if (ins.postAssignCode != null && ins.postAssignCode.trim().length() > 0) {
          appendExtensionPostAssignSourceCode(buf,ins.postAssignCode,new String[]{"String_Node_Str"},"String_Node_Str");
        }
        return buf.toString();
      }
    }
  }
  return new DefaultConstructorGenerator().getFirstInstantiationSourceCode(config,testMethodMeta.classMeta);
}
Program: 11967
Project: 11967
Buggy source:
public static ConstructorGenerator create(){
  return new ConstructorGeneratorImpl();
}

Fixed version (ground truth):
public static ConstructorGenerator create(Configuration config,LineBreakProvider lineBreakProvider){
  return new ConstructorGeneratorImpl(config,lineBreakProvider);
}