nus-yam/ex-repair huggingface dataset:
Program: 169165
Project: 169165
Buggy source:
private void mpirun(){
  state=State.RUNNING;
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + job.getTask().getIdentity());
  }
  Node n=cpus.get(0).getNode();
  Task t=cloneTaskNoStaging();
  t.setIdentity(new IdentityImpl(t.getIdentity().toString() + "String_Node_Str"));
  addMPIRun((JobSpecification)t.getSpecification(),n.getHostname());
  NotificationManager.getDefault().registerListener(t.getIdentity().getValue(),t,this);
  SubmitJobCommand sjc=new SubmitJobCommand(t);
  try {
    sjc.executeAsync(n.getChannel(),this);
  }
 catch (  ProtocolException e) {
    errorReceived(null,e.getMessage(),e);
  }
}

Fixed version (ground truth):
private void mpirun(){
  state=State.RUNNING;
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + job.getTask().getIdentity());
  }
  Node n=cpus.get(0).getNode();
  Task t=cloneTaskNoStaging();
  Identity nid=new IdentityImpl();
  nid.setValue(t.getIdentity().toString() + "String_Node_Str");
  t.setIdentity(nid);
  addMPIRun((JobSpecification)t.getSpecification(),n.getHostname());
  NotificationManager.getDefault().registerListener(t.getIdentity().getValue(),t,this);
  SubmitJobCommand sjc=new SubmitJobCommand(t);
  try {
    sjc.executeAsync(n.getChannel(),this);
  }
 catch (  ProtocolException e) {
    errorReceived(null,e.getMessage(),e);
  }
}
Program: 169166
Project: 169166
Buggy source:
private void done(){
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + job.getTask().getIdentity() + "String_Node_Str"+ lastErrorMessage+ "String_Node_Str"+ lastException,new Throwable());
  }
  releaseNonLeadCpus();
  Status s;
  if (lastErrorMessage != null || lastException != null) {
    s=new StatusImpl(Status.FAILED,lastErrorMessage,lastException);
  }
 else {
    s=new StatusImpl(Status.COMPLETED);
  }
  job.getTask().setStatus(s);
  cpus.get(0).statusChanged(s,null,null);
  if (hostfile != null) {
    hostfile.delete();
  }
}

Fixed version (ground truth):
private void done(){
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + job.getTask().getIdentity() + "String_Node_Str"+ lastErrorMessage+ "String_Node_Str"+ lastException);
  }
  releaseNonLeadCpus();
  Status s;
  if (lastErrorMessage != null || lastException != null) {
    s=new StatusImpl(Status.FAILED,lastErrorMessage,lastException);
  }
 else {
    s=new StatusImpl(Status.COMPLETED);
  }
  job.getTask().setStatus(s);
  cpus.get(0).statusChanged(s,null,null);
  if (hostfile != null) {
    hostfile.delete();
  }
}
Program: 169167
Project: 169167
Buggy source:
private void cleanup(CleanUpSet cl){
  state=State.CLEANUP;
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + job.getTask().getIdentity());
  }
  CleanUpSet ncl=new CleanUpSetImpl();
  for (  String s : cl) {
    if (s.startsWith("String_Node_Str") || jobdir == null) {
      ncl.add(s);
    }
 else {
      ncl.add(jobdir + "String_Node_Str" + s);
    }
  }
  Set<Node> nodes=new HashSet<Node>();
  for (  Cpu cpu : cpus) {
    nodes.add(cpu.getNode());
  }
  cleanupsActive=nodes.size();
  for (  Node node : nodes) {
    CleanupCommand cmd=new CleanupCommand(cl);
    try {
      cmd.executeAsync(node.getChannel(),this);
    }
 catch (    ProtocolException e) {
      setError(e.getMessage(),e);
    }
  }
}

Fixed version (ground truth):
private void cleanup(CleanUpSet cl){
  state=State.CLEANUP;
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + job.getTask().getIdentity());
  }
  CleanUpSet ncl=new CleanUpSetImpl();
  for (  String s : cl) {
    if (s.startsWith("String_Node_Str") || jobdir == null) {
      ncl.add(s);
    }
 else {
      ncl.add(jobdir + "String_Node_Str" + s);
    }
  }
  Set<Node> nodes=new HashSet<Node>();
  for (  Cpu cpu : cpus) {
    nodes.add(cpu.getNode());
  }
  cleanupsActive=nodes.size();
  for (  Node node : nodes) {
    CleanupCommand cmd=new CleanupCommand(cl);
    try {
      cmd.executeAsync(node.getChannel(),this);
    }
 catch (    ProtocolException e) {
      setError(e.getMessage(),e);
      int r;
synchronized (this) {
        cleanupsActive--;
        r=cleanupsActive;
      }
      checkCleanups(r);
    }
  }
}
Program: 169168
Project: 169168
Buggy source:
@Override public void errorReceived(Command cmd,String msg,Exception t){
  setError(msg,t);
switch (state) {
case STAGEIN:
    int r;
synchronized (this) {
    stageinsActive--;
    r=stageinsActive;
  }
checkStageins(r);
break;
case RUNNING:
stageout(true);
break;
case STAGEOUT:
cleanup();
break;
case CLEANUP:
done();
break;
}
}

Fixed version (ground truth):
@Override public void errorReceived(Command cmd,String msg,Exception t){
  setError(msg,t);
switch (state) {
case STAGEIN:
    int r;
synchronized (this) {
    stageinsActive--;
    r=stageinsActive;
  }
checkStageins(r);
break;
case RUNNING:
stageout(true);
break;
case STAGEOUT:
cleanup();
break;
case CLEANUP:
int r2;
synchronized (this) {
cleanupsActive--;
r2=cleanupsActive;
}
checkCleanups(r2);
break;
}
}
Program: 169169
Project: 169169
Buggy source:
@Override public void replyReceived(Command cmd){
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + cmd);
  }
switch (state) {
case STAGEIN:
    int r;
synchronized (this) {
    stageinsActive--;
    r=stageinsActive;
  }
checkStageins(r);
break;
case RUNNING:
break;
case STAGEOUT:
cleanup();
break;
case CLEANUP:
done();
break;
}
}

Fixed version (ground truth):
@Override public void replyReceived(Command cmd){
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + cmd);
  }
switch (state) {
case STAGEIN:
    int r;
synchronized (this) {
    stageinsActive--;
    r=stageinsActive;
  }
checkStageins(r);
break;
case RUNNING:
break;
case STAGEOUT:
cleanup();
break;
case CLEANUP:
int r2;
synchronized (this) {
cleanupsActive--;
r2=cleanupsActive;
}
checkCleanups(r2);
break;
}
}
Program: 169170
Project: 169170
Buggy source:
@Override protected ServerSocketChannel openChannel() throws IOException {
  ServerSocketChannel channel=PortManager.getDefault().openServerSocketChannel();
  logger.info("String_Node_Str" + getURL());
  return channel;
}

Fixed version (ground truth):
@Override protected ServerSocketChannel openChannel() throws IOException {
  ServerSocketChannel channel=PortManager.getDefault().openServerSocketChannel();
  return channel;
}
Program: 169171
Project: 169171
Buggy source:
public BootstrapService(){
  super("String_Node_Str",-1,null);
  initWebDir();
  initList();
}

Fixed version (ground truth):
public BootstrapService(){
  super("String_Node_Str",0,null);
  initWebDir();
  initList();
}
Program: 169172
Project: 169172
Buggy source:
private static void checkImmediateFlags(ArgumentParser ap,String[] argv){
  try {
    ap.parse(argv);
    if (ap.isPresent(ARG_HELP)) {
      ap.usage();
      System.exit(0);
    }
    if (ap.isPresent(ARG_VERSION)) {
      System.out.println(loadVersion());
      System.exit(0);
    }
    if (ap.isPresent(ARG_SITES_FILE)) {
      System.err.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
      System.exit(1);
    }
    if (ap.isPresent(ARG_TC_FILE)) {
      System.err.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
      System.exit(1);
    }
    if (ap.isPresent(ARG_LIST_CONFIG)) {
      SwiftConfig config=loadConfig(ap,getCommandLineProperties(ap));
      String val=ap.getStringValue(ARG_LIST_CONFIG);
      if ("String_Node_Str".equals(val)) {
        System.out.println(config.toString(true,false));
        System.exit(0);
      }
 else       if ("String_Node_Str".equals(val)) {
        System.out.println(config.toString(true,true));
        System.exit(0);
      }
 else {
        System.err.println("String_Node_Str" + val + "String_Node_Str"+ "String_Node_Str");
        System.exit(1);
      }
    }
    if (!ap.hasValue(ArgumentParser.DEFAULT) && !ap.isPresent(ARG_EXECUTE)) {
      System.out.println(loadVersion());
      error("String_Node_Str");
    }
    if (ap.isPresent(ARG_PAUSE_ON_START)) {
      System.out.println("String_Node_Str");
      System.in.read();
    }
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + e.getMessage() + "String_Node_Str");
    shortUsage();
    System.exit(1);
  }
}

Fixed version (ground truth):
private static void checkImmediateFlags(ArgumentParser ap,String[] argv){
  try {
    ap.parse(argv);
    if (ap.isPresent(ARG_HELP)) {
      ap.usage();
      System.exit(0);
    }
    if (ap.isPresent(ARG_VERSION)) {
      System.out.println(loadVersion());
      System.exit(0);
    }
    if (ap.isPresent(ARG_SITES_FILE)) {
      System.err.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
      System.exit(1);
    }
    if (ap.isPresent(ARG_TC_FILE)) {
      System.err.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
      System.exit(1);
    }
    if (ap.isPresent(ARG_LIST_CONFIG)) {
      SwiftConfig config=loadConfig(ap,getCommandLineProperties(ap));
      String val=ap.getStringValue(ARG_LIST_CONFIG);
      if ("String_Node_Str".equals(val)) {
        System.out.println(config.toString(true,false));
        System.exit(0);
      }
 else       if ("String_Node_Str".equals(val)) {
        System.out.println(config.toString(true,true));
        System.exit(0);
      }
 else {
        System.err.println("String_Node_Str" + val + "String_Node_Str"+ "String_Node_Str");
        System.exit(1);
      }
    }
    if (ap.isPresent(ARG_PAUSE_ON_START)) {
      System.out.println("String_Node_Str");
      System.in.read();
    }
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + e.getMessage() + "String_Node_Str");
    shortUsage();
    System.exit(1);
  }
}
Program: 169174
Project: 169174
Buggy source:
@Override public void processMessage(SystemState state,SimpleParser p,Object details){
  try {
    p.skip("String_Node_Str");
    p.beginToken();
    p.markTo("String_Node_Str");
    String blockId=p.getToken();
    p.skip("String_Node_Str");
    p.beginToken();
    p.markTo("String_Node_Str");
    int cores=Integer.parseInt(p.getToken());
    p.skip("String_Node_Str");
    p.beginToken();
    p.markTo("String_Node_Str");
    int coresPerWorker=Integer.parseInt(p.getToken());
    p.skip("String_Node_Str");
    int walltime=Integer.parseInt(p.remaining());
    CoasterStatusItem item=(CoasterStatusItem)state.getItemByID(CoasterStatusItem.ID,StatefulItemClass.MISC);
    item.newBlock(blockId,cores,coresPerWorker,walltime);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void processMessage(SystemState state,SimpleParser p,Object details){
  try {
    p.skip("String_Node_Str");
    p.beginToken();
    p.markTo("String_Node_Str");
    String blockId=p.getToken();
    p.skip("String_Node_Str");
    p.beginToken();
    p.markTo("String_Node_Str");
    int cores=Integer.parseInt(p.getToken());
    p.skip("String_Node_Str");
    p.beginToken();
    p.markTo("String_Node_Str");
    int coresPerWorker=Integer.parseInt(p.getToken());
    p.skip("String_Node_Str");
    long walltime=Long.parseLong(p.remaining());
    CoasterStatusItem item=(CoasterStatusItem)state.getItemByID(CoasterStatusItem.ID,StatefulItemClass.MISC);
    item.newBlock(blockId,cores,coresPerWorker,walltime);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 169175
Project: 169175
Buggy source:
@Override protected Node compileBody(WrapperNode w,Scope argScope,Scope scope) throws CompilationException {
  if (this.getClass() == SetFieldValue.class && var.isStatic() && path.isStatic() && value.isStatic()) {
    if (getParent().getParent().getParent().getType().equals("String_Node_Str")) {
      try {
        DSHandle var=this.var.getValue();
        Path path=parsePath(this.path.getValue());
        DSHandle leaf=var.getField(path);
        AbstractDataNode value=this.value.getValue();
        if (value.isClosed()) {
          State state=new State();
          deepCopy(leaf,value,state,0);
          return null;
        }
      }
 catch (      Exception e) {
        throw new CompilationException(w,"String_Node_Str",e);
      }
    }
  }
  return super.compileBody(w,argScope,scope);
}

Fixed version (ground truth):
@Override protected Node compileBody(WrapperNode w,Scope argScope,Scope scope) throws CompilationException {
  if (_traceline.getValue() != null) {
    setLine(_traceline.getValue());
  }
  tracer=Tracer.getTracer(this);
  if (this.getClass() == SetFieldValue.class && var.isStatic() && path.isStatic() && value.isStatic()) {
    if (getParent().getParent().getParent().getType().equals("String_Node_Str")) {
      try {
        DSHandle var=this.var.getValue();
        Path path=parsePath(this.path.getValue());
        DSHandle leaf=var.getField(path);
        AbstractDataNode value=this.value.getValue();
        if (value.isClosed()) {
          State state=new State();
          deepCopy(leaf,value,state,0);
          if (tracer.isEnabled()) {
            String mdst=this.dst;
            if (mdst == null) {
              mdst=Tracer.getVarName(var);
              if (var.getParent() == null) {
                this.dst=mdst;
              }
            }
            logStatic(leaf,value,mdst);
          }
          return null;
        }
      }
 catch (      Exception e) {
        throw new CompilationException(w,"String_Node_Str",e);
      }
    }
  }
  return super.compileBody(w,argScope,scope);
}
Program: 169176
Project: 169176
Buggy source:
private static void copyNonComposite(DSHandle dest,DSHandle source,State state,int level) throws InvalidPathException {
  Path dpath=dest.getPathFromRoot();
  Mapper dmapper=dest.getMapper();
  if (dmapper.canBeRemapped(dpath)) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + dest + "String_Node_Str"+ source);
    }
    dmapper.remap(dpath,source.getMapper(),source.getPathFromRoot());
    dest.setValue(AbstractDataNode.FILE_VALUE);
  }
 else {
    StateEntry se=getStateEntry(state,level);
    FileCopier fc=se.value();
    if (fc != null) {
      if (!fc.isClosed()) {
        throw new FutureNotYetAvailable(fc);
      }
 else {
        if (fc.getException() != null) {
          throw new ExecutionException("String_Node_Str" + source + "String_Node_Str"+ dest,fc.getException());
        }
      }
      dest.setValue(AbstractDataNode.FILE_VALUE);
    }
 else {
      fc=new FileCopier(source.getMapper().map(source.getPathFromRoot()),dmapper.map(dpath));
      se.value(fc);
      try {
        fc.start();
      }
 catch (      Exception e) {
        throw new ExecutionException("String_Node_Str",e);
      }
      throw new FutureNotYetAvailable(fc);
    }
    popStateEntry(state);
  }
}

Fixed version (ground truth):
private static void copyNonComposite(DSHandle dest,DSHandle source,State state,int level) throws InvalidPathException {
  Path dpath=dest.getPathFromRoot();
  Mapper dmapper=dest.getMapper();
  StateEntry se=getStateEntry(state,level);
  FileCopier fc=se.value();
  if (fc != null) {
    if (!fc.isClosed()) {
      throw new FutureNotYetAvailable(fc);
    }
 else {
      if (fc.getException() != null) {
        throw new ExecutionException("String_Node_Str" + source + "String_Node_Str"+ dest,fc.getException());
      }
    }
    dest.setValue(AbstractDataNode.FILE_VALUE);
  }
 else {
    fc=new FileCopier(source.getMapper().map(source.getPathFromRoot()),dmapper.map(dpath),!dmapper.isPersistent(dpath));
    se.value(fc);
    try {
      if (fc.start()) {
        dest.setValue(AbstractDataNode.FILE_VALUE);
        popStateEntry(state);
        return;
      }
    }
 catch (    Exception e) {
      throw new ExecutionException("String_Node_Str",e);
    }
    throw new FutureNotYetAvailable(fc);
  }
  popStateEntry(state);
}
Program: 169177
Project: 169177
Buggy source:
public void cancel(Block block) throws InvalidSecurityContextException, TaskSubmissionException {
  try {
    getHandler(block.getTask().getProvider()).cancel(block.getTask());
  }
 catch (  InvalidProviderException e) {
    throw new TaskSubmissionException(e);
  }
catch (  ProviderMethodException e) {
    throw new TaskSubmissionException(e);
  }
}

Fixed version (ground truth):
public void cancel(Block block) throws InvalidSecurityContextException, TaskSubmissionException {
  try {
    Task t=block.getTask();
    getHandler(getProvider(t)).cancel(t);
  }
 catch (  InvalidProviderException e) {
    throw new TaskSubmissionException(e);
  }
catch (  ProviderMethodException e) {
    throw new TaskSubmissionException(e);
  }
}
Program: 169178
Project: 169178
Buggy source:
private boolean parametersMatch(Method m,Class<?>[] parameterTypes){
  Class<?>[] methodPTypes=m.getParameterTypes();
  if (methodPTypes.length > parameterTypes.length) {
    return false;
  }
  boolean varargs=false;
  int n=methodPTypes.length;
  if (n <= parameterTypes.length) {
    if (m.isVarArgs()) {
      if (n == parameterTypes.length && parameterTypes[n - 1].isArray()) {
      }
 else {
        n--;
        varargs=true;
      }
    }
 else {
      return false;
    }
  }
  for (int i=0; i < n; i++) {
    Class<?> pt=checkWrapPrimitive(parameterTypes[i],methodPTypes[i]);
    if (!methodPTypes[i].isAssignableFrom(pt)) {
      return false;
    }
  }
  if (varargs) {
    Class<?> vargsType=methodPTypes[methodPTypes.length - 1];
    if (!vargsType.isArray()) {
      throw new RuntimeException("String_Node_Str");
    }
    Class<?> memberType=vargsType.getComponentType();
    for (int i=n; i < parameterTypes.length; i++) {
      Class<?> pt=checkWrapPrimitive(parameterTypes[i],memberType);
      if (!memberType.isAssignableFrom(pt)) {
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean parametersMatch(Method m,Class<?>[] parameterTypes){
  Class<?>[] methodPTypes=m.getParameterTypes();
  if (methodPTypes.length > parameterTypes.length) {
    return false;
  }
  boolean varargs=false;
  int n=methodPTypes.length;
  if (n <= parameterTypes.length) {
    if (m.isVarArgs()) {
      if (n == parameterTypes.length && parameterTypes[n - 1].isArray()) {
      }
 else {
        n--;
        varargs=true;
      }
    }
 else     if (n < parameterTypes.length) {
      return false;
    }
  }
  for (int i=0; i < n; i++) {
    Class<?> pt=checkWrapPrimitive(parameterTypes[i],methodPTypes[i]);
    if (!methodPTypes[i].isAssignableFrom(pt)) {
      return false;
    }
  }
  if (varargs) {
    Class<?> vargsType=methodPTypes[methodPTypes.length - 1];
    if (!vargsType.isArray()) {
      throw new RuntimeException("String_Node_Str");
    }
    Class<?> memberType=vargsType.getComponentType();
    for (int i=n; i < parameterTypes.length; i++) {
      Class<?> pt=checkWrapPrimitive(parameterTypes[i],memberType);
      if (!memberType.isAssignableFrom(pt)) {
        return false;
      }
    }
  }
  return true;
}
Program: 169179
Project: 169179
Buggy source:
private String substituteGroups(RemoteFile drf,Matcher m){
  String dst=drf.getName();
  StringBuilder sb=new StringBuilder();
  boolean lastWasWildcard=false;
  int begin=0;
  int cg=0;
  for (int i=0; i < dst.length(); i++) {
    char c=dst.charAt(i);
switch (c) {
case '?':
case '*':
      if (!lastWasWildcard) {
        sb.append(dst.substring(begin,i));
        cg++;
      }
    lastWasWildcard=true;
  break;
default :
if (lastWasWildcard) {
  sb.append(m.group(cg));
  lastWasWildcard=false;
  begin=i;
}
}
}
if (lastWasWildcard) {
sb.append(m.group(cg));
}
 else {
sb.append(dst.substring(begin));
}
RemoteFile rf=new RemoteFile(drf);
rf.setName(sb.toString());
return rf.getURIAsString();
}

Fixed version (ground truth):
private String substituteGroups(RemoteFile drf,Matcher m){
  String dst=drf.getName();
  StringBuilder sb=new StringBuilder();
  boolean lastWasWildcard=false;
  int begin=0;
  int cg=0;
  for (int i=0; i < dst.length(); i++) {
    char c=dst.charAt(i);
switch (c) {
case '?':
case '*':
      if (!lastWasWildcard) {
        sb.append(dst.substring(begin,i));
        cg++;
      }
    lastWasWildcard=true;
  break;
default :
if (lastWasWildcard) {
  sb.append(m.group(cg));
  lastWasWildcard=false;
  begin=i;
}
}
}
if (lastWasWildcard) {
sb.append(m.group(cg));
}
 else {
sb.append(dst.substring(begin));
}
RemoteFile rf=new RemoteFile(drf.getProtocol(),drf.getHost(),drf.getPort(),drf.getDirectory(),sb.toString());
return rf.getURIAsString();
}
Program: 169180
Project: 169180
Buggy source:
protected Collection<String[]> glob() throws FileResourceException {
  List<String[]> results=new ArrayList<String[]>();
  Pattern p=Pattern.compile(toRegexp(srf.getName()));
  Collection<GridFile> files=list(fr,srf.getDirectory(),p);
  for (  GridFile f : files) {
    Matcher m=p.matcher(f.getName());
    if (!m.matches()) {
      throw new IllegalStateException("String_Node_Str" + f.getName() + "String_Node_Str"+ srf.getName()+ "String_Node_Str");
    }
    String[] result=new String[2];
    RemoteFile rf=new RemoteFile(srf);
    rf.setName(f.getName());
    result[0]=rf.getURIAsString();
    result[1]=substituteGroups(drf,m);
    results.add(result);
  }
  return results;
}

Fixed version (ground truth):
protected Collection<String[]> glob() throws FileResourceException {
  List<String[]> results=new ArrayList<String[]>();
  Pattern p=Pattern.compile(toRegexp(srf.getName()));
  Collection<GridFile> files=list(fr,srf.getDirectory(),p);
  for (  GridFile f : files) {
    Matcher m=p.matcher(f.getName());
    if (!m.matches()) {
      throw new IllegalStateException("String_Node_Str" + f.getName() + "String_Node_Str"+ srf.getName()+ "String_Node_Str");
    }
    String[] result=new String[2];
    RemoteFile rf=new RemoteFile(srf.getProtocol(),srf.getHost(),srf.getPort(),srf.getDirectory(),f.getName());
    result[0]=rf.getURIAsString();
    result[1]=substituteGroups(drf,m);
    results.add(result);
  }
  return results;
}
Program: 169181
Project: 169181
Buggy source:
public static LogEntry parse(String line){
  LogEntry entry=new LogEntry();
  StringTokenizer st=new StringTokenizer(line,"String_Node_Str");
  if (st.countTokens() < 2 && st.countTokens() > 3) {
    throw new ExecutionException();
  }
  entry.key=st.nextToken();
  if (st.hasMoreTokens()) {
    entry.value=st.nextToken();
  }
  return entry;
}

Fixed version (ground truth):
public static LogEntry parse(String line){
  LogEntry entry=new LogEntry();
  StringTokenizer st=new StringTokenizer(line,"String_Node_Str");
  int tokCount=st.countTokens();
  if (tokCount == 1) {
    entry.key=line;
    return entry;
  }
  if (tokCount > 3) {
    throw new ExecutionException();
  }
  entry.key=st.nextToken();
  if (st.hasMoreTokens()) {
    entry.value=st.nextToken();
  }
  return entry;
}
Program: 169182
Project: 169182
Buggy source:
protected void create(Stack stack,String name) throws ExecutionException {
  FlushableLockedFileWriter logffw=null;
  if (name == null) {
    name=fileName.getValue(stack);
  }
  for (int i=0; i < Integer.MAX_VALUE; i++) {
    String restartLogFilename=System.getProperty("String_Node_Str");
    if (restartLogFilename == null) {
      String index="String_Node_Str" + String.valueOf(i);
      restartLogFilename=name + index + "String_Node_Str";
    }
    File f=new File(restartLogFilename);
    if (f.exists()) {
      if (i == MAX_INDEX) {
        throw new ExecutionException(this,"String_Node_Str");
      }
      continue;
    }
    try {
      logffw=new FlushableLockedFileWriter(f,true);
      writeDate(logffw,"String_Node_Str");
    }
 catch (    IOException e) {
      throw new ExecutionException(this,"String_Node_Str" + f.getAbsolutePath(),e);
    }
    if (logffw.isLocked()) {
      break;
    }
 else     if (!logffw.lockExists()) {
      logger.warn("String_Node_Str");
      break;
    }
  }
  Map<LogEntry,Object> m=Collections.emptyMap();
  if (logffw == null) {
    throw new ExecutionException(this,"String_Node_Str");
  }
  c_restartLog.set(stack,new LogChannelOperator(logffw));
  context.getValue(stack).setAttribute(LOG_DATA,m);
}

Fixed version (ground truth):
protected void create(Stack stack,String name) throws ExecutionException {
  FlushableLockedFileWriter logffw=null;
  if (name == null) {
    name=fileName.getValue(stack);
  }
  for (int i=0; i < Integer.MAX_VALUE; i++) {
    String restartLogFilename=System.getProperty("String_Node_Str");
    if (restartLogFilename == null) {
      String index="String_Node_Str" + String.valueOf(i);
      restartLogFilename=name + index + "String_Node_Str";
    }
    File f=new File(restartLogFilename);
    if (f.exists()) {
      if (i == MAX_INDEX) {
        throw new ExecutionException(this,"String_Node_Str");
      }
      continue;
    }
    try {
      logffw=new FlushableLockedFileWriter(f,true);
      writeDate(logffw,"String_Node_Str");
      logffw.write("String_Node_Str" + VERSION_MAJ + "String_Node_Str"+ VERSION_MIN+ "String_Node_Str");
    }
 catch (    IOException e) {
      throw new ExecutionException(this,"String_Node_Str" + f.getAbsolutePath(),e);
    }
    if (logffw.isLocked()) {
      break;
    }
 else     if (!logffw.lockExists()) {
      logger.warn("String_Node_Str");
      break;
    }
  }
  Map<LogEntry,Object> m=Collections.emptyMap();
  if (logffw == null) {
    throw new ExecutionException(this,"String_Node_Str");
  }
  c_restartLog.set(stack,new LogChannelOperator(logffw));
  context.getValue(stack).setAttribute(LOG_DATA,m);
}
Program: 169183
Project: 169183
Buggy source:
private Map<LogEntry,Object> parseLog(File f) throws FileNotFoundException, IOException {
  BufferedReader br=new BufferedReader(new FileReader(f));
  try {
    HashMap<LogEntry,Object> data=new HashMap<LogEntry,Object>();
    String line;
    while ((line=br.readLine()) != null) {
      if (line.length() == 0 || line.charAt(0) == '#') {
        continue;
      }
      try {
        LogEntry entry=LogEntry.parse(line);
        if (entry.getValue() == null) {
          MutableInteger old=(MutableInteger)data.get(entry);
          if (old == null) {
            data.put(entry,new MutableInteger(1));
          }
 else {
            old.inc();
          }
        }
 else {
          @SuppressWarnings("String_Node_Str") List<String> old=(List<String>)data.get(entry);
          if (old == null) {
            old=new LinkedList<String>();
            data.put(entry,old);
          }
          old.add(entry.getValue());
        }
      }
 catch (      ExecutionException e) {
        logger.warn("String_Node_Str" + line);
      }
    }
    return data;
  }
  finally {
    try {
      br.close();
    }
 catch (    IOException e) {
      logger.warn("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private Map<LogEntry,Object> parseLog(File f) throws FileNotFoundException, IOException {
  BufferedReader br=new BufferedReader(new FileReader(f));
  try {
    HashMap<LogEntry,Object> data=new HashMap<LogEntry,Object>();
    String line;
    while ((line=br.readLine()) != null) {
      if (line.length() == 0 || line.charAt(0) == '#') {
        if (line.startsWith("String_Node_Str")) {
          checkCompatible(line);
        }
        continue;
      }
      try {
        LogEntry entry=LogEntry.parse(line);
        if (entry.getValue() == null) {
          MutableInteger old=(MutableInteger)data.get(entry);
          if (old == null) {
            data.put(entry,new MutableInteger(1));
          }
 else {
            old.inc();
          }
        }
 else {
          @SuppressWarnings("String_Node_Str") List<String> old=(List<String>)data.get(entry);
          if (old == null) {
            old=new LinkedList<String>();
            data.put(entry,old);
          }
          old.add(entry.getValue());
        }
      }
 catch (      ExecutionException e) {
        logger.warn("String_Node_Str" + line);
      }
    }
    return data;
  }
  finally {
    try {
      br.close();
    }
 catch (    IOException e) {
      logger.warn("String_Node_Str");
    }
  }
}
Program: 169184
Project: 169184
Buggy source:
private void closeLog(Stack stack) throws ExecutionException {
  try {
    c_restartLog.get(stack).close();
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void closeLog(Stack stack) throws ExecutionException {
  try {
    Channel<String> log=c_restartLog.get(stack);
    if (log != null) {
      log.close();
    }
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str",e);
  }
}
Program: 169185
Project: 169185
Buggy source:
private AbsFile mapSingle(){
  AbsFile f=(AbsFile)var.map();
  if (defaultScheme != null && f.getProtocol() == null) {
    f.setProtocol(defaultScheme);
  }
  return f;
}

Fixed version (ground truth):
private AbsFile mapSingle(){
  AbsFile f=(AbsFile)var.map();
  if (defaultScheme != null && f.getProtocol() == null) {
    f=new AbsFile(defaultScheme,f.getHost(),f.getPort(),f.getDirectory(),f.getName());
  }
  return f;
}
Program: 169186
Project: 169186
Buggy source:
private List<AbsFile> mapMultiple() throws HandleOpenException, InvalidPathException {
  RootHandle root=var.getRoot();
  Mapper mapper=root.getMapper();
  if (mapper == null) {
    throw new ExecutionException(var.getType() + "String_Node_Str");
  }
  List<AbsFile> l=new ArrayList<AbsFile>();
  Collection<Path> fp=var.getFringePaths();
  List<Path> src;
  if (fp instanceof List) {
    src=(List<Path>)fp;
  }
 else {
    src=new ArrayList<Path>(fp);
  }
  Collections.sort(src,new PathComparator());
  for (  Path p : src) {
    AbsFile f=(AbsFile)mapper.map(p);
    if (defaultScheme != null && f.getProtocol() == null) {
      f.setProtocol(defaultScheme);
    }
    l.add(f);
  }
  return l;
}

Fixed version (ground truth):
private List<AbsFile> mapMultiple() throws HandleOpenException, InvalidPathException {
  RootHandle root=var.getRoot();
  Mapper mapper=root.getMapper();
  if (mapper == null) {
    throw new ExecutionException(var.getType() + "String_Node_Str");
  }
  List<AbsFile> l=new ArrayList<AbsFile>();
  Collection<Path> fp=var.getFringePaths();
  List<Path> src;
  if (fp instanceof List) {
    src=(List<Path>)fp;
  }
 else {
    src=new ArrayList<Path>(fp);
  }
  Collections.sort(src,new PathComparator());
  for (  Path p : src) {
    AbsFile f=(AbsFile)mapper.map(p);
    if (defaultScheme != null && f.getProtocol() == null) {
      f=new AbsFile(defaultScheme,f.getHost(),f.getPort(),f.getDirectory(),f.getName());
    }
    l.add(f);
  }
  return l;
}
Program: 169187
Project: 169187
Buggy source:
private Set<AbsFile> addOne(AbsFile f,Info info,Set<AbsFile> files,String defaultScheme){
  String proto=f.getProtocol();
  if (proto == null) {
    f.setProtocol(defaultScheme);
  }
  if (f.getHost() == null) {
    f.setHost("String_Node_Str");
  }
  String dir=f.getDirectory();
  if (info.remoteDirNames.isEmpty()) {
    info.remoteDirNames=new HashSet<AbsFile>();
  }
  if (dir == null) {
    info.remoteDirNames.add(new AbsFile(f.getProtocol(),f.getHost(),"String_Node_Str"));
  }
 else {
    info.remoteDirNames.add(new AbsFile(f.getProtocol(),f.getHost(),f.getDirectory()));
  }
  if (files.isEmpty()) {
    files=new HashSet<AbsFile>();
  }
  files.add(f);
  return files;
}

Fixed version (ground truth):
private Set<AbsFile> addOne(AbsFile f,Info info,Set<AbsFile> files,String defaultScheme){
  String proto=f.getProtocol(defaultScheme);
  String host=f.getHost("String_Node_Str");
  String dir=f.getDirectory();
  if (info.remoteDirNames.isEmpty()) {
    info.remoteDirNames=new HashSet<AbsFile>();
  }
  if (dir == null) {
    info.remoteDirNames.add(new AbsFile(proto,host,"String_Node_Str"));
  }
 else {
    info.remoteDirNames.add(new AbsFile(proto,host,f.getDirectory()));
  }
  if (files.isEmpty()) {
    files=new HashSet<AbsFile>();
  }
  files.add(new AbsFile(proto,host,f.getPort(),f.getDirectory(),f.getName()));
  return files;
}
Program: 169188
Project: 169188
Buggy source:
private static boolean isLogged(Map<LogEntry,Object> logData,String str){
  LogEntry entry=LogEntry.build(str);
  boolean found=false;
synchronized (logData) {
    List<?> files=(List<?>)logData.get(entry);
    if (files != null && !files.isEmpty()) {
      found=true;
    }
  }
  return found;
}

Fixed version (ground truth):
private static boolean isLogged(Map<LogEntry,Object> logData,String str){
  LogEntry entry=LogEntry.build(str);
  boolean found=false;
synchronized (logData) {
    Object v=logData.get(entry);
    if (v instanceof MutableInteger) {
      return true;
    }
 else {
      List<?> files=(List<?>)v;
      if (files != null && !files.isEmpty()) {
        found=true;
      }
    }
  }
  return found;
}
Program: 169189
Project: 169189
Buggy source:
private void addAll(Collection<Object> ret,List<AbsFile> l,boolean remote){
  for (int i=0; i < l.size(); i++) {
    AbsFile f=l.get(i);
    ret.add(getPath(f,remote));
  }
}

Fixed version (ground truth):
private void addAll(Collection<Object> ret,List<AbsFile> l,boolean direct){
  for (int i=0; i < l.size(); i++) {
    AbsFile f=l.get(i);
    ret.add(getPath(f,direct));
  }
}
Program: 169190
Project: 169190
Buggy source:
private String getPath(AbsFile f,boolean remote){
  if (isDirect(f)) {
    return f.getAbsolutePath();
  }
 else   if (remote) {
    return PathUtils.remotePathName(f);
  }
 else   if (isLocal(f) || f.getHost() == null) {
    return f.getPath();
  }
 else {
    return f.getHost() + "String_Node_Str" + f.getPath();
  }
}

Fixed version (ground truth):
private String getPath(AbsFile f,boolean direct){
  if (isDirect(f) || direct) {
    return f.getAbsolutePath();
  }
 else   if (this.transform == Transform.RELATIVE) {
    return PathUtils.remotePathName(f);
  }
 else   if (isLocal(f) || f.getHost() == null) {
    return f.getPath();
  }
 else {
    return f.getHost() + "String_Node_Str" + f.getPath();
  }
}
Program: 169191
Project: 169191
Buggy source:
public void toString(Collection<Object> ret,boolean direct){
  boolean remote=(this.transform == Transform.RELATIVE) && !direct;
  if (mode == MultiMode.COMBINED) {
    ret.add(combine(map(),remote));
  }
 else {
    addAll(ret,map(),remote);
  }
}

Fixed version (ground truth):
public void toString(Collection<Object> ret,boolean direct){
  if (mode == MultiMode.COMBINED) {
    ret.add(combine(map(),direct));
  }
 else {
    addAll(ret,map(),direct);
  }
}
Program: 169192
Project: 169192
Buggy source:
private String combine(List<AbsFile> l,boolean remote){
  StringBuffer sb=new StringBuffer();
  for (int i=0; i < l.size(); i++) {
    AbsFile f=l.get(i);
    if (i > 0) {
      sb.append(' ');
    }
    sb.append(getPath(f,remote));
  }
  return sb.toString();
}

Fixed version (ground truth):
private String combine(List<AbsFile> l,boolean direct){
  StringBuffer sb=new StringBuffer();
  for (int i=0; i < l.size(); i++) {
    AbsFile f=l.get(i);
    if (i > 0) {
      sb.append(' ');
    }
    sb.append(getPath(f,direct));
  }
  return sb.toString();
}
Program: 169193
Project: 169193
Buggy source:
@Override public Object function(Stack stack){
  AbstractDataNode dest=this.dest.getValue(stack);
  AbstractDataNode src=this.src.getValue(stack);
  try {
    src.waitFor(this);
  }
 catch (  DependentException e) {
    dest.setValue(new DataDependentException(dest,e));
    return null;
  }
  if (src.getType().equals(Types.STRING)) {
    readData(dest,(String)src.getValue());
  }
 else {
    PhysicalFormat pf=src.map();
    if (pf instanceof AbsFile) {
      AbsFile af=(AbsFile)pf;
      if (!af.getProtocol("String_Node_Str").equals("String_Node_Str")) {
        throw new ExecutionException("String_Node_Str");
      }
      readData(dest,af.getPath());
    }
 else {
      throw new ExecutionException("String_Node_Str");
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Object function(Stack stack){
  AbstractDataNode dest=this.dest.getValue(stack);
  AbstractDataNode src=this.src.getValue(stack);
  try {
    src.waitFor(this);
  }
 catch (  DependentException e) {
    dest.setValue(new DataDependentException(dest,e));
    return null;
  }
  Type st=src.getType();
  if (st.equals(Types.STRING)) {
    readData(dest,(String)src.getValue());
  }
 else   if (st.isPrimitive() || st.isComposite()) {
    throw new ExecutionException(this,"String_Node_Str" + st + "String_Node_Str");
  }
 else {
    PhysicalFormat pf=src.map();
    if (pf instanceof AbsFile) {
      AbsFile af=(AbsFile)pf;
      if (!af.getProtocol("String_Node_Str").equals("String_Node_Str")) {
        throw new ExecutionException(this,"String_Node_Str");
      }
      readData(dest,af.getPath());
    }
 else {
      throw new ExecutionException("String_Node_Str");
    }
  }
  return null;
}
Program: 169195
Project: 169195
Buggy source:
public synchronized void close() throws IOException {
  removeSocket(this);
  super.close();
}

Fixed version (ground truth):
public synchronized void close() throws IOException {
  removeSocket(this);
  s.close();
}
Program: 169196
Project: 169196
Buggy source:
public CoasterChannel getOrCreateChannel(String host,GSSCredential cred,RequestManager rm) throws ChannelException {
  CoasterChannel channel=getExistingChannel(host,cred);
  if (channel == null) {
    channel=openChannel(host,cred,rm);
  }
  return channel;
}

Fixed version (ground truth):
public CoasterChannel getOrCreateChannel(String host,GSSCredential cred,RequestManager rm) throws ChannelException {
  CoasterChannel channel=getChannel(host,cred);
  if (channel == null) {
    channel=openChannel(host,cred,rm);
  }
  return channel;
}
Program: 169197
Project: 169197
Buggy source:
public CoasterChannel getExistingChannel(String host,GSSCredential cred){
  if (host == null) {
    throw new NullPointerException("String_Node_Str");
  }
  host=normalize(host);
  CoasterChannel channel;
synchronized (channels) {
    HostCredentialPair hcp=new HostCredentialPair(host,cred);
    channel=getChannel(hcp);
  }
  if (channel == null) {
    throw new IllegalStateException("String_Node_Str" + host);
  }
  return channel;
}

Fixed version (ground truth):
public CoasterChannel getExistingChannel(String host,GSSCredential cred){
  CoasterChannel channel=getChannel(host,cred);
  if (channel == null) {
    throw new IllegalStateException("String_Node_Str" + host);
  }
  return channel;
}
Program: 169198
Project: 169198
Buggy source:
private BlockQueueProcessor get(String blockId){
synchronized (managers) {
    BlockQueueProcessor rm=managers.get(blockId);
    if (rm == null) {
      throw new IllegalArgumentException("String_Node_Str" + blockId);
    }
    return rm;
  }
}

Fixed version (ground truth):
private BlockQueueProcessor get(String blockId){
  if (singleQP != null) {
    return singleQP;
  }
synchronized (managers) {
    BlockQueueProcessor rm=managers.get(blockId);
    if (rm == null) {
      throw new IllegalArgumentException("String_Node_Str" + blockId);
    }
    return rm;
  }
}
Program: 169200
Project: 169200
Buggy source:
private QueueProcessor newQueueProcessor(String name){
  if (name.equals("String_Node_Str")) {
    return new LocalQueueProcessor(localService);
  }
 else   if (name.equals("String_Node_Str")) {
    return new BlockQueueProcessor(localService,settings);
  }
 else   if (name.equals("String_Node_Str")) {
    return service.getPassiveQueueProcessor();
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + name);
  }
}

Fixed version (ground truth):
private QueueProcessor newQueueProcessor(String name){
  if (name.equals("String_Node_Str")) {
    return new LocalQueueProcessor(localService);
  }
 else   if (name.equals("String_Node_Str")) {
    return new BlockQueueProcessor(localService,settings);
  }
 else   if (name.equals("String_Node_Str")) {
    return new PassiveQueueProcessor(localService,localService.getContact());
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + name);
  }
}
Program: 169201
Project: 169201
Buggy source:
public PassiveQueueProcessor(LocalTCPService localService,URI callbackURI){
  super(localService,null);
  setName("String_Node_Str");
  this.callbackURI=callbackURI;
}

Fixed version (ground truth):
public PassiveQueueProcessor(LocalTCPService localService,URI callbackURI){
  super(localService,new Settings());
  setName("String_Node_Str");
  this.callbackURI=callbackURI;
  localService.setSingleQP(this);
}
Program: 169202
Project: 169202
Buggy source:
/** 
 * Called when a slot is clicked by the player.
 */
@Override public ItemStack slotClick(final int slotID,final int button,final int flag,final EntityPlayer player){
  if ((slotID == this.resultSlotNumber) && (button == GuiHelper.MOUSE_BUTTON_RIGHT)) {
    return null;
  }
  return super.slotClick(slotID,button,flag,player);
}

Fixed version (ground truth):
/** 
 * Called when a slot is clicked by the player.
 */
@Override public ItemStack slotClick(final int slotID,final int button,final int flag,final EntityPlayer player){
  if ((slotID == this.resultSlotNumber) && (button == GuiHelper.MOUSE_BUTTON_RIGHT)) {
    return super.slotClick(slotID,0,flag,player);
  }
  return super.slotClick(slotID,button,flag,player);
}
Program: 169204
Project: 169204
Buggy source:
/** 
 * Applies the specified power to each shaft. Once a shaft has enough stored power, it applies a turn to its crankable.
 * @param powerTransfered
 */
private void updateShafts(final int powerTransfered){
  for (int sideIndex=0; sideIndex < TileGearBox.SIDE_COUNT; sideIndex++) {
    if (this.canTurn[sideIndex]) {
      if ((this.shafts[sideIndex]+=powerTransfered) >= TileGearBox.REQUIRED_POWER) {
        this.shafts[sideIndex]=0;
        this.crankables[sideIndex].applyTurn();
      }
    }
 else {
      this.shafts[sideIndex]=0;
    }
  }
}

Fixed version (ground truth):
/** 
 * Applies the specified power to each shaft. Once a shaft has enough stored power, it applies a turn to its crankable.
 * @param powerTransfered
 */
private void updateShafts(final int powerTransfered){
  for (int sideIndex=0; sideIndex < TileGearBox.SIDE_COUNT; sideIndex++) {
    if (this.canTurn[sideIndex] && (this.crankables[sideIndex] != null)) {
      if ((this.shafts[sideIndex]+=powerTransfered) >= TileGearBox.REQUIRED_POWER) {
        this.shafts[sideIndex]=0;
        this.crankables[sideIndex].applyTurn();
      }
    }
 else {
      this.shafts[sideIndex]=0;
    }
  }
}
Program: 169206
Project: 169206
Buggy source:
public GlucoseDataSet(CookieMonsterG4SGV egvRecord,CookieMonsterG4Sensor sensorRecord){
  this.systemTime=new Date(egvRecord.sys_timestamp_sec);
  this.displayTime=new Date(egvRecord.disp_timestamp_sec);
  this.reading=new GlucoseReading(egvRecord.sgv_mgdl,GlucoseUnit.MGDL);
  this.trend=TrendArrow.values()[egvRecord.trend.ordinal()];
  this.noise=egvRecord.noise.ordinal();
  this.unfiltered=sensorRecord.unfiltered;
  this.filtered=sensorRecord.filtered;
  this.rssi=sensorRecord.rssi;
}

Fixed version (ground truth):
public GlucoseDataSet(CookieMonsterG4SGV egvRecord,CookieMonsterG4Sensor sensorRecord){
  this.systemTime=Utils.receiverTimeToDate(egvRecord.sys_timestamp_sec);
  this.displayTime=Utils.receiverTimeToDate(egvRecord.disp_timestamp_sec);
  this.reading=new GlucoseReading(egvRecord.sgv_mgdl,GlucoseUnit.MGDL);
  this.trend=TrendArrow.values()[egvRecord.trend.ordinal()];
  this.noise=egvRecord.noise.ordinal();
  this.unfiltered=sensorRecord.unfiltered;
  this.filtered=sensorRecord.filtered;
  this.rssi=sensorRecord.rssi;
}
Program: 169208
Project: 169208
Buggy source:
public PageHeader(byte[] packet){
  if (packet.length < HEADER_SIZE) {
    if (packet.length != HEADER_SIZE) {
      throw new InvalidRecordLengthException("String_Node_Str" + packet.length + "String_Node_Str"+ HEADER_SIZE+ "String_Node_Str"+ Utils.bytesToHex(packet));
    }
  }
  firstRecordIndex=ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(FIRSTRECORDINDEX_OFFSET);
  numOfRecords=ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(NUMRECS_OFFSET);
  recordType=RecordType.values()[packet[RECTYPE_OFFSET]];
  revision=packet[REV_OFFSET];
  pageNumber=ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(PAGENUMBER_OFFSET);
  reserved2=ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(RESERVED2_OFFSET);
  reserved3=ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(RESERVED3_OFFSET);
  reserved4=ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(RESERVED4_OFFSET);
  System.arraycopy(packet,HEADER_SIZE - Constants.CRC_LEN,crc,0,Constants.CRC_LEN);
  byte[] crc_calc=CRC16.calculate(packet,0,HEADER_SIZE - Constants.CRC_LEN);
  if (!Arrays.equals(this.crc,crc_calc)) {
    throw new CRCFailError("String_Node_Str" + Utils.bytesToHex(this.crc) + "String_Node_Str"+ Utils.bytesToHex(crc_calc));
  }
}

Fixed version (ground truth):
public PageHeader(byte[] packet){
  if (packet.length < HEADER_SIZE) {
    throw new InvalidRecordLengthException("String_Node_Str" + packet.length + "String_Node_Str"+ HEADER_SIZE+ "String_Node_Str"+ Utils.bytesToHex(packet));
  }
  firstRecordIndex=ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(FIRSTRECORDINDEX_OFFSET);
  numOfRecords=ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(NUMRECS_OFFSET);
  recordType=RecordType.values()[packet[RECTYPE_OFFSET]];
  revision=packet[REV_OFFSET];
  pageNumber=ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(PAGENUMBER_OFFSET);
  reserved2=ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(RESERVED2_OFFSET);
  reserved3=ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(RESERVED3_OFFSET);
  reserved4=ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(RESERVED4_OFFSET);
  System.arraycopy(packet,HEADER_SIZE - Constants.CRC_LEN,crc,0,Constants.CRC_LEN);
  byte[] crc_calc=CRC16.calculate(packet,0,HEADER_SIZE - Constants.CRC_LEN);
  if (!Arrays.equals(this.crc,crc_calc)) {
    throw new CRCFailError("String_Node_Str" + Utils.bytesToHex(this.crc) + "String_Node_Str"+ Utils.bytesToHex(crc_calc));
  }
}
Program: 169209
Project: 169209
Buggy source:
public SensorRecord(byte[] packet){
  super(packet);
  if (packet.length != RECORD_SIZE) {
    if (packet.length != RECORD_SIZE) {
      throw new InvalidRecordLengthException("String_Node_Str" + packet.length + "String_Node_Str"+ RECORD_SIZE+ "String_Node_Str"+ Utils.bytesToHex(packet));
    }
  }
  unfiltered=ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(OFFSET_UNFILTERED);
  filtered=ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(OFFSET_FILTERED);
  rssi=ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getShort(OFFSET_RSSI);
}

Fixed version (ground truth):
public SensorRecord(byte[] packet){
  super(packet);
  if (packet.length != RECORD_SIZE) {
    throw new InvalidRecordLengthException("String_Node_Str" + packet.length + "String_Node_Str"+ RECORD_SIZE+ "String_Node_Str"+ Utils.bytesToHex(packet));
  }
  unfiltered=ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(OFFSET_UNFILTERED);
  filtered=ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(OFFSET_FILTERED);
  rssi=ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getShort(OFFSET_RSSI);
}
Program: 169210
Project: 169210
Buggy source:
synchronized public Tracker getTracker(){
  if (tracker == null) {
    GoogleAnalytics analytics=GoogleAnalytics.getInstance(this);
    return analytics.newTracker(R.xml.app_tracker);
  }
  return tracker;
}

Fixed version (ground truth):
synchronized public Tracker getTracker(){
  Log.d("String_Node_Str","String_Node_Str");
  if (tracker == null) {
    Log.d("String_Node_Str","String_Node_Str");
    GoogleAnalytics analytics=GoogleAnalytics.getInstance(this);
    tracker=analytics.newTracker(R.xml.app_tracker);
    return tracker;
  }
  return tracker;
}
Program: 169211
Project: 169211
Buggy source:
private void populateV1APIEntry(JSONObject json,EGRecord record) throws Exception {
  Date date=DATE_FORMAT.parse(record.getDisplayTime().toString());
  json.put("String_Node_Str","String_Node_Str");
  json.put("String_Node_Str",date.getTime());
  json.put("String_Node_Str",Integer.parseInt(String.valueOf(record.getBGValue())));
  json.put("String_Node_Str",record.getTrend());
}

Fixed version (ground truth):
private void populateV1APIEntry(JSONObject json,EGRecord record) throws Exception {
  json.put("String_Node_Str","String_Node_Str");
  json.put("String_Node_Str",record.getDisplayTime().getTime());
  json.put("String_Node_Str",Integer.parseInt(String.valueOf(record.getBGValue())));
  json.put("String_Node_Str",record.getTrend());
}