nus-yam/ex-repair huggingface dataset:
Program: 33397
Project: 33397
Buggy source:
@Override public RemoteFileInfo stat(String fullPath){
  final String relativePath=mounter.getMountRelativePath(fullPath,mountPoint);
  final String s3path=getS3path(relativePath);
  final ObjectListing listing;
  final int type;
  listing=getListing(s3path,1,true);
  if (listing.getObjectSummaries().size() == 0) {
    return null;
  }
  final String key;
  key=listing.getObjectSummaries().get(0).getKey();
  if (key.equals(s3path)) {
    type=RemoteFileInfo.TYPE_FILE;
  }
 else   if (key.startsWith(s3path + DELIMITER)) {
    type=RemoteFileInfo.TYPE_DIR;
  }
 else {
    return null;
  }
  return new RemoteFileInfo(relativePath,type);
}

Fixed version (ground truth):
@Override public RemoteFileInfo stat(String fullPath){
  final String relativePath=mounter.getMountRelativePath(fullPath,mountPoint);
  final String s3path=getS3path(relativePath);
  final ObjectListing listing;
  final int type;
  listing=getListing(s3path,1,true);
  if (listing.getObjectSummaries().size() == 0) {
    return null;
  }
  final String key;
  key=listing.getObjectSummaries().get(0).getKey();
  if (key.equals(s3path)) {
    type=RemoteFileInfo.TYPE_FILE;
  }
 else   if (s3path.isEmpty()) {
    type=RemoteFileInfo.TYPE_DIR;
  }
 else   if (key.startsWith(s3path + DELIMITER)) {
    type=RemoteFileInfo.TYPE_DIR;
  }
 else {
    return null;
  }
  return new RemoteFileInfo(relativePath,type);
}
Program: 33398
Project: 33398
Buggy source:
private String getS3path(String path){
  if (s3prefix != null) {
    if (path.isEmpty()) {
      return s3prefix;
    }
 else {
      return s3prefix + DELIMITER + path;
    }
  }
  return path;
}

Fixed version (ground truth):
private String getS3path(String path){
  if (s3prefix != null && !s3prefix.isEmpty()) {
    if (path.isEmpty()) {
      return s3prefix;
    }
 else {
      return s3prefix + DELIMITER + path;
    }
  }
  return path;
}
Program: 33399
Project: 33399
Buggy source:
@Override public Map<String,File> loadDirectory(String fullPath,File location) throws IOException {
  final String relativePath=mounter.getMountRelativePath(fullPath,mountPoint);
  final String s3path=getS3path(relativePath) + DELIMITER;
  ObjectListing listing;
  final Map<String,File> results;
  results=new HashMap<String,File>(100);
  if (location == null) {
    location=File.createTempFile("String_Node_Str","String_Node_Str");
    location.delete();
    location.mkdir();
  }
  listing=getListing(s3path,-1,true);
  for (  String filename : getFilenamesFromListing(listing,s3path)) {
    final String fname=joinPaths(fullPath,filename);
    final File localFile;
    localFile=new File(location,filename);
    localFile.getParentFile().mkdirs();
    copyFileInto(fname,localFile);
    results.put(fname,localFile);
  }
  while (listing.isTruncated()) {
    listing=client.listNextBatchOfObjects(listing);
    for (    String filename : getFilenamesFromListing(listing,s3path)) {
      final String fname=joinPaths(fullPath,filename);
      final File localFile;
      localFile=new File(location,filename);
      localFile.getParentFile().mkdirs();
      copyFileInto(fname,localFile);
      results.put(fname,localFile);
    }
  }
  return results;
}

Fixed version (ground truth):
@Override public Map<String,File> loadDirectory(String fullPath,File location) throws IOException {
  final String relativePath=mounter.getMountRelativePath(fullPath,mountPoint);
  String s3path=getS3path(relativePath);
  ObjectListing listing;
  final Map<String,File> results;
  if (!s3path.isEmpty()) {
    s3path+=DELIMITER;
  }
  results=new HashMap<String,File>(100);
  if (location == null) {
    location=File.createTempFile("String_Node_Str","String_Node_Str");
    location.delete();
    location.mkdir();
  }
  listing=getListing(s3path,-1,true);
  for (  String filename : getFilenamesFromListing(listing,s3path)) {
    final String fname=joinPaths(fullPath,filename);
    final File localFile;
    localFile=new File(location,filename);
    localFile.getParentFile().mkdirs();
    copyFileInto(fname,localFile);
    results.put(fname,localFile);
  }
  while (listing.isTruncated()) {
    listing=client.listNextBatchOfObjects(listing);
    for (    String filename : getFilenamesFromListing(listing,s3path)) {
      final String fname=joinPaths(fullPath,filename);
      final File localFile;
      localFile=new File(location,filename);
      localFile.getParentFile().mkdirs();
      copyFileInto(fname,localFile);
      results.put(fname,localFile);
    }
  }
  return results;
}
Program: 33400
Project: 33400
Buggy source:
@Override public List<RemoteFileInfo> readDir(String fullPath){
  final String relativePath=mounter.getMountRelativePath(fullPath,mountPoint);
  final String s3path=getS3path(relativePath) + DELIMITER;
  final List<RemoteFileInfo> results=new ArrayList<RemoteFileInfo>(100);
  ObjectListing listing;
  listing=getListing(s3path,-1,false);
  for (  String filename : getFilenamesFromListing(listing,s3path)) {
    results.add(new RemoteFileInfo(filename,RemoteFileInfo.TYPE_FILE));
  }
  for (  String dirname : getCommonPrefixFromListing(listing,s3path)) {
    results.add(new RemoteFileInfo(dirname,RemoteFileInfo.TYPE_DIR));
  }
  while (listing.isTruncated()) {
    listing=client.listNextBatchOfObjects(listing);
    for (    String filename : getFilenamesFromListing(listing,s3path)) {
      results.add(new RemoteFileInfo(filename,RemoteFileInfo.TYPE_FILE));
    }
    for (    String dirname : getCommonPrefixFromListing(listing,s3path)) {
      results.add(new RemoteFileInfo(dirname,RemoteFileInfo.TYPE_DIR));
    }
  }
  if (results.size() == 0) {
    return null;
  }
  return results;
}

Fixed version (ground truth):
@Override public List<RemoteFileInfo> readDir(String fullPath){
  final String relativePath=mounter.getMountRelativePath(fullPath,mountPoint);
  String s3path=getS3path(relativePath);
  final List<RemoteFileInfo> results=new ArrayList<RemoteFileInfo>(100);
  ObjectListing listing;
  if (!s3path.isEmpty()) {
    s3path+=DELIMITER;
  }
  listing=getListing(s3path,-1,false);
  for (  String filename : getFilenamesFromListing(listing,s3path)) {
    results.add(new RemoteFileInfo(filename,RemoteFileInfo.TYPE_FILE));
  }
  for (  String dirname : getCommonPrefixFromListing(listing,s3path)) {
    results.add(new RemoteFileInfo(dirname,RemoteFileInfo.TYPE_DIR));
  }
  while (listing.isTruncated()) {
    listing=client.listNextBatchOfObjects(listing);
    for (    String filename : getFilenamesFromListing(listing,s3path)) {
      results.add(new RemoteFileInfo(filename,RemoteFileInfo.TYPE_FILE));
    }
    for (    String dirname : getCommonPrefixFromListing(listing,s3path)) {
      results.add(new RemoteFileInfo(dirname,RemoteFileInfo.TYPE_DIR));
    }
  }
  if (results.size() == 0) {
    return null;
  }
  return results;
}
Program: 33401
Project: 33401
Buggy source:
private List<String> getFilenamesFromListing(ObjectListing listing,String prefix){
  List<String> results=new ArrayList<String>(100);
  for (  S3ObjectSummary summary : listing.getObjectSummaries()) {
    final String key=summary.getKey();
    final String filename;
    filename=key.substring(prefix.length());
    if (filename.length() == 0 || filename.contains(DELIMITER)) {
      throw new RuntimeException("String_Node_Str" + key);
    }
    results.add(filename);
  }
  return results;
}

Fixed version (ground truth):
private List<String> getFilenamesFromListing(ObjectListing listing,String prefix){
  List<String> results=new ArrayList<String>(100);
  for (  S3ObjectSummary summary : listing.getObjectSummaries()) {
    final String key=summary.getKey();
    final String filename;
    filename=key.substring(prefix.length());
    if (filename.length() == 0 || filename.contains(DELIMITER)) {
      log.error("String_Node_Str" + key);
      continue;
    }
    results.add(filename);
  }
  return results;
}
Program: 33402
Project: 33402
Buggy source:
private List<String> getCommonPrefixFromListing(ObjectListing listing,String prefix){
  List<String> results=new ArrayList<String>(100);
  for (  String commonPrefix : listing.getCommonPrefixes()) {
    final String dirname;
    dirname=commonPrefix.substring(prefix.length(),commonPrefix.length() - DELIMITER.length());
    if (dirname.length() == 0 || dirname.contains(DELIMITER)) {
      throw new RuntimeException("String_Node_Str" + commonPrefix);
    }
    results.add(dirname);
  }
  return results;
}

Fixed version (ground truth):
private List<String> getCommonPrefixFromListing(ObjectListing listing,String prefix){
  List<String> results=new ArrayList<String>(100);
  for (  String commonPrefix : listing.getCommonPrefixes()) {
    final String dirname;
    dirname=commonPrefix.substring(prefix.length(),commonPrefix.length() - DELIMITER.length());
    if (dirname.length() == 0 || dirname.contains(DELIMITER)) {
      log.error("String_Node_Str" + commonPrefix);
      continue;
    }
    results.add(dirname);
  }
  return results;
}
Program: 33403
Project: 33403
Buggy source:
public static final synchronized void init(List<Map<String,String>> configData,String root) throws IOException {
  mounter=new RemoteFileSystemMounter(configData,root,false);
}

Fixed version (ground truth):
public static final synchronized void init(List<Map<String,Object>> configData,String root,boolean passthrough) throws IOException {
  mounter=new RemoteFileSystemMounter(configData,root,passthrough);
}
Program: 33404
Project: 33404
Buggy source:
protected CachedFile(RemoteFileInfo info,RemoteFileSystem fs){
  this.info=info;
  this.cachedFS=fs;
  this.fullPath=info.path;
  this.fullPath=this.cachedFS.getMountPoint() + this.fullPath;
}

Fixed version (ground truth):
protected CachedFile(RemoteFileInfo info,RemoteFileSystem fs){
  this.info=info;
  this.topFS=fs;
  this.fullPath=info.path;
}
Program: 33405
Project: 33405
Buggy source:
public long length(){
  File f;
  try {
    f=cachedFS.loadFile(fullPath);
  }
 catch (  IOException e) {
    return 0L;
  }
  return f.length();
}

Fixed version (ground truth):
public long length(){
  File f;
  try {
    f=topFS.loadFile(fullPath);
  }
 catch (  IOException e) {
    return 0L;
  }
  return f.length();
}
Program: 33406
Project: 33406
Buggy source:
public String[] list(){
  final List<RemoteFileInfo> infos;
  final String[] result;
  infos=cachedFS.readDir(fullPath);
  if (infos == null) {
    return null;
  }
  result=new String[infos.size()];
  for (int i=0; i < infos.size(); i++) {
    result[i]=infos.get(i).path;
  }
  return result;
}

Fixed version (ground truth):
public String[] list(){
  final List<RemoteFileInfo> infos;
  final String[] result;
  infos=topFS.readDir(fullPath);
  if (infos == null) {
    return null;
  }
  result=new String[infos.size()];
  for (int i=0; i < infos.size(); i++) {
    result[i]=infos.get(i).path;
  }
  return result;
}
Program: 33407
Project: 33407
Buggy source:
public File loadDirectory() throws IOException {
  final Map<String,File> data;
  data=cachedFS.loadDirectory(fullPath,null);
  return data.get(fullPath);
}

Fixed version (ground truth):
public File loadDirectory() throws IOException {
  final Map<String,File> data;
  data=topFS.loadDirectory(fullPath,null);
  return data.get(fullPath);
}
Program: 33408
Project: 33408
Buggy source:
public static final synchronized CachedFile create(String path){
  CachedFile ret;
  if (mounter == null) {
    try {
      mounter=new RemoteFileSystemMounter(null,"String_Node_Str");
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
  }
  ret=new CachedFile();
  ret.info=null;
  ret.fullPath=path;
  ret.cachedFS=mounter.getCache();
  return ret;
}

Fixed version (ground truth):
public static final synchronized CachedFile create(String path){
  CachedFile ret;
  if (mounter == null) {
    try {
      mounter=new RemoteFileSystemMounter(null,"String_Node_Str",true);
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
  }
  ret=new CachedFile();
  ret.info=null;
  ret.fullPath=path;
  ret.topFS=mounter.getTopFileSystem();
  return ret;
}
Program: 33409
Project: 33409
Buggy source:
public boolean exists(){
  if (info != null) {
    return true;
  }
  info=cachedFS.stat(fullPath);
  if (info == null) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean exists(){
  if (info != null) {
    return true;
  }
  info=topFS.stat(fullPath);
  if (info == null) {
    return false;
  }
  return true;
}
Program: 33410
Project: 33410
Buggy source:
public File loadFile() throws IOException {
  return cachedFS.loadFile(fullPath);
}

Fixed version (ground truth):
public File loadFile() throws IOException {
  return topFS.loadFile(fullPath);
}
Program: 33411
Project: 33411
Buggy source:
public CachedFile[] listFiles(){
  final List<RemoteFileInfo> infos;
  final CachedFile[] result;
  infos=cachedFS.readDir(fullPath);
  if (infos == null) {
    return null;
  }
  result=new CachedFile[infos.size()];
  for (int i=0; i < infos.size(); i++) {
    result[i]=new CachedFile(infos.get(i),cachedFS);
  }
  return result;
}

Fixed version (ground truth):
public CachedFile[] listFiles(){
  final List<RemoteFileInfo> infos;
  final CachedFile[] result;
  infos=topFS.readDir(fullPath);
  if (infos == null) {
    return null;
  }
  result=new CachedFile[infos.size()];
  for (int i=0; i < infos.size(); i++) {
    RemoteFileInfo info=infos.get(i);
    String path=buildPath(fullPath,info.path);
    info.path=path;
    result[i]=new CachedFile(info,topFS);
  }
  return result;
}
Program: 33412
Project: 33412
Buggy source:
@Override public RemoteFileInfo stat(String fullPath){
  final String relativePath=mounter.getMountRelativePath(fullPath,mountPoint);
  return parentFS.stat(fullPath);
}

Fixed version (ground truth):
@Override public RemoteFileInfo stat(String fullPath){
  return parentFS.stat(fullPath);
}
Program: 33413
Project: 33413
Buggy source:
@Override public void copyFileInto(String fullPath,File localFile) throws IOException {
  final String relativePath=mounter.getMountRelativePath(fullPath,mountPoint);
  try {
    final File cachedFile;
    cachedFile=cache.get(fullPath);
    FileUtils.copyFile(cachedFile,localFile);
  }
 catch (  ExecutionException e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
@Override public void copyFileInto(String fullPath,File localFile) throws IOException {
  try {
    final File cachedFile;
    cachedFile=cache.get(fullPath);
    FileUtils.copyFile(cachedFile,localFile);
  }
 catch (  ExecutionException e) {
    throw new IOException(e);
  }
}
Program: 33414
Project: 33414
Buggy source:
@Override public List<RemoteFileInfo> readDir(String fullPath){
  final String relativePath=mounter.getMountRelativePath(fullPath,mountPoint);
  return parentFS.readDir(fullPath);
}

Fixed version (ground truth):
@Override public List<RemoteFileInfo> readDir(String fullPath){
  return parentFS.readDir(fullPath);
}
Program: 33415
Project: 33415
Buggy source:
@Override public File loadFile(String fullPath) throws IOException {
  final String relativePath=mounter.getMountRelativePath(fullPath,mountPoint);
  try {
    return cache.get(fullPath);
  }
 catch (  ExecutionException e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
@Override public File loadFile(String fullPath) throws IOException {
  try {
    return cache.get(fullPath);
  }
 catch (  ExecutionException e) {
    throw new IOException(e);
  }
}
Program: 33416
Project: 33416
Buggy source:
public CachedRemoteFileSystem(Map<String,String> settings,RemoteFileSystem parentFS,RemoteFileSystemMounter mounter) throws IOException {
  final int cacheSize;
  final String cacheDir;
  this.parentFS=parentFS;
  mountPoint=settings.get("String_Node_Str").trim();
  if (!mountPoint.endsWith(DELIMITER)) {
    mountPoint=mountPoint + DELIMITER;
  }
  mountPoint=mounter.getRootMountPoint() + mountPoint;
  mountPoint=mountPoint.replace("String_Node_Str","String_Node_Str");
  this.mounter=mounter;
  cacheDir=settings.get("String_Node_Str").trim();
  localCacheDir=new File(cacheDir);
  localCacheDir.mkdir();
  cacheSize=Integer.valueOf(settings.get("String_Node_Str").trim());
  cache=CacheBuilder.newBuilder().maximumWeight(cacheSize * 1024).weigher(new Weigher<String,File>(){
    public int weigh(    String path,    File cachedFile){
      return (int)(cachedFile.length() / 1024);
    }
  }
).removalListener(new RemovalListener<String,File>(){
    public void onRemoval(    RemovalNotification<String,File> rn){
      removeFile(rn.getValue());
    }
  }
).build(new CacheLoader<String,File>(){
    public File load(    String path) throws Exception {
      return downloadFile(path);
    }
  }
);
  scanExistingFiles();
}

Fixed version (ground truth):
public CachedRemoteFileSystem(Map<String,Object> settings,RemoteFileSystem parentFS,RemoteFileSystemMounter mounter) throws IOException {
  final int cacheSize;
  final String cacheDir;
  this.parentFS=parentFS;
  mountPoint=(String)settings.get("String_Node_Str");
  if (!mountPoint.endsWith(DELIMITER)) {
    mountPoint=mountPoint + DELIMITER;
  }
  mountPoint=mounter.getRootMountPoint() + mountPoint;
  mountPoint=mountPoint.replace("String_Node_Str","String_Node_Str");
  this.mounter=mounter;
  cacheDir=(String)settings.get("String_Node_Str");
  localCacheDir=new File(cacheDir);
  localCacheDir.mkdir();
  cacheSize=(Integer)settings.get("String_Node_Str");
  cache=CacheBuilder.newBuilder().maximumWeight(cacheSize * 1024).weigher(new Weigher<String,File>(){
    public int weigh(    String path,    File cachedFile){
      return (int)(cachedFile.length() / 1024);
    }
  }
).removalListener(new RemovalListener<String,File>(){
    public void onRemoval(    RemovalNotification<String,File> rn){
      removeFile(rn.getValue());
    }
  }
).build(new CacheLoader<String,File>(){
    public File load(    String path) throws Exception {
      return downloadFile(path);
    }
  }
);
  scanExistingFiles();
}
Program: 33417
Project: 33417
Buggy source:
public HDFSRemoteFileSystem(Map<String,String> settings){
}

Fixed version (ground truth):
public HDFSRemoteFileSystem(Map<String,Object> settings){
}
Program: 33418
Project: 33418
Buggy source:
public NoOpRemoteFileSystem(Map<String,String> settings,RemoteFileSystem parent,RemoteFileSystemMounter mounter){
}

Fixed version (ground truth):
public NoOpRemoteFileSystem(Map<String,Object> settings,RemoteFileSystem parent,RemoteFileSystemMounter mounter){
}
Program: 33419
Project: 33419
Buggy source:
@Override public int compare(Map<String,String> o1,Map<String,String> o2){
  int p1;
  int p2;
  p1=Integer.parseInt(o1.get("String_Node_Str"));
  p2=Integer.parseInt(o2.get("String_Node_Str"));
  return p1 - p2;
}

Fixed version (ground truth):
@Override public int compare(Map<String,Object> o1,Map<String,Object> o2){
  int p1;
  int p2;
  p1=(Integer)o1.get("String_Node_Str");
  p2=(Integer)o2.get("String_Node_Str");
  return p1 - p2;
}
Program: 33421
Project: 33421
Buggy source:
public static List<TermCountMessage> marshal(final List<TermCount> termCountList){
  final List<TermCountMessage> ret=Lists.newArrayListWithCapacity(termCountList.size());
  for (  final TermCount termCount : termCountList) {
    ret.add(TermCountMessage.newBuilder().setTerm(ImhotepClientMarshaller.marshal(termCount.getTerm())).setCount(termCount.getCount()).build());
  }
  return ret;
}

Fixed version (ground truth):
public static GroupMultiRemapRule marshal(GroupMultiRemapMessage protoRule){
  final int numSubRules=protoRule.getPositiveGroupCount();
  final RegroupCondition[] conditions=new RegroupCondition[numSubRules];
  final int[] positiveGroups=new int[numSubRules];
  for (int ix=0; ix < numSubRules; ix++) {
    positiveGroups[ix]=protoRule.getPositiveGroup(ix);
    conditions[ix]=marshal(protoRule.getCondition(ix));
  }
  return new GroupMultiRemapRule(protoRule.getTargetGroup(),protoRule.getNegativeGroup(),positiveGroups,conditions);
}
Program: 33423
Project: 33423
Buggy source:
private void pollUrgent() throws IOException {
{
    int u=0;
    long startNanos=System.nanoTime();
    for (byte[] urgentMessage; null != (urgentMessage=sts.writeUrgentMessages.poll()); ) {
      sws.wire.write(urgentMessage,0,urgentMessage.length,0);
      u+=1;
    }
    if (0 < u) {
      NL.nl.message("String_Node_Str","String_Node_Str",u,((System.nanoTime() - startNanos) / 1000) / 1000.f);
    }
  }
}

Fixed version (ground truth):
private void pollUrgent() throws IOException {
{
    int u=0;
    long startNanos=System.nanoTime();
    for (byte[] urgentMessage; null != (urgentMessage=sts.writeUrgentMessages.poll()); ) {
      sws.wire.write(urgentMessage,0,urgentMessage.length,0);
      u+=1;
    }
    if (0 < u) {
      NL.nl.metric("String_Node_Str",System.nanoTime() - startNanos,TimeUnit.NANOSECONDS);
    }
  }
}
Program: 33424
Project: 33424
Buggy source:
private void rotateWindows(long nanos){
  int n=countWindowsMs.length;
  for (int i=0; i < n; ++i) {
    if (TimeUnit.MILLISECONDS.toNanos(countWindowsMs[i]) < nanos - windowStartNanos[i]) {
      windows[i]=0L;
      windowStartNanos[i]=nanos;
    }
  }
}

Fixed version (ground truth):
private void rotateWindows(long nanos){
  int n=countWindowsMs.length;
  for (int i=0; i < n; ++i) {
    if (TimeUnit.MILLISECONDS.toNanos(countWindowsMs[i]) < nanos - windowStartNanos[i]) {
      previousWindows[i]=windows[i];
      windows[i]=0L;
      windowStartNanos[i]=nanos;
    }
  }
}
Program: 33425
Project: 33425
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Intent intent=getIntent();
  flipId=Id.valueOf(intent.getData().getPath());
  String action=intent.getAction();
  boolean startRecording;
  if (Intent.ACTION_VIEW.equals(action)) {
    startRecording=false;
  }
 else   if (ACTION_RECORD.equals(action)) {
    setIntro();
    startRecording=true;
  }
 else {
    throw new IllegalArgumentException();
  }
  ActionBar actionBar=getActionBar();
  actionBar.setDisplayHomeAsUpEnabled(true);
  actionBar.setHomeButtonEnabled(true);
  setContentView(R.layout.activity_flip);
  flip=(Flip)getApplication();
  flipAdapter=new FlipAdapter();
  viewPager=(ViewPager)findViewById(R.id.pager);
  viewPager.setAdapter(flipAdapter);
  viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener(){
    @Override public void onPageSelected(    int i){
switch (i) {
case 0:
        stopRecording();
      break;
case 1:
    startRecording();
  break;
default :
throw new IllegalArgumentException();
}
}
@Override public void onPageScrolled(int i,float v,int i1){
}
@Override public void onPageScrollStateChanged(int i){
}
}
);
if (startRecording) {
viewPager.setCurrentItem(1,false);
}
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Intent intent=getIntent();
  flipId=Id.valueOf(intent.getData().getPath());
  String action=intent.getAction();
  boolean startRecording;
  if (Intent.ACTION_VIEW.equals(action)) {
    startRecording=false;
  }
 else   if (ACTION_RECORD.equals(action)) {
    startRecording=true;
  }
 else {
    throw new IllegalArgumentException();
  }
  ActionBar actionBar=getActionBar();
  actionBar.setDisplayHomeAsUpEnabled(true);
  actionBar.setHomeButtonEnabled(true);
  setContentView(R.layout.activity_flip);
  flip=(Flip)getApplication();
  flipAdapter=new FlipAdapter();
  viewPager=(ViewPager)findViewById(R.id.pager);
  viewPager.setAdapter(flipAdapter);
  viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener(){
    @Override public void onPageSelected(    int i){
switch (i) {
case 0:
        stopRecording();
      break;
case 1:
    startRecording();
  break;
default :
throw new IllegalArgumentException();
}
}
@Override public void onPageScrolled(int i,float v,int i1){
}
@Override public void onPageScrollStateChanged(int i){
}
}
);
if (startRecording) {
viewPager.setCurrentItem(1,false);
}
}
Program: 33426
Project: 33426
Buggy source:
private void evalBinder(){
  boolean connect;
  if (View.VISIBLE == getWindowVisibility()) {
    if (View.VISIBLE == getVisibility()) {
      boolean visible=true;
      for (ViewParent p=getParent(); visible && p instanceof View; p=p.getParent()) {
        visible&=View.VISIBLE == ((View)p).getVisibility();
      }
      connect=visible;
    }
 else {
      connect=false;
    }
  }
 else {
    connect=false;
  }
  if (connect) {
    liftedRxLifecycleBinder.connect(this);
  }
 else {
    liftedRxLifecycleBinder.disconnect();
  }
}

Fixed version (ground truth):
/** 
 * calls either #connect or #disconnect on the binder, depending on the view state. Call this after a change to the view state. 
 */
private void evalBinder(){
  if (liftedRxLifecycleBinder.isClosed()) {
    return;
  }
  boolean connect;
  if (View.VISIBLE == getWindowVisibility()) {
    if (View.VISIBLE == getVisibility()) {
      boolean visible=true;
      for (ViewParent p=getParent(); visible && p instanceof View; p=p.getParent()) {
        visible&=View.VISIBLE == ((View)p).getVisibility();
      }
      connect=visible;
    }
 else {
      connect=false;
    }
  }
 else {
    connect=false;
  }
  if (connect) {
    liftedRxLifecycleBinder.connect(this);
  }
 else {
    liftedRxLifecycleBinder.disconnect();
  }
}
Program: 33427
Project: 33427
Buggy source:
private void updateIndefinitely(View view,Observable<FlipInfoViewModel> flipInfoVmSource,Observable<FlipViewModel> flipVmSource){
  ImageView imageView=(ImageView)view.findViewById(R.id.image);
  final TextView shortIntroView=(TextView)view.findViewById(R.id.short_intro);
  imageView.reset();
  Observable<ImageViewModel> imageVmSource=new LoadingImageVmSource(NextopAndroid.getActive(view),3000,flipVmSource).out;
  imageVmSource.subscribe(new ImageView.Updater(imageView,null,ImageView.Transition.instantHold()));
  Observable<String> shortIntroSource=flipInfoVmSource.map(new Func1<FlipInfoViewModel,String>(){
    @Override public String call(    FlipInfoViewModel flipInfoVm){
      return flipInfoVm.intro;
    }
  }
);
  shortIntroSource.subscribe(new Action1<String>(){
    @Override public void call(    String intro){
      shortIntroView.setText(intro);
    }
  }
);
}

Fixed version (ground truth):
private void updateIndefinitely(RxViewGroup rxVg,View view,Observable<FlipInfoViewModel> flipInfoVmSource,Observable<FlipViewModel> flipVmSource){
  ImageView imageView=(ImageView)view.findViewById(R.id.image);
  final TextView shortIntroView=(TextView)view.findViewById(R.id.short_intro);
  imageView.reset();
  Observable<ImageViewModel> imageVmSource=new LoadingImageVmSource(NextopAndroid.getActive(view),3000,flipVmSource).out;
  rxVg.bind(imageVmSource).subscribe(new ImageView.Updater(imageView,null,ImageView.Transition.instantHold()));
  Observable<String> shortIntroSource=flipInfoVmSource.map(new Func1<FlipInfoViewModel,String>(){
    @Override public String call(    FlipInfoViewModel flipInfoVm){
      return flipInfoVm.intro;
    }
  }
);
  shortIntroSource.subscribe(new Action1<String>(){
    @Override public void call(    String intro){
      shortIntroView.setText(intro);
    }
  }
);
}
Program: 33428
Project: 33428
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  if (null == convertView) {
    convertView=LayoutInflater.from(parent.getContext()).inflate(R.layout.view_feed_tile,parent,false);
    @Nullable RxViewGroup rxVg=(RxViewGroup)convertView.findViewWithTag(RxViewGroup.TAG);
    if (null != rxVg) {
      rxVg.cascadeDispose(MainActivity.this);
    }
  }
  Id flipId=getItem(position);
  @Nullable RxViewGroup rxVg=(RxViewGroup)convertView.findViewWithTag(RxViewGroup.TAG);
  if (null != rxVg) {
    if (rxVg.reset(flipId)) {
      updateIndefinitely(convertView,rxVg.bind(flip.getFlipInfoVmm().get(flipId)),rxVg.bind(flip.getFlipVmm().get(flipId)));
    }
  }
 else {
    updateIndefinitely(convertView,flip.getFlipInfoVmm().peek(flipId),flip.getFlipVmm().peek(flipId));
  }
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  if (null == convertView) {
    convertView=LayoutInflater.from(parent.getContext()).inflate(R.layout.view_feed_tile,parent,false);
    @Nullable RxViewGroup rxVg=(RxViewGroup)convertView.findViewWithTag(RxViewGroup.TAG);
    if (null != rxVg) {
      rxVg.cascadeDispose(MainActivity.this);
    }
  }
  Id flipId=getItem(position);
  RxViewGroup rxVg=(RxViewGroup)convertView.findViewWithTag(RxViewGroup.TAG);
  if (null == rxVg) {
    throw new IllegalStateException();
  }
  if (rxVg.reset(flipId)) {
    updateIndefinitely(rxVg,convertView,rxVg.bind(flip.getFlipInfoVmm().get(flipId)),rxVg.bind(flip.getFlipVmm().get(flipId)));
  }
  return convertView;
}
Program: 33429
Project: 33429
Buggy source:
public int size(){
  return flipIds.size();
}

Fixed version (ground truth):
public int size(){
  return 100 * flipIds.size();
}
Program: 33430
Project: 33430
Buggy source:
public Id getFlipId(int index){
  return flipIds.get(index);
}

Fixed version (ground truth):
public Id getFlipId(int index){
  return flipIds.get(index % flipIds.size());
}
Program: 33431
Project: 33431
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  if (null == convertView) {
    convertView=LayoutInflater.from(parent.getContext()).inflate(R.layout.view_flip_frame,parent,false);
  }
  convertView.getLayoutParams().height=targetHeight;
  final Id frameId=getItem(position);
  final RxViewGroup rxVg=(RxViewGroup)convertView.findViewWithTag(RxViewGroup.TAG);
  if (null != rxVg) {
    rxVg.reset();
    updateIndefinitely(convertView,rxVg.bind(demo.getFlipVmm().get(flipId).map(new Func1<FlipViewModel,FrameViewModel>(){
      @Override public FrameViewModel call(      FlipViewModel flipVm){
        return flipVm.frameVms.get(frameId);
      }
    }
)));
  }
 else {
    updateIndefinitely(convertView,demo.getFlipVmm().peek(flipId).map(new Func1<FlipViewModel,FrameViewModel>(){
      @Override public FrameViewModel call(      FlipViewModel flipVm){
        return flipVm.frameVms.get(frameId);
      }
    }
));
  }
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  if (null == convertView) {
    convertView=LayoutInflater.from(parent.getContext()).inflate(R.layout.view_flip_frame,parent,false);
    @Nullable RxViewGroup rxVg=(RxViewGroup)convertView.findViewWithTag(RxViewGroup.TAG);
    if (null != rxVg) {
      rxVg.cascadeDispose(FlipFragment.this);
    }
  }
  convertView.getLayoutParams().height=targetHeight;
  final Id frameId=getItem(position);
  @Nullable RxViewGroup rxVg=(RxViewGroup)convertView.findViewWithTag(RxViewGroup.TAG);
  if (null != rxVg) {
    rxVg.reset();
    updateIndefinitely(convertView,rxVg.bind(demo.getFlipVmm().get(flipId).map(new Func1<FlipViewModel,FrameViewModel>(){
      @Override public FrameViewModel call(      FlipViewModel flipVm){
        return flipVm.frameVms.get(frameId);
      }
    }
)));
  }
 else {
    updateIndefinitely(convertView,demo.getFlipVmm().peek(flipId).map(new Func1<FlipViewModel,FrameViewModel>(){
      @Override public FrameViewModel call(      FlipViewModel flipVm){
        return flipVm.frameVms.get(frameId);
      }
    }
));
  }
  return convertView;
}
Program: 33433
Project: 33433
Buggy source:
private void updateIndefinitely(View view,Observable<FlipInfoViewModel> flipInfoVmSource,Observable<FlipViewModel> flipVmSource){
  ImageView imageView=(ImageView)view.findViewById(R.id.image);
  final TextView shortIntroView=(TextView)view.findViewById(R.id.short_intro);
  final Subscription[] HACK=new Subscription[1];
  Observable<ImageViewModel> imageVmSource=flipVmSource.take(1).repeat(AndroidSchedulers.mainThread()).delay(100,TimeUnit.MILLISECONDS,AndroidSchedulers.mainThread()).flatMap(new Func1<FlipViewModel,Observable<ImageViewModel>>(){
    @Override public Observable<ImageViewModel> call(    FlipViewModel flipVm){
      int n=flipVm.size();
      if (0 < n) {
        for (int i=0; i < n; ++i) {
          FrameViewModel frameVm=flipVm.getFrameVm(flipVm.getFrameId(i));
          if (frameVm.imageVm.uploadProgress < 1.f) {
            return Observable.just(frameVm.imageVm);
          }
        }
        return Observable.just(flipVm.getFrameVm(flipVm.getFrameId(0)).imageVm);
      }
 else {
        AndroidSchedulers.mainThread().createWorker().schedule(new Action0(){
          @Override public void call(){
            HACK[0].unsubscribe();
          }
        }
);
        return Observable.empty();
      }
    }
  }
).distinctUntilChanged();
  HACK[0]=imageVmSource.subscribe(new ImageView.Updater(imageView));
  Observable<String> shortIntroSource=flipInfoVmSource.map(new Func1<FlipInfoViewModel,String>(){
    @Override public String call(    FlipInfoViewModel flipInfoVm){
      return flipInfoVm.intro;
    }
  }
);
  shortIntroSource.subscribe(new Action1<String>(){
    @Override public void call(    String intro){
      shortIntroView.setText(intro);
    }
  }
);
}

Fixed version (ground truth):
private void updateIndefinitely(View view,Observable<FlipInfoViewModel> flipInfoVmSource,Observable<FlipViewModel> flipVmSource){
  ImageView imageView=(ImageView)view.findViewById(R.id.image);
  final TextView shortIntroView=(TextView)view.findViewById(R.id.short_intro);
  Observable<ImageViewModel> imageVmSource=flipVmSource.flatMap(new Func1<FlipViewModel,Observable<ImageViewModel>>(){
    @Override public Observable<ImageViewModel> call(    FlipViewModel flipVm){
      int n=flipVm.size();
      if (0 < n) {
        for (int i=0; i < n; ++i) {
          FrameViewModel frameVm=flipVm.getFrameVm(flipVm.getFrameId(i));
          if (frameVm.imageVm.uploadProgress < 1.f) {
            return Observable.just(frameVm.imageVm);
          }
        }
        return Observable.just(flipVm.getFrameVm(flipVm.getFrameId(0)).imageVm);
      }
 else {
        return Observable.empty();
      }
    }
  }
).distinctUntilChanged();
  imageVmSource.subscribe(new ImageView.Updater(imageView));
  Observable<String> shortIntroSource=flipInfoVmSource.map(new Func1<FlipInfoViewModel,String>(){
    @Override public String call(    FlipInfoViewModel flipInfoVm){
      return flipInfoVm.intro;
    }
  }
);
  shortIntroSource.subscribe(new Action1<String>(){
    @Override public void call(    String intro){
      shortIntroView.setText(intro);
    }
  }
);
}
Program: 33434
Project: 33434
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  convertView=LayoutInflater.from(parent.getContext()).inflate(R.layout.view_feed_tile,parent,false);
  Id flipId=getItem(position);
  final RxViewGroup rxVg=(RxViewGroup)convertView.findViewWithTag(RxViewGroup.TAG);
  if (null != rxVg) {
    rxVg.reset();
    updateIndefinitely(convertView,rxVg.bind(demo.getFlipInfoVmm().get(flipId)),rxVg.bind(demo.getFlipVmm().get(flipId)));
  }
 else {
    updateIndefinitely(convertView,demo.getFlipInfoVmm().peek(flipId),demo.getFlipVmm().peek(flipId));
  }
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  if (null == convertView) {
    convertView=LayoutInflater.from(parent.getContext()).inflate(R.layout.view_feed_tile,parent,false);
    @Nullable RxViewGroup rxVg=(RxViewGroup)convertView.findViewWithTag(RxViewGroup.TAG);
    if (null != rxVg) {
      rxVg.cascadeDispose(MainActivity.this);
    }
  }
  Id flipId=getItem(position);
  @Nullable RxViewGroup rxVg=(RxViewGroup)convertView.findViewWithTag(RxViewGroup.TAG);
  if (null != rxVg) {
    rxVg.reset();
    updateIndefinitely(convertView,rxVg.bind(demo.getFlipInfoVmm().get(flipId)),rxVg.bind(demo.getFlipVmm().get(flipId)));
  }
 else {
    updateIndefinitely(convertView,demo.getFlipInfoVmm().peek(flipId),demo.getFlipVmm().peek(flipId));
  }
  return convertView;
}
Program: 33435
Project: 33435
Buggy source:
@Override public void onLoadFinished(Loader<Object> loader,Object o){
  Log.i(LoaderSpinnerProgressDialogFragmentExamplesActivity.class.getSimpleName(),"String_Node_Str");
  getSupportLoaderManager().destroyLoader(loader.getId());
  Fragment fragment=getSupportFragmentManager().findFragmentByTag(ProgressDialogFragment.TAG);
  if (fragment != null) {
    ProgressDialogFragment dialogFragment=(ProgressDialogFragment)fragment;
    dialogFragment.dismiss();
  }
}

Fixed version (ground truth):
@Override public void onLoadFinished(Loader<Object> loader,Object o){
  Log.i(LoaderSpinnerProgressDialogFragmentExamplesActivity.class.getSimpleName(),"String_Node_Str");
  getSupportLoaderManager().destroyLoader(loader.getId());
  Fragment fragment=getSupportFragmentManager().findFragmentByTag(ProgressDialogFragment.TAG);
  if (fragment != null) {
    ProgressDialogFragment dialogFragment=(ProgressDialogFragment)fragment;
    dialogFragment.dismissAllowingStateLoss();
  }
}
Program: 33436
Project: 33436
Buggy source:
@Override public void onLoaderReset(Loader<Object> loader){
  Log.i(LoaderSpinnerProgressDialogFragmentExamplesActivity.class.getSimpleName(),"String_Node_Str");
  getSupportLoaderManager().destroyLoader(loader.getId());
  Fragment fragment=getSupportFragmentManager().findFragmentByTag(ProgressDialogFragment.TAG);
  if (fragment != null) {
    ProgressDialogFragment dialogFragment=(ProgressDialogFragment)fragment;
    dialogFragment.dismiss();
  }
}

Fixed version (ground truth):
@Override public void onLoaderReset(Loader<Object> loader){
  Log.i(LoaderSpinnerProgressDialogFragmentExamplesActivity.class.getSimpleName(),"String_Node_Str");
  getSupportLoaderManager().destroyLoader(loader.getId());
  Fragment fragment=getSupportFragmentManager().findFragmentByTag(ProgressDialogFragment.TAG);
  if (fragment != null) {
    ProgressDialogFragment dialogFragment=(ProgressDialogFragment)fragment;
    dialogFragment.dismissAllowingStateLoss();
  }
}
Program: 33437
Project: 33437
Buggy source:
@Override public void onLoadFinished(Loader<Object> objectLoader,Object o){
  Log.i(LoaderSpinnerProgressDialogFragmentExamplesFragment.class.getSimpleName(),"String_Node_Str");
  getLoaderManager().destroyLoader(objectLoader.getId());
  Fragment fragment=getChildFragmentManager().findFragmentByTag(ProgressDialogFragment.TAG);
  if (fragment != null) {
    ProgressDialogFragment dialogFragment=(ProgressDialogFragment)fragment;
    dialogFragment.dismiss();
  }
}

Fixed version (ground truth):
@Override public void onLoadFinished(Loader<Object> objectLoader,Object o){
  Log.i(LoaderSpinnerProgressDialogFragmentExamplesFragment.class.getSimpleName(),"String_Node_Str");
  getLoaderManager().destroyLoader(objectLoader.getId());
  Fragment fragment=getChildFragmentManager().findFragmentByTag(ProgressDialogFragment.TAG);
  if (fragment != null) {
    ProgressDialogFragment dialogFragment=(ProgressDialogFragment)fragment;
    dialogFragment.dismissAllowingStateLoss();
  }
}
Program: 33438
Project: 33438
Buggy source:
@Override public void onLoaderReset(Loader<Object> objectLoader){
  Log.i(LoaderSpinnerProgressDialogFragmentExamplesFragment.class.getSimpleName(),"String_Node_Str");
  getLoaderManager().destroyLoader(objectLoader.getId());
  Fragment fragment=getChildFragmentManager().findFragmentByTag(ProgressDialogFragment.TAG);
  if (fragment != null) {
    ProgressDialogFragment dialogFragment=(ProgressDialogFragment)fragment;
    dialogFragment.dismiss();
  }
}

Fixed version (ground truth):
@Override public void onLoaderReset(Loader<Object> objectLoader){
  Log.i(LoaderSpinnerProgressDialogFragmentExamplesFragment.class.getSimpleName(),"String_Node_Str");
  getLoaderManager().destroyLoader(objectLoader.getId());
  Fragment fragment=getChildFragmentManager().findFragmentByTag(ProgressDialogFragment.TAG);
  if (fragment != null) {
    ProgressDialogFragment dialogFragment=(ProgressDialogFragment)fragment;
    dialogFragment.dismissAllowingStateLoss();
  }
}
Program: 33439
Project: 33439
Buggy source:
private JobRecord(Key key,Job<?> jobInstance,JobSetting[] settings){
  this(key,key,null,null,jobInstance,false,settings);
  if (queueSettings.getOnBackend() == null) {
    ModulesService modulesService=ModulesServiceFactory.getModulesService();
    String currentModule=modulesService.getCurrentModule();
    if (queueSettings.getOnModule() == null) {
      queueSettings.setOnModule(currentModule);
      queueSettings.setModuleVersion(modulesService.getCurrentVersion());
    }
 else     if (queueSettings.getOnModule().equals(currentModule)) {
      queueSettings.setModuleVersion(modulesService.getCurrentVersion());
    }
 else {
      String version=modulesService.getDefaultVersion(queueSettings.getOnModule());
      queueSettings.setModuleVersion(version);
    }
  }
  rootJobDisplayName=jobInstance.getJobDisplayName();
}

Fixed version (ground truth):
private JobRecord(Key key,Job<?> jobInstance,JobSetting[] settings){
  this(key,key,null,null,jobInstance,false,settings);
  rootJobDisplayName=jobInstance.getJobDisplayName();
}
Program: 33440
Project: 33440
Buggy source:
/** 
 * Reverses the operation performed by  {@link #serlializeValue(PipelineModelObject,Object)}.
 * @param model The model that is associated with the serialized version.
 * @param serliazedVersion The serialized version of an object.
 * @return The deserialized version of the object.
 * @throws IOException if any problem occurs
 */
Object deserializeValue(PipelineModelObject model,Object serliazedVersion) throws IOException ;

Fixed version (ground truth):
/** 
 * Reverses the operation performed by  {@link #serializeValue(PipelineModelObject,Object)}.
 * @param model The model that is associated with the serialized version.
 * @param serializedVersion The serialized version of an object.
 * @return The deserialized version of the object.
 * @throws IOException if any problem occurs
 */
Object deserializeValue(PipelineModelObject model,Object serializedVersion) throws IOException ;
Program: 33441
Project: 33441
Buggy source:
@Override public Entity toEntity(){
  Entity entity=toProtoEntity();
  entity.setUnindexedProperty(FILLED_PROPERTY,filled);
  if (null != fillTime) {
    entity.setUnindexedProperty(FILL_TIME_PROPERTY,fillTime);
  }
  if (null != sourceJobKey) {
    entity.setProperty(SOURCE_JOB_KEY_PROPERTY,sourceJobKey);
  }
  try {
    entity.setUnindexedProperty(VALUE_PROPERTY,PipelineManager.getBackEnd().serlializeValue(this,value));
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  entity.setProperty(WAITING_ON_ME_PROPERTY,waitingOnMeKeys);
  return entity;
}

Fixed version (ground truth):
@Override public Entity toEntity(){
  Entity entity=toProtoEntity();
  entity.setUnindexedProperty(FILLED_PROPERTY,filled);
  if (null != fillTime) {
    entity.setUnindexedProperty(FILL_TIME_PROPERTY,fillTime);
  }
  if (null != sourceJobKey) {
    entity.setProperty(SOURCE_JOB_KEY_PROPERTY,sourceJobKey);
  }
  try {
    entity.setUnindexedProperty(VALUE_PROPERTY,PipelineManager.getBackEnd().serializeValue(this,value));
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  entity.setProperty(WAITING_ON_ME_PROPERTY,waitingOnMeKeys);
  return entity;
}
Program: 33442
Project: 33442
Buggy source:
@Override public <T1,T2,T3,T4,T5,T6>String startNewPipeline(Job6<?,T1,T2,T3,T4,T5,T6> jobInstance,T1 arg1,T2 arg2,T3 arg3,T4 arg4,T5 arg5,T6 arg6,JobSetting... settings){
  return PipelineManager.startNewPipeline(settings,jobInstance,arg1,arg2,arg3,arg4,arg5);
}

Fixed version (ground truth):
@Override public <T1,T2,T3,T4,T5,T6>String startNewPipeline(Job6<?,T1,T2,T3,T4,T5,T6> jobInstance,T1 arg1,T2 arg2,T3 arg3,T4 arg4,T5 arg5,T6 arg6,JobSetting... settings){
  return PipelineManager.startNewPipeline(settings,jobInstance,arg1,arg2,arg3,arg4,arg5,arg6);
}
Program: 33444
Project: 33444
Buggy source:
/** 
 * Invoke this method from within the   {@code run} method of a <b>generatorjob</b> in order to get a  {@link PromisedValue} that becomes ready aftera specified delay.
 * @param delaySeconds Minimal delay after which the returned value becomes ready.
 * @return A {@code PromisedValue} that represents an empty value slot thatwill be filled by the pipelines framework after the specified delay.
 */
public Value<Void> newDelayedValue(long delaySeconds){
  PromisedValueImpl<Void> promisedValue=(PromisedValueImpl<Void>)newPromise(Void.class);
  PipelineManager.registerDelayedValue(delaySeconds,promisedValue.getSlot(),thisJobRecord);
  return promisedValue;
}

Fixed version (ground truth):
/** 
 * Invoke this method from within the   {@code run} method of a <b>generatorjob</b> in order to get a  {@link PromisedValue} that becomes ready aftera specified delay. The delay starts once this job's run method complete.
 * @param delaySeconds Minimal delay after which the returned value becomes ready.
 * @return A {@code PromisedValue} that represents an empty value slot thatwill be filled by the pipelines framework after the specified delay.
 */
public Value<Void> newDelayedValue(long delaySeconds){
  PromisedValueImpl<Void> promisedValue=(PromisedValueImpl<Void>)newPromise(Void.class);
  PipelineManager.registerDelayedValue(updateSpec,thisJobRecord,delaySeconds,promisedValue.getSlot());
  return promisedValue;
}
Program: 33445
Project: 33445
Buggy source:
/** 
 * Invoke this method from within the   {@code run} method of a <b>generatorjob</b> in order to declare that some value will be provided asynchronously by some external agent.
 * @param < F > The type of the asynchronously provided value.
 * @param klass A {@link Class} object used to specify the type of theasynchronously provided value.
 * @return A {@code PromisedValue} that represents an empty value slot thatwill be filled at a later time when the external agent invokes {@link PipelineService#submitPromisedValue(String,Object)}. This may be passed in to further invocations of   {@code futureCall()} inorder to specify a data dependency.
 */
public <F>PromisedValue<F> newPromise(Class<F> klass){
  PromisedValueImpl<F> promisedValue=new PromisedValueImpl<>(getPipelineKey(),thisJobRecord.getKey(),currentRunGUID);
  updateSpec.getNonTransactionalGroup().includeSlot(promisedValue.getSlot());
  return promisedValue;
}

Fixed version (ground truth):
public <F>PromisedValue<F> newPromise(){
  PromisedValueImpl<F> promisedValue=new PromisedValueImpl<>(getPipelineKey(),thisJobRecord.getKey(),currentRunGUID);
  updateSpec.getNonTransactionalGroup().includeSlot(promisedValue.getSlot());
  return promisedValue;
}
Program: 33446
Project: 33446
Buggy source:
/** 
 * @param slot delayed value slot
 */
public static void registerDelayedValue(long delaySec,Slot slot,JobRecord generatorJobRecord){
  FillSlotHandleSlotFilledTask task=new FillSlotHandleSlotFilledTask(slot.getKey(),generatorJobRecord.getRootJobKey(),generatorJobRecord.getQueueSettings());
  task.getQueueSettings().setDelayInSeconds(delaySec);
  backEnd.enqueue(task);
}

Fixed version (ground truth):
/** 
 * @param slot delayed value slot
 */
public static void registerDelayedValue(UpdateSpec spec,JobRecord generatorJobRecord,long delaySec,Slot slot){
  FillSlotHandleSlotFilledTask task=new FillSlotHandleSlotFilledTask(slot.getKey(),generatorJobRecord.getRootJobKey(),generatorJobRecord.getQueueSettings());
  task.getQueueSettings().setDelayInSeconds(delaySec);
  spec.getFinalTransaction().registerTask(task);
}