nus-yam/ex-repair huggingface dataset:
Program: 45680
Project: 45680
Buggy source:
@Override public void serializeToResValuesXml(XmlSerializer serializer,ResResource res) throws IOException, AndrolibException {
  String type=res.getResSpec().getType().getName();
  boolean item=!"String_Node_Str".equals(mType) && !type.equals(mType);
  String body=encodeAsResXmlValue();
  if (body.contains("String_Node_Str")) {
    if (!res.getFilePath().contains("String_Node_Str")) {
      item=true;
    }
  }
  String tagName=item ? "String_Node_Str" : type;
  serializer.startTag(null,tagName);
  if (item) {
    serializer.attribute(null,"String_Node_Str",type);
  }
  serializer.attribute(null,"String_Node_Str",res.getResSpec().getName());
  serializeExtraXmlAttrs(serializer,res);
  if (!body.isEmpty()) {
    serializer.ignorableWhitespace(body);
  }
  serializer.endTag(null,tagName);
}

Fixed version (ground truth):
@Override public void serializeToResValuesXml(XmlSerializer serializer,ResResource res) throws IOException, AndrolibException {
  String type=res.getResSpec().getType().getName();
  boolean item=!"String_Node_Str".equals(mType) && !type.equals(mType);
  String body=encodeAsResXmlValue();
  if (!type.equalsIgnoreCase("String_Node_Str")) {
    if (body.contains("String_Node_Str")) {
      if (!res.getFilePath().contains("String_Node_Str")) {
        item=true;
      }
    }
  }
  String tagName=item ? "String_Node_Str" : type;
  serializer.startTag(null,tagName);
  if (item) {
    serializer.attribute(null,"String_Node_Str",type);
  }
  serializer.attribute(null,"String_Node_Str",res.getResSpec().getName());
  serializeExtraXmlAttrs(serializer,res);
  if (!body.isEmpty()) {
    serializer.ignorableWhitespace(body);
  }
  serializer.endTag(null,tagName);
}
Program: 45683
Project: 45683
Buggy source:
public void decodeSourcesSmali(File apkFile,File outDir,boolean debug,boolean bakdeb) throws AndrolibException {
  try {
    File smaliDir=new File(outDir,SMALI_DIRNAME);
    OS.rmdir(smaliDir);
    smaliDir.mkdirs();
    LOGGER.info("String_Node_Str");
    SmaliDecoder.decode(apkFile,smaliDir,debug,bakdeb);
  }
 catch (  BrutException ex) {
    throw new AndrolibException(ex);
  }
}

Fixed version (ground truth):
public void decodeSourcesSmali(File apkFile,File outDir,boolean debug,String debugLinePrefix,boolean bakdeb) throws AndrolibException {
  try {
    File smaliDir=new File(outDir,SMALI_DIRNAME);
    OS.rmdir(smaliDir);
    smaliDir.mkdirs();
    LOGGER.info("String_Node_Str");
    SmaliDecoder.decode(apkFile,smaliDir,debug,debugLinePrefix,bakdeb);
  }
 catch (  BrutException ex) {
    throw new AndrolibException(ex);
  }
}
Program: 45685
Project: 45685
Buggy source:
@Override public FileVisitResult visitFile(Path file,BasicFileAttributes attrs) throws IOException {
  String fileName=file.getFileName().toString();
  if (!fileName.endsWith("String_Node_Str")) {
    return FileVisitResult.CONTINUE;
  }
  fileName=fileName.substring(0,fileName.length() - 6);
  try (BufferedReader in=Files.newBufferedReader(file,Charset.defaultCharset());BufferedWriter out=Files.newBufferedWriter(file.resolveSibling(fileName + "String_Node_Str"),Charset.defaultCharset())){
    TypeName type=TypeName.fromPath(mOutDir.relativize(file.resolveSibling(fileName)));
    out.write("String_Node_Str" + type.package_ + "String_Node_Str"+ type.getName(true,true)+ "String_Node_Str");
    out.newLine();
    String line;
    while ((line=in.readLine()) != null) {
      out.write("String_Node_Str");
      out.write(line);
      out.newLine();
    }
    out.write("String_Node_Str");
    out.newLine();
  }
   Files.delete(file);
  return FileVisitResult.CONTINUE;
}

Fixed version (ground truth):
@Override public FileVisitResult visitFile(Path file,BasicFileAttributes attrs) throws IOException {
  String fileName=file.getFileName().toString();
  if (!fileName.endsWith("String_Node_Str")) {
    return FileVisitResult.CONTINUE;
  }
  fileName=fileName.substring(0,fileName.length() - 6);
  try (BufferedReader in=Files.newBufferedReader(file,Charset.defaultCharset());BufferedWriter out=Files.newBufferedWriter(file.resolveSibling(fileName + "String_Node_Str"),Charset.defaultCharset())){
    TypeName type=TypeName.fromPath(mOutDir.relativize(file.resolveSibling(fileName)));
    out.write("String_Node_Str" + type.package_ + "String_Node_Str"+ type.getName(true,true)+ "String_Node_Str");
    out.newLine();
    String line;
    final String debugLinePrefix=mDebugLinePrefix;
    while ((line=in.readLine()) != null) {
      out.write(debugLinePrefix);
      out.write(line);
      out.newLine();
    }
    out.write("String_Node_Str");
    out.newLine();
  }
   Files.delete(file);
  return FileVisitResult.CONTINUE;
}
Program: 45686
Project: 45686
Buggy source:
private SmaliDecoder(File apkFile,File outDir,boolean debug,boolean bakdeb){
  mApkFile=apkFile;
  mOutDir=outDir.toPath();
  mDebug=debug;
  mBakDeb=bakdeb;
}

Fixed version (ground truth):
private SmaliDecoder(File apkFile,File outDir,boolean debug,String debugLinePrefix,boolean bakdeb){
  mApkFile=apkFile;
  mOutDir=outDir.toPath();
  mDebug=debug;
  mDebugLinePrefix=debugLinePrefix;
  mBakDeb=bakdeb;
}
Program: 45689
Project: 45689
Buggy source:
public void decodeSourcesSmali(File apkFile,File outDir,boolean debug,boolean bakdeb) throws AndrolibException {
  try {
    File smaliDir=new File(outDir,SMALI_DIRNAME);
    OS.rmdir(smaliDir);
    smaliDir.mkdirs();
    LOGGER.info("String_Node_Str");
    SmaliDecoder.decode(apkFile,smaliDir,debug,bakdeb);
  }
 catch (  BrutException ex) {
    throw new AndrolibException(ex);
  }
}

Fixed version (ground truth):
public void decodeSourcesSmali(File apkFile,File outDir,boolean debug,String debugLinePrefix,boolean bakdeb) throws AndrolibException {
  try {
    File smaliDir=new File(outDir,SMALI_DIRNAME);
    OS.rmdir(smaliDir);
    smaliDir.mkdirs();
    LOGGER.info("String_Node_Str");
    SmaliDecoder.decode(apkFile,smaliDir,debug,debugLinePrefix,bakdeb);
  }
 catch (  BrutException ex) {
    throw new AndrolibException(ex);
  }
}
Program: 45691
Project: 45691
Buggy source:
@Override public FileVisitResult visitFile(Path file,BasicFileAttributes attrs) throws IOException {
  String fileName=file.getFileName().toString();
  if (!fileName.endsWith("String_Node_Str")) {
    return FileVisitResult.CONTINUE;
  }
  fileName=fileName.substring(0,fileName.length() - 6);
  try (BufferedReader in=Files.newBufferedReader(file,Charset.defaultCharset());BufferedWriter out=Files.newBufferedWriter(file.resolveSibling(fileName + "String_Node_Str"),Charset.defaultCharset())){
    TypeName type=TypeName.fromPath(mOutDir.relativize(file.resolveSibling(fileName)));
    out.write("String_Node_Str" + type.package_ + "String_Node_Str"+ type.getName(true,true)+ "String_Node_Str");
    out.newLine();
    String line;
    while ((line=in.readLine()) != null) {
      out.write("String_Node_Str");
      out.write(line);
      out.newLine();
    }
    out.write("String_Node_Str");
    out.newLine();
  }
   Files.delete(file);
  return FileVisitResult.CONTINUE;
}

Fixed version (ground truth):
@Override public FileVisitResult visitFile(Path file,BasicFileAttributes attrs) throws IOException {
  String fileName=file.getFileName().toString();
  if (!fileName.endsWith("String_Node_Str")) {
    return FileVisitResult.CONTINUE;
  }
  fileName=fileName.substring(0,fileName.length() - 6);
  try (BufferedReader in=Files.newBufferedReader(file,Charset.defaultCharset());BufferedWriter out=Files.newBufferedWriter(file.resolveSibling(fileName + "String_Node_Str"),Charset.defaultCharset())){
    TypeName type=TypeName.fromPath(mOutDir.relativize(file.resolveSibling(fileName)));
    out.write("String_Node_Str" + type.package_ + "String_Node_Str"+ type.getName(true,true)+ "String_Node_Str");
    out.newLine();
    String line;
    final String debugLinePrefix=mDebugLinePrefix;
    while ((line=in.readLine()) != null) {
      out.write(debugLinePrefix);
      out.write(line);
      out.newLine();
    }
    out.write("String_Node_Str");
    out.newLine();
  }
   Files.delete(file);
  return FileVisitResult.CONTINUE;
}
Program: 45692
Project: 45692
Buggy source:
private SmaliDecoder(File apkFile,File outDir,boolean debug,boolean bakdeb){
  mApkFile=apkFile;
  mOutDir=outDir.toPath();
  mDebug=debug;
  mBakDeb=bakdeb;
}

Fixed version (ground truth):
private SmaliDecoder(File apkFile,File outDir,boolean debug,String debugLinePrefix,boolean bakdeb){
  mApkFile=apkFile;
  mOutDir=outDir.toPath();
  mDebug=debug;
  mDebugLinePrefix=debugLinePrefix;
  mBakDeb=bakdeb;
}
Program: 45693
Project: 45693
Buggy source:
private boolean step(){
  String line=next();
  if (line.isEmpty()) {
    return false;
  }
switch (line.charAt(0)) {
case '#':
    return processComment(line);
case ':':
  append(line);
return false;
case '.':
return processDirective(line);
default :
return processInstruction(line);
}
}

Fixed version (ground truth):
private boolean step(){
  String line=next();
  if (line.isEmpty()) {
    return false;
  }
switch (line.charAt(0)) {
case '#':
    return processComment(line);
case ':':
  append(line);
return false;
case '.':
return processDirective(line);
default :
if (!areParamsInjected) {
injectRemainingParams();
}
return processInstruction(line);
}
}
Program: 45694
Project: 45694
Buggy source:
private void inject() throws AndrolibException {
  String definition=nextAndAppend();
  if (definition.contains("String_Node_Str") || definition.contains("String_Node_Str")) {
    nextAndAppend();
    return;
  }
  injectParameters(definition);
  boolean end=false;
  while (!end) {
    end=step();
  }
}

Fixed version (ground truth):
private void inject() throws AndrolibException {
  String definition=nextAndAppend();
  if (definition.contains("String_Node_Str") || definition.contains("String_Node_Str")) {
    nextAndAppend();
    return;
  }
  parseParamsNumber(definition);
  boolean end=false;
  while (!end) {
    end=step();
  }
}
Program: 45695
Project: 45695
Buggy source:
private boolean processDirective(String line){
  String line2=line.substring(1);
  if (line2.startsWith("String_Node_Str") || line2.equals("String_Node_Str") || line2.startsWith("String_Node_Str")|| line2.startsWith("String_Node_Str")|| line2.startsWith("String_Node_Str")) {
    return false;
  }
  append(line);
  if (line2.equals("String_Node_Str")) {
    return true;
  }
  if (line2.startsWith("String_Node_Str") || line2.equals("String_Node_Str") || line2.startsWith("String_Node_Str")|| line2.startsWith("String_Node_Str")) {
    while (true) {
      line2=nextAndAppend();
      if (line2.startsWith("String_Node_Str")) {
        break;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean processDirective(String line){
  String line2=line.substring(1);
  if (line2.startsWith("String_Node_Str") || line2.startsWith("String_Node_Str") || line2.startsWith("String_Node_Str")) {
    return false;
  }
  if (line2.equals("String_Node_Str")) {
    if (!areParamsInjected) {
      injectRemainingParams();
    }
    return false;
  }
  if (line2.equals("String_Node_Str")) {
    mOut.append("String_Node_Str").append(currParam++).append("String_Node_Str");
    return false;
  }
  append(line);
  if (line2.equals("String_Node_Str")) {
    return true;
  }
  if (line2.startsWith("String_Node_Str") || line2.equals("String_Node_Str") || line2.startsWith("String_Node_Str")|| line2.startsWith("String_Node_Str")) {
    while (true) {
      line2=nextAndAppend();
      if (line2.startsWith("String_Node_Str")) {
        break;
      }
    }
  }
  return false;
}
Program: 45697
Project: 45697
Buggy source:
public void build(ExtFile appDir,File outFile,HashMap<String,Boolean> flags,ExtFile origApk,String aaptPath) throws BrutException {
  mAaptPath=aaptPath;
  Map<String,Object> meta=readMetaFile(appDir);
  Object t1=meta.get("String_Node_Str");
  flags.put("String_Node_Str",t1 == null ? false : (Boolean)t1);
  mAndRes.setSdkInfo((Map<String,String>)meta.get("String_Node_Str"));
  if (flags.get("String_Node_Str")) {
    if (!origApk.isFile() || !origApk.canRead()) {
      throw new InFileNotFoundException();
    }
 else {
      mOrigApkFile=origApk;
    }
  }
  if (outFile == null) {
    String outFileName=(String)meta.get("String_Node_Str");
    outFile=new File(appDir,"String_Node_Str" + File.separator + (outFileName == null ? "String_Node_Str" : outFileName));
  }
  new File(appDir,APK_DIRNAME).mkdirs();
  buildSources(appDir,flags);
  buildResources(appDir,flags,(Map<String,Object>)meta.get("String_Node_Str"));
  buildLib(appDir,flags);
  buildApk(appDir,outFile,flags);
}

Fixed version (ground truth):
public void build(ExtFile appDir,File outFile,HashMap<String,Boolean> flags,ExtFile origApk,String aaptPath) throws BrutException {
  mAaptPath=aaptPath;
  Map<String,Object> meta=readMetaFile(appDir);
  Object t1=meta.get("String_Node_Str");
  flags.put("String_Node_Str",t1 == null ? false : (Boolean)t1);
  flags.put("String_Node_Str",meta.get("String_Node_Str") == null ? false : (Boolean)meta.get("String_Node_Str"));
  mAndRes.setSdkInfo((Map<String,String>)meta.get("String_Node_Str"));
  if (flags.get("String_Node_Str")) {
    if (!origApk.isFile() || !origApk.canRead()) {
      throw new InFileNotFoundException();
    }
 else {
      mOrigApkFile=origApk;
    }
  }
  if (outFile == null) {
    String outFileName=(String)meta.get("String_Node_Str");
    outFile=new File(appDir,"String_Node_Str" + File.separator + (outFileName == null ? "String_Node_Str" : outFileName));
  }
  new File(appDir,APK_DIRNAME).mkdirs();
  buildSources(appDir,flags);
  buildResources(appDir,flags,(Map<String,Object>)meta.get("String_Node_Str"));
  buildLib(appDir,flags);
  buildApk(appDir,outFile,flags);
}
Program: 45698
Project: 45698
Buggy source:
public void decode() throws AndrolibException {
  File outDir=getOutDir();
  if (!mForceDelete && outDir.exists()) {
    throw new OutDirExistsException();
  }
  if (!mApkFile.isFile() || !mApkFile.canRead()) {
    throw new InFileNotFoundException();
  }
  try {
    OS.rmdir(outDir);
  }
 catch (  BrutException ex) {
    throw new AndrolibException(ex);
  }
  outDir.mkdirs();
  if (hasSources()) {
switch (mDecodeSources) {
case DECODE_SOURCES_NONE:
      mAndrolib.decodeSourcesRaw(mApkFile,outDir,mDebug);
    break;
case DECODE_SOURCES_SMALI:
  mAndrolib.decodeSourcesSmali(mApkFile,outDir,mDebug,mBakDeb);
break;
case DECODE_SOURCES_JAVA:
mAndrolib.decodeSourcesJava(mApkFile,outDir,mDebug);
break;
}
}
if (hasResources()) {
switch (mDecodeResources) {
case DECODE_RESOURCES_NONE:
mAndrolib.decodeResourcesRaw(mApkFile,outDir);
break;
case DECODE_RESOURCES_FULL:
mAndrolib.decodeResourcesFull(mApkFile,outDir,getResTable());
break;
}
}
 else {
if (hasManifest()) {
switch (mDecodeResources) {
case DECODE_RESOURCES_NONE:
mAndrolib.decodeManifestRaw(mApkFile,outDir);
break;
case DECODE_RESOURCES_FULL:
mAndrolib.decodeManifestFull(mApkFile,outDir,getResTable());
break;
}
}
}
mAndrolib.decodeRawFiles(mApkFile,outDir);
writeMetaFile();
}

Fixed version (ground truth):
public void decode() throws AndrolibException, IOException {
  File outDir=getOutDir();
  if (!mForceDelete && outDir.exists()) {
    throw new OutDirExistsException();
  }
  if (!mApkFile.isFile() || !mApkFile.canRead()) {
    throw new InFileNotFoundException();
  }
  try {
    OS.rmdir(outDir);
  }
 catch (  BrutException ex) {
    throw new AndrolibException(ex);
  }
  outDir.mkdirs();
  if (hasSources()) {
switch (mDecodeSources) {
case DECODE_SOURCES_NONE:
      mAndrolib.decodeSourcesRaw(mApkFile,outDir,mDebug);
    break;
case DECODE_SOURCES_SMALI:
  mAndrolib.decodeSourcesSmali(mApkFile,outDir,mDebug,mBakDeb);
break;
case DECODE_SOURCES_JAVA:
mAndrolib.decodeSourcesJava(mApkFile,outDir,mDebug);
break;
}
}
if (hasResources()) {
JarFile jf=new JarFile(mApkFile.getAbsoluteFile());
Enumeration<?> e=jf.entries();
while (e.hasMoreElements()) {
JarEntry je=(JarEntry)e.nextElement();
if (je.getName().equalsIgnoreCase("String_Node_Str")) {
setCompressionType(je.getMethod());
continue;
}
}
jf.close();
switch (mDecodeResources) {
case DECODE_RESOURCES_NONE:
mAndrolib.decodeResourcesRaw(mApkFile,outDir);
break;
case DECODE_RESOURCES_FULL:
mAndrolib.decodeResourcesFull(mApkFile,outDir,getResTable());
break;
}
}
 else {
if (hasManifest()) {
switch (mDecodeResources) {
case DECODE_RESOURCES_NONE:
mAndrolib.decodeManifestRaw(mApkFile,outDir);
break;
case DECODE_RESOURCES_FULL:
mAndrolib.decodeManifestFull(mApkFile,outDir,getResTable());
break;
}
}
}
mAndrolib.decodeRawFiles(mApkFile,outDir);
writeMetaFile();
}
Program: 45699
Project: 45699
Buggy source:
private void writeMetaFile() throws AndrolibException {
  Map<String,Object> meta=new LinkedHashMap<String,Object>();
  meta.put("String_Node_Str",Androlib.getVersion());
  meta.put("String_Node_Str",mApkFile.getName());
  if (mDecodeResources != DECODE_RESOURCES_NONE && (hasManifest() || hasResources())) {
    meta.put("String_Node_Str",Boolean.valueOf(mAndrolib.isFrameworkApk(getResTable())));
    putUsesFramework(meta);
    putSdkInfo(meta);
    putPackageInfo(meta);
  }
  mAndrolib.writeMetaFile(mOutDir,meta);
}

Fixed version (ground truth):
private void writeMetaFile() throws AndrolibException {
  Map<String,Object> meta=new LinkedHashMap<String,Object>();
  meta.put("String_Node_Str",Androlib.getVersion());
  meta.put("String_Node_Str",mApkFile.getName());
  if (mDecodeResources != DECODE_RESOURCES_NONE && (hasManifest() || hasResources())) {
    meta.put("String_Node_Str",Boolean.valueOf(mAndrolib.isFrameworkApk(getResTable())));
    putUsesFramework(meta);
    putSdkInfo(meta);
    putPackageInfo(meta);
    putCompressionInfo(meta);
  }
  mAndrolib.writeMetaFile(mOutDir,meta);
}
Program: 45701
Project: 45701
Buggy source:
@BeforeClass public static void beforeClass() throws BrutException {
  sTmpDir=new ExtFile(OS.createTempDirectory());
  sTestOrigDir=new ExtFile(sTmpDir,"String_Node_Str");
  sTestNewDir=new ExtFile(sTmpDir,"String_Node_Str");
  File testApk=new File(sTmpDir,"String_Node_Str");
  LOGGER.info("String_Node_Str");
  TestUtils.copyResourceDir(BuildAndDecodeTest.class,"String_Node_Str",sTestOrigDir);
  LOGGER.info("String_Node_Str");
  ExtFile blank=null;
  new Androlib().build(sTestOrigDir,testApk,BuildAndDecodeTest.returnStock(),blank,"String_Node_Str");
  LOGGER.info("String_Node_Str");
  ApkDecoder apkDecoder=new ApkDecoder(testApk);
  apkDecoder.setOutDir(sTestNewDir);
  apkDecoder.decode();
}

Fixed version (ground truth):
@BeforeClass public static void beforeClass() throws BrutException, IOException {
  sTmpDir=new ExtFile(OS.createTempDirectory());
  sTestOrigDir=new ExtFile(sTmpDir,"String_Node_Str");
  sTestNewDir=new ExtFile(sTmpDir,"String_Node_Str");
  File testApk=new File(sTmpDir,"String_Node_Str");
  LOGGER.info("String_Node_Str");
  TestUtils.copyResourceDir(BuildAndDecodeTest.class,"String_Node_Str",sTestOrigDir);
  LOGGER.info("String_Node_Str");
  ExtFile blank=null;
  new Androlib().build(sTestOrigDir,testApk,BuildAndDecodeTest.returnStock(),blank,"String_Node_Str");
  LOGGER.info("String_Node_Str");
  ApkDecoder apkDecoder=new ApkDecoder(testApk);
  apkDecoder.setOutDir(sTestNewDir);
  apkDecoder.decode();
}
Program: 45702
Project: 45702
Buggy source:
public void buildApk(File appDir,File outApk,HashMap<String,Boolean> flags) throws AndrolibException {
  LOGGER.info("String_Node_Str");
  if (outApk.exists()) {
    outApk.delete();
  }
 else {
    File outDir=outApk.getParentFile();
    if (outDir != null && !outDir.exists()) {
      outDir.mkdirs();
    }
  }
  File assetDir=new File(appDir,"String_Node_Str");
  if (!assetDir.exists()) {
    assetDir=null;
  }
  mAndRes.aaptPackage(outApk,null,null,new File(appDir,APK_DIRNAME),assetDir,null,flags);
  if (flags.get("String_Node_Str")) {
    try {
      LOGGER.info("String_Node_Str");
      ZipFile editOrig=new ZipFile(mOrigApkFile.getAbsoluteFile());
      ZipParameters parameters=new ZipParameters();
      parameters.setCompressionMethod(Zip4jConstants.COMP_STORE);
      parameters.setCompressionLevel(0);
      parameters.setIncludeRootFolder(true);
      parameters.setRootFolderInZip("String_Node_Str");
      editOrig.addFolder(new File(appDir,APK_DIRNAME + "String_Node_Str").getAbsolutePath(),parameters);
      if (assetDir.exists()) {
      }
      parameters.setFileNameInZip("String_Node_Str");
    }
 catch (    ZipException e) {
      LOGGER.warning(e.getMessage());
    }
  }
}

Fixed version (ground truth):
public void buildApk(File appDir,File outApk,HashMap<String,Boolean> flags) throws AndrolibException {
  LOGGER.info("String_Node_Str");
  if (outApk.exists()) {
    outApk.delete();
  }
 else {
    File outDir=outApk.getParentFile();
    if (outDir != null && !outDir.exists()) {
      outDir.mkdirs();
    }
  }
  File assetDir=new File(appDir,"String_Node_Str");
  if (!assetDir.exists()) {
    assetDir=null;
  }
  mAndRes.aaptPackage(outApk,null,null,new File(appDir,APK_DIRNAME),assetDir,null,flags);
  if (flags.get("String_Node_Str")) {
    try {
      LOGGER.info("String_Node_Str");
      ZipFile editOrig=new ZipFile(mOrigApkFile.getAbsoluteFile());
      ZipParameters parameters=new ZipParameters();
      parameters.setCompressionMethod(Zip4jConstants.COMP_STORE);
      parameters.setCompressionLevel(0);
      parameters.setIncludeRootFolder(true);
      parameters.setRootFolderInZip("String_Node_Str");
      editOrig.addFolder(new File(appDir,APK_DIRNAME + "String_Node_Str").getAbsolutePath(),parameters);
      if (assetDir != null) {
      }
      parameters.setFileNameInZip("String_Node_Str");
    }
 catch (    ZipException ex) {
      throw new AndrolibException(ex);
    }
  }
}
Program: 45703
Project: 45703
Buggy source:
private void decode() throws AndrolibException {
  try {
    baksmali.disassembleDexFile(mApkFile.getAbsolutePath(),new DexFile(mApkFile),false,mOutDir.getAbsolutePath(),null,null,null,false,true,true,true,false,false,mDebug ? main.FULLMERGE : 0,false,mDebug ? true : false,null);
  }
 catch (  IOException ex) {
    throw new AndrolibException(ex);
  }
}

Fixed version (ground truth):
private void decode() throws AndrolibException {
  if (mDebug) {
    ClassPath.dontLoadClassPath=true;
  }
  try {
    baksmali.disassembleDexFile(mApkFile.getAbsolutePath(),new DexFile(mApkFile),false,mOutDir.getAbsolutePath(),null,null,null,false,true,true,true,false,false,mDebug ? main.DIFFPRE : 0,false,false,null);
  }
 catch (  IOException ex) {
    throw new AndrolibException(ex);
  }
}
Program: 45704
Project: 45704
Buggy source:
public String getType() throws AndrolibException {
  if (mItems.length == 0) {
    return null;
  }
  String type=mItems[0].getType();
  if (!"String_Node_Str".equals(type) && !"String_Node_Str".equals(type)) {
    return null;
  }
  for (int i=1; i < mItems.length; i++) {
    if (StringUtils.containsIgnoreCase("String_Node_Str",mItems[i].encodeAsResXmlItemValue()) || mItems[i].getType().equalsIgnoreCase("String_Node_Str")) {
      return "String_Node_Str";
    }
    if (!type.equals(mItems[i].getType())) {
      return null;
    }
  }
  return type;
}

Fixed version (ground truth):
public String getType() throws AndrolibException {
  if (mItems.length == 0) {
    return null;
  }
  String type=mItems[0].getType();
  if (!"String_Node_Str".equals(type) && !"String_Node_Str".equals(type)) {
    return null;
  }
  for (int i=1; i < mItems.length; i++) {
    if (!type.equals(mItems[i].getType())) {
      return null;
    }
  }
  return type;
}
Program: 45705
Project: 45705
Buggy source:
@Test public void valuesArraysTest() throws BrutException {
  compareValuesFiles("String_Node_Str");
}

Fixed version (ground truth):
@Test public void valuesArraysTest() throws BrutException {
  compareValuesFiles("String_Node_Str");
  compareValuesFiles("String_Node_Str");
}
Program: 45708
Project: 45708
Buggy source:
private static List<Integer> findNonPositionalSubstitutions(String str,int max){
  int pos=0;
  int count=0;
  int length=str.length();
  List<Integer> ret=new ArrayList<Integer>();
  while ((pos=str.indexOf('%',pos)) != -1) {
    if (pos + 1 == length) {
      break;
    }
    char c=str.charAt(pos + 1);
    if (c >= 'a' && c <= 'z') {
      ret.add(pos);
      if (max != -1 && ++count >= max) {
        break;
      }
    }
    pos+=2;
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * It searches for "%", but not "%%" nor "%(\d)+\$"
 */
private static List<Integer> findNonPositionalSubstitutions(String str,int max){
  int pos=0;
  int pos2=0;
  int count=0;
  int length=str.length();
  List<Integer> ret=new ArrayList<Integer>();
  while ((pos2=(pos=str.indexOf('%',pos2)) + 1) != 0) {
    if (pos2 == length) {
      break;
    }
    char c=str.charAt(pos2++);
    if (c == '%') {
      continue;
    }
    if (c >= '0' && c <= '9' && pos2 < length) {
      do {
        c=str.charAt(pos2++);
      }
 while (c >= '0' && c <= '9' && pos2 < length);
      if (c == '$') {
        continue;
      }
    }
    ret.add(pos);
    if (max != -1 && ++count >= max) {
      break;
    }
  }
  return ret;
}
Program: 45709
Project: 45709
Buggy source:
public void serializeToResValuesXml(XmlSerializer serializer,ResResource res) throws IOException, AndrolibException {
  String type=res.getResSpec().getType().getName();
  boolean item=!"String_Node_Str".equals(mType) && !type.equals(mType);
  String tagName=item ? "String_Node_Str" : type;
  serializer.startTag(null,tagName);
  if (item) {
    serializer.attribute(null,"String_Node_Str",type);
  }
  serializer.attribute(null,"String_Node_Str",res.getResSpec().getName());
  serializeExtraXmlAttrs(serializer,res);
  String body=encodeAsResXmlValue();
  if (!body.isEmpty()) {
    serializer.ignorableWhitespace(body);
  }
  serializer.endTag(null,tagName);
}

Fixed version (ground truth):
public void serializeToResValuesXml(XmlSerializer serializer,ResResource res) throws IOException, AndrolibException {
  String type=res.getResSpec().getType().getName();
  boolean item=!"String_Node_Str".equals(mType) && !type.equals(mType);
  String body=encodeAsResXmlValue();
  if (body.contains("String_Node_Str")) {
    item=true;
  }
  String tagName=item ? "String_Node_Str" : type;
  serializer.startTag(null,tagName);
  if (item) {
    serializer.attribute(null,"String_Node_Str",type);
  }
  serializer.attribute(null,"String_Node_Str",res.getResSpec().getName());
  serializeExtraXmlAttrs(serializer,res);
  if (!body.isEmpty()) {
    serializer.ignorableWhitespace(body);
  }
  serializer.endTag(null,tagName);
}
Program: 45710
Project: 45710
Buggy source:
private static List<Integer> findNonPositionalSubstitutions(String str,int max){
  int pos=0;
  int count=0;
  List<Integer> ret=new ArrayList<Integer>();
  while ((pos=str.indexOf('%',pos)) != -1) {
    if (str.charAt(pos + 1) != '%') {
      ret.add(pos);
      if (max != -1 && ++count >= max) {
        break;
      }
    }
    pos+=2;
  }
  return ret;
}

Fixed version (ground truth):
private static List<Integer> findNonPositionalSubstitutions(String str,int max){
  int pos=0;
  int count=0;
  int length=str.length();
  List<Integer> ret=new ArrayList<Integer>();
  while ((pos=str.indexOf('%',pos)) != -1) {
    if (pos + 1 == length) {
      break;
    }
    if (str.charAt(pos + 1) != '%') {
      ret.add(pos);
      if (max != -1 && ++count >= max) {
        break;
      }
    }
    pos+=2;
  }
  return ret;
}
Program: 45711
Project: 45711
Buggy source:
private void find9patchChunk(DataInput di) throws AndrolibException, IOException {
  di.skipBytes(8);
  while (true) {
    int size;
    try {
      size=di.readInt();
    }
 catch (    IOException ex) {
      throw new AndrolibException("String_Node_Str",ex);
    }
    if (di.readInt() == NP_CHUNK_TYPE) {
      return;
    }
    di.skipBytes(size + 4);
  }
}

Fixed version (ground truth):
private void find9patchChunk(DataInput di) throws AndrolibException, IOException {
  di.skipBytes(8);
  while (true) {
    int size;
    try {
      size=di.readInt();
    }
 catch (    IOException ex) {
      throw new CantFind9PatchChunk("String_Node_Str",ex);
    }
    if (di.readInt() == NP_CHUNK_TYPE) {
      return;
    }
    di.skipBytes(size + 4);
  }
}
Program: 45712
Project: 45712
Buggy source:
private void addMissingResSpecs() throws AndrolibException {
  int resId=mResId & 0xffff0000;
  for (int i=0; i < mMissingResSpecs.length; i++) {
    if (!mMissingResSpecs[i]) {
      continue;
    }
    ResResSpec spec=new ResResSpec(new ResID(resId | i),String.format("String_Node_Str",i),mPkg,mType);
    mPkg.addResSpec(spec);
    mType.addResSpec(spec);
    ResValue value=new ResBoolValue(false);
    ResResource res=new ResResource(mPkg.getConfig(new ResConfigFlags()),spec,value);
    mPkg.addResource(res);
    mConfig.addResource(res);
    spec.addResource(res);
  }
}

Fixed version (ground truth):
private void addMissingResSpecs() throws AndrolibException {
  int resId=mResId & 0xffff0000;
  for (int i=0; i < mMissingResSpecs.length; i++) {
    if (!mMissingResSpecs[i]) {
      continue;
    }
    ResResSpec spec=new ResResSpec(new ResID(resId | i),String.format("String_Node_Str",i),mPkg,mType);
    mPkg.addResSpec(spec);
    mType.addResSpec(spec);
    ResValue value=new ResBoolValue(false);
    ResResource res=new ResResource(mPkg.getOrCreateConfig(new ResConfigFlags()),spec,value);
    mPkg.addResource(res);
    mConfig.addResource(res);
    spec.addResource(res);
  }
}
Program: 45713
Project: 45713
Buggy source:
public boolean buildResourcesFull(File appDir,boolean forceBuildAll,boolean framework,Map<String,Object> usesFramework) throws AndrolibException {
  try {
    if (!new File(appDir,"String_Node_Str").exists()) {
      return false;
    }
    if (!forceBuildAll) {
      LOGGER.info("String_Node_Str");
    }
    File apkDir=new File(appDir,APK_DIRNAME);
    if (forceBuildAll || isModified(newFiles(APP_RESOURCES_FILENAMES,appDir),newFiles(APK_RESOURCES_FILENAMES,apkDir))) {
      LOGGER.info("String_Node_Str");
      File apkFile=File.createTempFile("String_Node_Str",null);
      apkFile.delete();
      File ninePatch=new File(appDir,"String_Node_Str");
      if (!ninePatch.exists()) {
        ninePatch=null;
      }
      mAndRes.aaptPackage(apkFile,new File(appDir,"String_Node_Str"),new File(appDir,"String_Node_Str"),ninePatch,null,parseUsesFramework(usesFramework),false,framework);
      new ExtFile(apkFile).getDirectory().copyToDir(apkDir,APK_RESOURCES_FILENAMES);
    }
    return true;
  }
 catch (  IOException ex) {
    throw new AndrolibException(ex);
  }
catch (  DirectoryException ex) {
    throw new AndrolibException(ex);
  }
}

Fixed version (ground truth):
public boolean buildResourcesFull(File appDir,boolean forceBuildAll,boolean framework,Map<String,Object> usesFramework) throws AndrolibException {
  try {
    if (!new File(appDir,"String_Node_Str").exists()) {
      return false;
    }
    if (!forceBuildAll) {
      LOGGER.info("String_Node_Str");
    }
    File apkDir=new File(appDir,APK_DIRNAME);
    if (forceBuildAll || isModified(newFiles(APP_RESOURCES_FILENAMES,appDir),newFiles(APK_RESOURCES_FILENAMES,apkDir))) {
      LOGGER.info("String_Node_Str");
      File apkFile=File.createTempFile("String_Node_Str",null);
      apkFile.delete();
      File ninePatch=new File(appDir,"String_Node_Str");
      if (!ninePatch.exists()) {
        ninePatch=null;
      }
      mAndRes.aaptPackage(apkFile,new File(appDir,"String_Node_Str"),new File(appDir,"String_Node_Str"),ninePatch,null,parseUsesFramework(usesFramework),false,framework);
      Directory tmpDir=new ExtFile(apkFile).getDirectory();
      tmpDir.copyToDir(apkDir,tmpDir.containsDir("String_Node_Str") ? APK_RESOURCES_FILENAMES : APK_RESOURCES_WITHOUT_RES_FILENAMES);
    }
    return true;
  }
 catch (  IOException ex) {
    throw new AndrolibException(ex);
  }
catch (  DirectoryException ex) {
    throw new AndrolibException(ex);
  }
}
Program: 45714
Project: 45714
Buggy source:
public void decode(ResTable resTable,ExtFile apkFile,File outDir) throws AndrolibException {
  Duo<ResFileDecoder,ResAttrDecoder> duo=getResFileDecoder();
  ResFileDecoder fileDecoder=duo.m1;
  ResAttrDecoder attrDecoder=duo.m2;
  attrDecoder.setCurrentPackage(resTable.listMainPackages().iterator().next());
  Directory in, out;
  try {
    in=apkFile.getDirectory();
    out=new FileDirectory(outDir);
    fileDecoder.decode(in,"String_Node_Str",out,"String_Node_Str","String_Node_Str");
    in=in.getDir("String_Node_Str");
    out=out.createDir("String_Node_Str");
  }
 catch (  DirectoryException ex) {
    throw new AndrolibException(ex);
  }
  ExtMXSerializer xmlSerializer=getResXmlSerializer();
  for (  ResPackage pkg : resTable.listMainPackages()) {
    attrDecoder.setCurrentPackage(pkg);
    for (    ResResource res : pkg.listFiles()) {
      fileDecoder.decode(res,in,out);
    }
    for (    ResValuesFile valuesFile : pkg.listValuesFiles()) {
      generateValuesFile(valuesFile,out,xmlSerializer);
    }
    generatePublicXml(pkg,out,xmlSerializer);
  }
}

Fixed version (ground truth):
public void decode(ResTable resTable,ExtFile apkFile,File outDir) throws AndrolibException {
  Duo<ResFileDecoder,ResAttrDecoder> duo=getResFileDecoder();
  ResFileDecoder fileDecoder=duo.m1;
  ResAttrDecoder attrDecoder=duo.m2;
  attrDecoder.setCurrentPackage(resTable.listMainPackages().iterator().next());
  Directory inApk, in=null, out;
  try {
    inApk=apkFile.getDirectory();
    out=new FileDirectory(outDir);
    fileDecoder.decode(inApk,"String_Node_Str",out,"String_Node_Str","String_Node_Str");
    if (inApk.containsDir("String_Node_Str")) {
      in=inApk.getDir("String_Node_Str");
    }
    out=out.createDir("String_Node_Str");
  }
 catch (  DirectoryException ex) {
    throw new AndrolibException(ex);
  }
  ExtMXSerializer xmlSerializer=getResXmlSerializer();
  for (  ResPackage pkg : resTable.listMainPackages()) {
    attrDecoder.setCurrentPackage(pkg);
    for (    ResResource res : pkg.listFiles()) {
      fileDecoder.decode(res,in,out);
    }
    for (    ResValuesFile valuesFile : pkg.listValuesFiles()) {
      generateValuesFile(valuesFile,out,xmlSerializer);
    }
    generatePublicXml(pkg,out,xmlSerializer);
  }
}
Program: 45715
Project: 45715
Buggy source:
private File getFrameworkApk(int id,String frameTag) throws AndrolibException {
  File dir=getFrameworkDir();
  File apk=new File(dir,String.valueOf(id) + '-' + frameTag+ "String_Node_Str");
  if (apk.exists()) {
    return apk;
  }
  apk=new File(dir,String.valueOf(id) + "String_Node_Str");
  if (apk.exists()) {
    return apk;
  }
  if (id == 1) {
    InputStream in=null;
    OutputStream out=null;
    try {
      in=AndrolibResources.class.getResourceAsStream("String_Node_Str");
      out=new FileOutputStream(apk);
      IOUtils.copy(in,out);
      return apk;
    }
 catch (    IOException ex) {
      throw new AndrolibException(ex);
    }
 finally {
      if (in != null) {
        try {
          in.close();
        }
 catch (        IOException ex) {
        }
      }
      if (out != null) {
        try {
          out.close();
        }
 catch (        IOException ex) {
        }
      }
    }
  }
  throw new CantFindFrameworkResException(id);
}

Fixed version (ground truth):
private File getFrameworkApk(int id,String frameTag) throws AndrolibException {
  File dir=getFrameworkDir();
  File apk;
  if (frameTag != null) {
    apk=new File(dir,String.valueOf(id) + '-' + frameTag+ "String_Node_Str");
    if (apk.exists()) {
      return apk;
    }
  }
  apk=new File(dir,String.valueOf(id) + "String_Node_Str");
  if (apk.exists()) {
    return apk;
  }
  if (id == 1) {
    InputStream in=null;
    OutputStream out=null;
    try {
      in=AndrolibResources.class.getResourceAsStream("String_Node_Str");
      out=new FileOutputStream(apk);
      IOUtils.copy(in,out);
      return apk;
    }
 catch (    IOException ex) {
      throw new AndrolibException(ex);
    }
 finally {
      if (in != null) {
        try {
          in.close();
        }
 catch (        IOException ex) {
        }
      }
      if (out != null) {
        try {
          out.close();
        }
 catch (        IOException ex) {
        }
      }
    }
  }
  throw new CantFindFrameworkResException(id);
}
Program: 45716
Project: 45716
Buggy source:
private void inject() throws AndrolibException {
  String definition=nextAndAppend();
  if (definition.contains("String_Node_Str")) {
    nextAndAppend();
    return;
  }
  injectParameters(definition);
  boolean end=false;
  while (!end) {
    end=step();
  }
}

Fixed version (ground truth):
private void inject() throws AndrolibException {
  String definition=nextAndAppend();
  if (definition.contains("String_Node_Str") || definition.contains("String_Node_Str")) {
    nextAndAppend();
    return;
  }
  injectParameters(definition);
  boolean end=false;
  while (!end) {
    end=step();
  }
}
Program: 45717
Project: 45717
Buggy source:
public static Duo<TypeName,Integer> fetchFromInternalName(String internal) throws AndrolibException {
  String origInternal=internal;
  int array=0;
  boolean isArray=false;
  do {
    if (internal.isEmpty()) {
      throw new AndrolibException("String_Node_Str" + origInternal);
    }
    isArray=internal.charAt(0) == '[';
    if (isArray) {
      array++;
      internal=internal.substring(1);
    }
  }
 while (isArray);
  int length=array + 1;
  String package_=null;
  String type=null;
  String innerType=null;
switch (internal.charAt(0)) {
case 'B':
    type="String_Node_Str";
  break;
case 'C':
type="String_Node_Str";
break;
case 'D':
type="String_Node_Str";
break;
case 'F':
type="String_Node_Str";
break;
case 'I':
type="String_Node_Str";
break;
case 'J':
type="String_Node_Str";
break;
case 'S':
type="String_Node_Str";
break;
case 'Z':
type="String_Node_Str";
break;
case 'V':
type="String_Node_Str";
break;
case 'L':
int pos=internal.indexOf(';');
if (pos == -1) {
throw new AndrolibException("String_Node_Str" + origInternal);
}
length+=pos;
internal=internal.substring(1,pos);
pos=internal.lastIndexOf('/');
package_=internal.substring(0,pos).replace('/','.');
type=internal.substring(pos + 1);
pos=type.indexOf('$');
if (pos != -1) {
innerType=type.substring(pos + 1);
type=type.substring(0,pos);
}
break;
default :
throw new AndrolibException("String_Node_Str" + origInternal);
}
return new Duo<TypeName,Integer>(new TypeName(package_,type,innerType,array),length);
}

Fixed version (ground truth):
public static Duo<TypeName,Integer> fetchFromInternalName(String internal) throws AndrolibException {
  String origInternal=internal;
  int array=0;
  boolean isArray=false;
  do {
    if (internal.isEmpty()) {
      throw new AndrolibException("String_Node_Str" + origInternal);
    }
    isArray=internal.charAt(0) == '[';
    if (isArray) {
      array++;
      internal=internal.substring(1);
    }
  }
 while (isArray);
  int length=array + 1;
  String package_=null;
  String type=null;
  String innerType=null;
switch (internal.charAt(0)) {
case 'B':
    type="String_Node_Str";
  break;
case 'C':
type="String_Node_Str";
break;
case 'D':
type="String_Node_Str";
break;
case 'F':
type="String_Node_Str";
break;
case 'I':
type="String_Node_Str";
break;
case 'J':
type="String_Node_Str";
break;
case 'S':
type="String_Node_Str";
break;
case 'Z':
type="String_Node_Str";
break;
case 'V':
type="String_Node_Str";
break;
case 'L':
int pos=internal.indexOf(';');
if (pos == -1) {
throw new AndrolibException("String_Node_Str" + origInternal);
}
length+=pos;
internal=internal.substring(1,pos);
pos=internal.lastIndexOf('/');
if (pos == -1) {
package_="String_Node_Str";
type=internal;
}
 else {
package_=internal.substring(0,pos).replace('/','.');
type=internal.substring(pos + 1);
}
pos=type.indexOf('$');
if (pos != -1) {
innerType=type.substring(pos + 1);
type=type.substring(0,pos);
}
break;
default :
throw new AndrolibException("String_Node_Str" + origInternal);
}
return new Duo<TypeName,Integer>(new TypeName(package_,type,innerType,array),length);
}
Program: 45718
Project: 45718
Buggy source:
public static String escapeForResXml(String value){
  if (value.isEmpty()) {
    return value;
  }
  StringBuilder out=new StringBuilder(value.length() + 10);
  char[] chars=value.toCharArray();
switch (chars[0]) {
case '@':
case '#':
case '?':
    out.append('\\');
}
boolean space=true;
for (int i=0; i < chars.length; i++) {
  char c=chars[i];
  if (c == ' ') {
    if (space) {
      out.append("String_Node_Str");
    }
 else {
      out.append(c);
      space=true;
    }
    continue;
  }
  space=false;
switch (c) {
case '\\':
case '\'':
case '"':
    out.append('\\');
  break;
case '\n':
out.append("String_Node_Str");
continue;
}
out.append(c);
}
if (space) {
out.deleteCharAt(out.length() - 1);
out.append("String_Node_Str");
}
return out.toString();
}

Fixed version (ground truth):
public static String escapeForResXml(String value){
  if (value.isEmpty()) {
    return value;
  }
  StringBuilder out=new StringBuilder(value.length() + 10);
  char[] chars=value.toCharArray();
switch (chars[0]) {
case '@':
case '#':
case '?':
    out.append('\\');
}
boolean space=true;
for (int i=0; i < chars.length; i++) {
  char c=chars[i];
  if (c == ' ') {
    if (space) {
      out.append("String_Node_Str");
    }
 else {
      out.append(c);
      space=true;
    }
    continue;
  }
  space=false;
switch (c) {
case '\\':
case '\'':
case '"':
    out.append('\\');
  break;
case '\n':
out.append("String_Node_Str");
continue;
}
out.append(c);
}
if (space && out.charAt(out.length() - 1) == ' ') {
out.deleteCharAt(out.length() - 1);
out.append("String_Node_Str");
}
return out.toString();
}
Program: 45719
Project: 45719
Buggy source:
public static String escapeForResXml(String value){
  value=value.replace("String_Node_Str","String_Node_Str");
  value=value.replace("String_Node_Str","String_Node_Str");
  char c=value.charAt(0);
  if (c == '@' || c == '#' || c == '?') {
    return '\\' + value;
  }
  return value;
}

Fixed version (ground truth):
public static String escapeForResXml(String value){
  if (value.isEmpty()) {
    return value;
  }
  value=value.replace("String_Node_Str","String_Node_Str");
  value=value.replace("String_Node_Str","String_Node_Str");
  char c=value.charAt(0);
  if (c == '@' || c == '#' || c == '?') {
    return '\\' + value;
  }
  return value;
}
Program: 45720
Project: 45720
Buggy source:
@Override public void setProperty(String name,Object value) throws IllegalArgumentException, IllegalStateException {
  if (PROPERTY_DEFAULT_ENCODING.equals(name)) {
    mDefaultEncoding=(String)value;
  }
  super.setProperty(name,value);
}

Fixed version (ground truth):
@Override public void setProperty(String name,Object value) throws IllegalArgumentException, IllegalStateException {
  if (PROPERTY_DEFAULT_ENCODING.equals(name)) {
    mDefaultEncoding=(String)value;
  }
 else {
    super.setProperty(name,value);
  }
}
Program: 45721
Project: 45721
Buggy source:
public void smali(String dir,String dexFile) throws AndrolibException {
  main.main(new String[]{"String_Node_Str",dir,"String_Node_Str",dexFile});
}

Fixed version (ground truth):
public void smali(String dir,String dexFile) throws AndrolibException {
  main.main(new String[]{dir,"String_Node_Str",dexFile});
}
Program: 45722
Project: 45722
Buggy source:
/** 
 * Returns the last set time to live second.
 * @return the last set time to live second
 */
long getTtl();

Fixed version (ground truth):
/** 
 * Returns the last set time to live in milliseconds.
 * @return the last set time to live in milliseconds.
 */
long getTtl();
Program: 45723
Project: 45723
Buggy source:
@Test public void testMapService(){
  Node node=HazelcastStarter.getNode(hz);
  NodeEngineImpl nodeEngine=node.getNodeEngine();
  SerializationService serializationService=nodeEngine.getSerializationService();
  String key=randomString();
  Data keyData=serializationService.toData(key);
  int partitionId=hz.getPartitionService().getPartition(key).getPartitionId();
  MapService mapService=nodeEngine.getService(MapService.SERVICE_NAME);
  MapServiceContext mapServiceContext=mapService.getMapServiceContext();
  assertNotNull("String_Node_Str",mapServiceContext);
  PartitionContainer partitionContainer=mapServiceContext.getPartitionContainer(partitionId);
  assertNotNull("String_Node_Str",partitionContainer);
  RecordStore recordStore=partitionContainer.getExistingRecordStore("String_Node_Str");
  assertNull("String_Node_Str",recordStore);
  IMap<Object,Object> map=hz.getMap("String_Node_Str");
  map.put(key,23);
  recordStore=partitionContainer.getExistingRecordStore("String_Node_Str");
  assertNotNull("String_Node_Str",recordStore);
  assertEquals("String_Node_Str",1,recordStore.size());
  Object dataValue=recordStore.get(keyData,true,null);
  assertNotNull("String_Node_Str",dataValue);
  int value=serializationService.toObject(dataValue);
  assertEquals("String_Node_Str",23,value);
  assertTrue("String_Node_Str",map.containsKey(key));
  map.clear();
  assertFalse("String_Node_Str",map.containsKey(key));
  map.destroy();
}

Fixed version (ground truth):
@Test public void testMapService(){
  Node node=HazelcastStarter.getNode(hz);
  NodeEngineImpl nodeEngine=node.getNodeEngine();
  SerializationService serializationService=nodeEngine.getSerializationService();
  String key=randomString();
  Data keyData=serializationService.toData(key);
  int partitionId=hz.getPartitionService().getPartition(key).getPartitionId();
  MapService mapService=nodeEngine.getService(MapService.SERVICE_NAME);
  MapServiceContext mapServiceContext=mapService.getMapServiceContext();
  assertNotNull("String_Node_Str",mapServiceContext);
  PartitionContainer partitionContainer=mapServiceContext.getPartitionContainer(partitionId);
  assertNotNull("String_Node_Str",partitionContainer);
  RecordStore recordStore=partitionContainer.getExistingRecordStore("String_Node_Str");
  assertNull("String_Node_Str",recordStore);
  IMap<Object,Object> map=hz.getMap("String_Node_Str");
  map.put(key,23);
  recordStore=partitionContainer.getExistingRecordStore("String_Node_Str");
  assertNotNull("String_Node_Str",recordStore);
  assertEquals("String_Node_Str",1,recordStore.size());
  Object dataValue=recordStore.get(keyData,true,null);
  assertNotNull("String_Node_Str",dataValue);
  Integer value=serializationService.toObject(dataValue);
  assertNotNull("String_Node_Str",value);
  assertEquals("String_Node_Str",23,(int)value);
  assertTrue("String_Node_Str",map.containsKey(key));
  map.clear();
  assertFalse("String_Node_Str",map.containsKey(key));
  map.destroy();
}
Program: 45725
Project: 45725
Buggy source:
@Test public void array_float(){
  assertEquals(new JsonArray().add(3.14f),Json.array(3.14f));
  assertEquals(new JsonArray().add(3.14f).add(1.41f),Json.array(3.14f,1.41f));
}

Fixed version (ground truth):
@Test public void array_float(){
  assertEquals(new JsonArray().add(3.14f),Json.array(new float[]{3.14f}));
  assertEquals(new JsonArray().add(3.14f).add(1.41f),Json.array(new float[]{3.14f,1.41f}));
}
Program: 45726
Project: 45726
Buggy source:
@Test public void array_long(){
  assertEquals(new JsonArray().add(23l),Json.array(23l));
  assertEquals(new JsonArray().add(23l).add(42l),Json.array(23l,42l));
}

Fixed version (ground truth):
@Test public void array_long(){
  assertEquals(new JsonArray().add(23l),Json.array(new long[]{23l}));
  assertEquals(new JsonArray().add(23l).add(42l),Json.array(new long[]{23l,42l}));
}
Program: 45727
Project: 45727
Buggy source:
@Test public void array_int(){
  assertEquals(new JsonArray().add(23),Json.array(23));
  assertEquals(new JsonArray().add(23).add(42),Json.array(23,42));
}

Fixed version (ground truth):
@Test public void array_int(){
  assertEquals(new JsonArray().add(23),Json.array(new int[]{23}));
  assertEquals(new JsonArray().add(23).add(42),Json.array(new int[]{23,42}));
}
Program: 45728
Project: 45728
Buggy source:
@Override public boolean hasNext(){
  while (iterator.hasNext()) {
    nextEntry=iterator.next();
    if (testEntry(nextEntry)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  while (iterator.hasNext()) {
    Map.Entry<K,ReplicatedRecord<K,V>> entry=iterator.next();
    if (testEntry(entry)) {
      nextEntry=entry;
      return true;
    }
  }
  return false;
}