nus-yam/ex-repair huggingface dataset:
Program: 142453
Project: 142453
Buggy source:
/** 
 * Helper: find the Node for slave build or return current instance.
 * @param workspace Jenkins workspace on build node
 */
public static Node workspaceToNode(FilePath workspace){
  Computer computer=workspaceToComputer(workspace);
  if (computer != null) {
    return computer.getNode();
  }
  return Jenkins.getInstance();
}

Fixed version (ground truth):
/** 
 * Helper: find the Node for slave build or return current instance.
 * @param workspace Jenkins workspace on build node
 * @return Node
 */
public static Node workspaceToNode(FilePath workspace){
  Computer computer=workspaceToComputer(workspace);
  if (computer != null) {
    return computer.getNode();
  }
  return Jenkins.getInstance();
}
Program: 142454
Project: 142454
Buggy source:
public static P4Browser findBrowser(String scmCredential){
  StaplerRequest req=Stapler.getCurrentRequest();
  Job job=req == null ? null : req.findAncestorObject(Job.class);
  P4BaseCredentials credentials=job == null ? ConnectionHelper.findCredential(scmCredential,Jenkins.getActiveInstance()) : ConnectionHelper.findCredential(scmCredential,job);
  if (credentials == null) {
    logger.fine("String_Node_Str");
    return null;
  }
  try {
    ConnectionHelper connection=new ConnectionHelper(credentials,null);
    return new SwarmBrowser(connection.getSwarm());
  }
 catch (  P4JavaException e) {
    logger.info("String_Node_Str");
    return null;
  }
}

Fixed version (ground truth):
public static P4Browser findBrowser(String scmCredential){
  StaplerRequest req=Stapler.getCurrentRequest();
  Job job=req == null ? null : req.findAncestorObject(Job.class);
  P4BaseCredentials credentials=job == null ? ConnectionHelper.findCredential(scmCredential,Jenkins.getActiveInstance()) : ConnectionHelper.findCredential(scmCredential,job);
  if (credentials == null) {
    logger.fine("String_Node_Str");
    return null;
  }
  try {
    ConnectionHelper connection=new ConnectionHelper(credentials,null);
    String url=connection.getSwarm();
    if (url != null) {
      return new SwarmBrowser(url);
    }
 else {
      return null;
    }
  }
 catch (  P4JavaException e) {
    logger.info("String_Node_Str");
    return null;
  }
}
Program: 142455
Project: 142455
Buggy source:
public ChangeLogHandler(Run<?,?> run,RepositoryBrowser<?> browser,String credential) throws P4JavaException {
  this.run=run;
  this.browser=browser;
  this.p4=new ConnectionHelper(run,credential,null);
  if (browser == null) {
    this.browser=new SwarmBrowser(p4.getSwarm());
  }
}

Fixed version (ground truth):
public ChangeLogHandler(Run<?,?> run,RepositoryBrowser<?> browser,String credential) throws P4JavaException {
  this.run=run;
  this.browser=browser;
  this.p4=new ConnectionHelper(run,credential,null);
  if (browser == null) {
    String url=p4.getSwarm();
    if (url != null) {
      this.browser=new SwarmBrowser(url);
    }
  }
}
Program: 142456
Project: 142456
Buggy source:
public String getSwarm() throws P4JavaException {
  GetPropertyOptions propOpts=new GetPropertyOptions();
  String key="String_Node_Str";
  propOpts.setName(key);
  List<IProperty> values=connection.getProperty(propOpts);
  for (  IProperty prop : values) {
    if (key.equals(prop.getName())) {
      String url=prop.getValue();
      if (url.endsWith("String_Node_Str")) {
        url=url.substring(0,url.length() - 1);
      }
      return url;
    }
  }
  return null;
}

Fixed version (ground truth):
public String getSwarm() throws P4JavaException {
  GetPropertyOptions propOpts=new GetPropertyOptions();
  String key="String_Node_Str";
  propOpts.setName(key);
  List<IProperty> values=connection.getProperty(propOpts);
  for (  IProperty prop : values) {
    if (key.equals(prop.getName())) {
      String url=prop.getValue();
      if (url != null && url.endsWith("String_Node_Str")) {
        url=url.substring(0,url.length() - 1);
      }
      return url;
    }
  }
  return null;
}
Program: 142457
Project: 142457
Buggy source:
public boolean approveReview(String id,ApproveState state,String description) throws Exception {
  if (id == null || id.isEmpty()) {
    p4.log("String_Node_Str");
    return false;
  }
  if ("String_Node_Str".equalsIgnoreCase(id)) {
    p4.log("String_Node_Str");
    return false;
  }
  String url=getApiUrl() + "String_Node_Str" + id+ "String_Node_Str";
  Map<String,Object> parameters=new HashedMap();
  parameters.put("String_Node_Str",state.getId());
  if (state.isCommit()) {
    parameters.put("String_Node_Str",true);
  }
  if (description != null && !description.isEmpty()) {
    parameters.put("String_Node_Str",description);
  }
  HttpResponse<JsonNode> res=Unirest.patch(url).basicAuth(user,ticket).fields(parameters).asJson();
  if (res.getStatus() != 200) {
    p4.log("String_Node_Str" + id + "String_Node_Str"+ state.getDescription());
    return true;
  }
 else {
    p4.log("String_Node_Str" + url + "String_Node_Str"+ res.getStatus());
    String error=res.getBody().getObject().getString("String_Node_Str");
    p4.log("String_Node_Str" + error);
    throw new SwarmException(res);
  }
}

Fixed version (ground truth):
public boolean approveReview(String id,ApproveState state,String description) throws Exception {
  if (id == null || id.isEmpty()) {
    p4.log("String_Node_Str");
    return false;
  }
  if ("String_Node_Str".equalsIgnoreCase(id)) {
    p4.log("String_Node_Str");
    return false;
  }
  String url=getApiUrl() + "String_Node_Str" + id+ "String_Node_Str";
  Map<String,Object> parameters=new HashedMap();
  parameters.put("String_Node_Str",state.getId());
  if (state.isCommit()) {
    parameters.put("String_Node_Str",true);
  }
  if (description != null && !description.isEmpty()) {
    parameters.put("String_Node_Str",description);
  }
  HttpResponse<JsonNode> res=Unirest.patch(url).basicAuth(user,ticket).fields(parameters).asJson();
  if (res.getStatus() == 200) {
    p4.log("String_Node_Str" + id + "String_Node_Str"+ state.getDescription());
    return true;
  }
 else {
    p4.log("String_Node_Str" + url + "String_Node_Str"+ res.getStatus());
    String error=res.getBody().getObject().getString("String_Node_Str");
    p4.log("String_Node_Str" + error);
    throw new SwarmException(res);
  }
}
Program: 142458
Project: 142458
Buggy source:
public static P4Browser findBrowser(String scmCredential){
  StaplerRequest req=Stapler.getCurrentRequest();
  Job job=req == null ? null : req.findAncestorObject(Job.class);
  P4BaseCredentials credentials=job == null ? ConnectionHelper.findCredential(scmCredential,Jenkins.getActiveInstance()) : ConnectionHelper.findCredential(scmCredential,job);
  if (credentials == null) {
    logger.fine("String_Node_Str");
    return null;
  }
  try {
    ConnectionHelper connection=new ConnectionHelper(credentials,null);
    return new SwarmBrowser(connection.getSwarm());
  }
 catch (  P4JavaException e) {
    logger.info("String_Node_Str");
    return null;
  }
}

Fixed version (ground truth):
public static P4Browser findBrowser(String scmCredential){
  StaplerRequest req=Stapler.getCurrentRequest();
  Job job=req == null ? null : req.findAncestorObject(Job.class);
  P4BaseCredentials credentials=job == null ? ConnectionHelper.findCredential(scmCredential,Jenkins.getActiveInstance()) : ConnectionHelper.findCredential(scmCredential,job);
  if (credentials == null) {
    logger.fine("String_Node_Str");
    return null;
  }
  try {
    ConnectionHelper connection=new ConnectionHelper(credentials,null);
    String url=connection.getSwarm();
    if (url != null) {
      return new SwarmBrowser(url);
    }
 else {
      return null;
    }
  }
 catch (  P4JavaException e) {
    logger.info("String_Node_Str");
    return null;
  }
}
Program: 142459
Project: 142459
Buggy source:
public ChangeLogHandler(Run<?,?> run,RepositoryBrowser<?> browser,String credential) throws P4JavaException {
  this.run=run;
  this.browser=browser;
  this.p4=new ConnectionHelper(run,credential,null);
  if (browser == null) {
    this.browser=new SwarmBrowser(p4.getSwarm());
  }
}

Fixed version (ground truth):
public ChangeLogHandler(Run<?,?> run,RepositoryBrowser<?> browser,String credential) throws P4JavaException {
  this.run=run;
  this.browser=browser;
  this.p4=new ConnectionHelper(run,credential,null);
  if (browser == null) {
    String url=p4.getSwarm();
    if (url != null) {
      this.browser=new SwarmBrowser(url);
    }
  }
}
Program: 142460
Project: 142460
Buggy source:
public String getSwarm() throws P4JavaException {
  GetPropertyOptions propOpts=new GetPropertyOptions();
  String key="String_Node_Str";
  propOpts.setName(key);
  List<IProperty> values=connection.getProperty(propOpts);
  for (  IProperty prop : values) {
    if (key.equals(prop.getName())) {
      String url=prop.getValue();
      if (url.endsWith("String_Node_Str")) {
        url=url.substring(0,url.length() - 1);
      }
      return url;
    }
  }
  return null;
}

Fixed version (ground truth):
public String getSwarm() throws P4JavaException {
  GetPropertyOptions propOpts=new GetPropertyOptions();
  String key="String_Node_Str";
  propOpts.setName(key);
  List<IProperty> values=connection.getProperty(propOpts);
  for (  IProperty prop : values) {
    if (key.equals(prop.getName())) {
      String url=prop.getValue();
      if (url != null && url.endsWith("String_Node_Str")) {
        url=url.substring(0,url.length() - 1);
      }
      return url;
    }
  }
  return null;
}
Program: 142461
Project: 142461
Buggy source:
public String getName(){
  String p=getPath();
  if (p.startsWith("String_Node_Str")) {
    p=p.substring("String_Node_Str".length());
    p=p.replaceAll("String_Node_Str","String_Node_Str");
  }
  String r=getRevision();
  if (r != null && r.startsWith("String_Node_Str")) {
    r=r.substring("String_Node_Str".length());
  }
  r=r.replaceAll("String_Node_Str","String_Node_Str");
  return p + "String_Node_Str" + r;
}

Fixed version (ground truth):
public String getName(){
  String p=getPath();
  if (p.startsWith("String_Node_Str")) {
    p=p.substring("String_Node_Str".length());
    p=p.replaceAll("String_Node_Str","String_Node_Str");
  }
  String r=getRevision();
  if (r != null) {
    if (r.startsWith("String_Node_Str")) {
      r=r.substring("String_Node_Str".length());
    }
    r=r.replaceAll("String_Node_Str","String_Node_Str");
  }
  return p + "String_Node_Str" + r;
}
Program: 142462
Project: 142462
Buggy source:
@Override protected P4Groovy run() throws Exception {
  GetP4 p4Groovy=new GetP4(step.getCredential(),step.getWorkspace());
  p4Groovy.perform(run,workspace,launcher,listener);
  return p4Groovy.getP4Groovy();
}

Fixed version (ground truth):
@Override protected P4Groovy run() throws Exception {
  GetP4 p4Groovy=new GetP4(step.getCredential(),step.getWorkspace());
  p4Groovy.perform(getContext().get(Run.class),getContext().get(FilePath.class),getContext().get(Launcher.class),getContext().get(TaskListener.class));
  return p4Groovy.getP4Groovy();
}
Program: 142463
Project: 142463
Buggy source:
public Identifier() throws IOException, XmlPullParserException {
  ResourceBundle bundle=ResourceBundle.getBundle("String_Node_Str");
  MavenXpp3Reader reader=new MavenXpp3Reader();
  Model model=reader.read(new FileReader("String_Node_Str"));
  version=model.getVersion();
  product=model.getArtifactId();
  String platform=System.getProperty("String_Node_Str");
  platform=platform.replaceAll("String_Node_Str","String_Node_Str");
  version+="String_Node_Str" + platform;
}

Fixed version (ground truth):
public Identifier() throws IOException, XmlPullParserException {
  MavenXpp3Reader reader=new MavenXpp3Reader();
  Model model=reader.read(new InputStreamReader(new FileInputStream("String_Node_Str"),"String_Node_Str"));
  version=model.getVersion();
  product=model.getArtifactId();
  String platform=System.getProperty("String_Node_Str");
  platform=platform.replaceAll("String_Node_Str","String_Node_Str");
  version+="String_Node_Str" + platform;
}
Program: 142464
Project: 142464
Buggy source:
@Override public RepositoryBrowser<?> guessBrowser(){
  String scmCredential=getCredential();
  if (scmCredential == null) {
    logger.fine("String_Node_Str");
    return null;
  }
  StaplerRequest req=Stapler.getCurrentRequest();
  if (req == null) {
    logger.fine("String_Node_Str");
    return null;
  }
  Job job=req.findAncestorObject(Job.class);
  if (req == null) {
    logger.fine("String_Node_Str");
    return null;
  }
  try {
    ConnectionHelper connection=new ConnectionHelper(job,scmCredential,null);
    String swarm=connection.getSwarm();
    URL url=new URL(swarm);
    return new SwarmBrowser(url);
  }
 catch (  MalformedURLException e) {
    logger.info("String_Node_Str");
    return null;
  }
catch (  P4JavaException e) {
    logger.info("String_Node_Str");
    return null;
  }
}

Fixed version (ground truth):
@Override public RepositoryBrowser<?> guessBrowser(){
  String scmCredential=getCredential();
  if (scmCredential == null) {
    logger.fine("String_Node_Str");
    return null;
  }
  StaplerRequest req=Stapler.getCurrentRequest();
  if (req == null) {
    logger.fine("String_Node_Str");
    return null;
  }
  Job job=req.findAncestorObject(Job.class);
  if (job == null) {
    logger.fine("String_Node_Str");
    return null;
  }
  try {
    ConnectionHelper connection=new ConnectionHelper(job,scmCredential,null);
    String swarm=connection.getSwarm();
    URL url=new URL(swarm);
    return new SwarmBrowser(url);
  }
 catch (  MalformedURLException e) {
    logger.info("String_Node_Str");
    return null;
  }
catch (  P4JavaException e) {
    logger.info("String_Node_Str");
    return null;
  }
}
Program: 142465
Project: 142465
Buggy source:
static public ListBoxModel doFillCredentialItems(Item project,String credentialsId){
  if (project == null && !Jenkins.getActiveInstance().hasPermission(Jenkins.ADMINISTER) || project != null && !project.hasPermission(Item.EXTENDED_READ)) {
    return new StandardListBoxModel().includeCurrentValue(credentialsId);
  }
  CredentialsMatchers.instanceOf(P4BaseCredentials.class);
  return new StandardListBoxModel().includeEmptyValue().includeMatchingAs(project instanceof Queue.Task ? Tasks.getAuthenticationOf((Queue.Task)project) : ACL.SYSTEM,project,P4BaseCredentials.class,Collections.<DomainRequirement>emptyList(),CredentialsMatchers.instanceOf(P4BaseCredentials.class));
}

Fixed version (ground truth):
@SuppressFBWarnings(value="String_Node_Str",justification="String_Node_Str") static public ListBoxModel doFillCredentialItems(Item project,String credentialsId){
  if (project == null && !Jenkins.getActiveInstance().hasPermission(Jenkins.ADMINISTER) || project != null && !project.hasPermission(Item.EXTENDED_READ)) {
    return new StandardListBoxModel().includeCurrentValue(credentialsId);
  }
  CredentialsMatchers.instanceOf(P4BaseCredentials.class);
  return new StandardListBoxModel().includeEmptyValue().includeMatchingAs(project instanceof Queue.Task ? Tasks.getAuthenticationOf((Queue.Task)project) : ACL.SYSTEM,project,P4BaseCredentials.class,Collections.<DomainRequirement>emptyList(),CredentialsMatchers.instanceOf(P4BaseCredentials.class));
}
Program: 142466
Project: 142466
Buggy source:
protected P4Revision getRevision(P4Head head,TaskListener listener) throws Exception {
  try (ClientHelper p4=new ClientHelper(credential,listener,ScmSourceClient,charset)){
    long change=p4.getHead(head.getPath() + "String_Node_Str");
    P4Revision revision=new P4Revision(head,change);
    return revision;
  }
 }

Fixed version (ground truth):
protected P4Revision getRevision(P4Head head,TaskListener listener) throws Exception {
  try (ClientHelper p4=new ClientHelper(credential,listener,scmSourceClient,charset)){
    long change=p4.getHead(head.getPath() + "String_Node_Str");
    P4Revision revision=new P4Revision(head,change);
    return revision;
  }
 }
Program: 142467
Project: 142467
Buggy source:
public P4Probe(String credential,TaskListener listener,String charset,String base){
  this.base=base;
  this.p4=new ClientHelper(credential,listener,ScmSourceClient,charset);
}

Fixed version (ground truth):
public P4Probe(String credential,TaskListener listener,String charset,String base){
  this.base=base;
  this.p4=new ClientHelper(credential,listener,scmSourceClient,charset);
}
Program: 142468
Project: 142468
Buggy source:
private List<P4Revision> listChanges(String ws) throws Exception {
  List<P4Revision> list=new ArrayList<P4Revision>();
  Descriptor<SCM> scm=Jenkins.getInstance().getDescriptor(PerforceScm.class);
  PerforceScm.DescriptorImpl p4scm=(PerforceScm.DescriptorImpl)scm;
  int CHANGE_COUNT_LIMIT=p4scm.getMaxChanges();
  GetChangelistsOptions opts=new GetChangelistsOptions();
  opts.setMaxMostRecent(CHANGE_COUNT_LIMIT);
  List<IFileSpec> spec=FileSpecBuilder.makeFileSpecList(ws);
  List<IChangelistSummary> cngs=connection.getChangelists(spec,opts);
  if (cngs != null) {
    for (    IChangelistSummary c : cngs) {
      if (c != null && c.getId() != -1) {
        P4Revision rev=new P4Revision(c.getId());
        if (!(list.contains(rev))) {
          list.add(rev);
        }
      }
    }
  }
  Collections.sort(list);
  Collections.reverse(list);
  return list;
}

Fixed version (ground truth):
private List<P4Revision> listChanges(String ws) throws Exception {
  List<P4Revision> list=new ArrayList<P4Revision>();
  GetChangelistsOptions opts=new GetChangelistsOptions();
  Jenkins j=Jenkins.getInstance();
  if (j != null) {
    Descriptor dsc=j.getDescriptor(PerforceScm.class);
    if (dsc instanceof PerforceScm.DescriptorImpl) {
      PerforceScm.DescriptorImpl p4scm=(PerforceScm.DescriptorImpl)dsc;
      int CHANGE_COUNT_LIMIT=p4scm.getMaxChanges();
      opts.setMaxMostRecent(CHANGE_COUNT_LIMIT);
    }
  }
  List<IFileSpec> spec=FileSpecBuilder.makeFileSpecList(ws);
  List<IChangelistSummary> cngs=connection.getChangelists(spec,opts);
  if (cngs != null) {
    for (    IChangelistSummary c : cngs) {
      if (c != null && c.getId() != -1) {
        P4Revision rev=new P4Revision(c.getId());
        if (!(list.contains(rev))) {
          list.add(rev);
        }
      }
    }
  }
  Collections.sort(list);
  Collections.reverse(list);
  return list;
}
Program: 142469
Project: 142469
Buggy source:
private List<P4Revision> listChanges(String ws) throws Exception {
  List<P4Revision> list=new ArrayList<P4Revision>();
  List<IFileSpec> spec=FileSpecBuilder.makeFileSpecList(ws);
  GetChangelistsOptions opts=new GetChangelistsOptions();
  opts.setMaxMostRecent(100);
  List<IChangelistSummary> cngs=connection.getChangelists(spec,opts);
  if (cngs != null) {
    for (    IChangelistSummary c : cngs) {
      if (c != null && c.getId() != -1) {
        if (!(list.contains(c.getId()))) {
          list.add(new P4Revision(c.getId()));
        }
      }
    }
  }
  Collections.sort(list);
  Collections.reverse(list);
  return list;
}

Fixed version (ground truth):
private List<P4Revision> listChanges(String ws) throws Exception {
  List<P4Revision> list=new ArrayList<P4Revision>();
  List<IFileSpec> spec=FileSpecBuilder.makeFileSpecList(ws);
  GetChangelistsOptions opts=new GetChangelistsOptions();
  opts.setMaxMostRecent(100);
  List<IChangelistSummary> cngs=connection.getChangelists(spec,opts);
  if (cngs != null) {
    for (    IChangelistSummary c : cngs) {
      if (c != null && c.getId() != -1) {
        P4Revision rev=new P4Revision(c.getId());
        if (!(list.contains(rev))) {
          list.add(rev);
        }
      }
    }
  }
  Collections.sort(list);
  Collections.reverse(list);
  return list;
}
Program: 142470
Project: 142470
Buggy source:
@Override public void buildEnvVars(AbstractBuild<?,?> build,Map<String,String> env){
  super.buildEnvVars(build,env);
  TagAction tagAction=build.getAction(TagAction.class);
  if (tagAction != null) {
    if (tagAction.getBuildChange() != null) {
      String change=getChangeNumber(tagAction);
      env.put("String_Node_Str",change);
    }
    if (tagAction.getClient() != null) {
      String client=tagAction.getClient();
      env.put("String_Node_Str",client);
    }
    if (tagAction.getPort() != null) {
      String port=tagAction.getPort();
      env.put("String_Node_Str",port);
    }
    if (tagAction.getUser() != null) {
      String user=tagAction.getUser();
      env.put("String_Node_Str",user);
    }
    Jenkins j=Jenkins.getInstance();
    if (j != null) {
      @SuppressWarnings("String_Node_Str") Descriptor<SCM> scm=j.getDescriptor(PerforceScm.class);
      DescriptorImpl p4scm=(DescriptorImpl)scm;
      if (tagAction.getTicket() != null && !p4scm.isHideTicket()) {
        String ticket=tagAction.getTicket();
        env.put("String_Node_Str",ticket);
      }
    }
    env.put("String_Node_Str",changelogFilename);
  }
}

Fixed version (ground truth):
@Override public void buildEnvVars(AbstractBuild<?,?> build,Map<String,String> env){
  super.buildEnvVars(build,env);
  TagAction tagAction=build.getAction(TagAction.class);
  if (tagAction != null) {
    if (tagAction.getBuildChange() != null) {
      String change=getChangeNumber(tagAction);
      env.put("String_Node_Str",change);
    }
    if (tagAction.getClient() != null) {
      String client=tagAction.getClient();
      env.put("String_Node_Str",client);
    }
    if (tagAction.getPort() != null) {
      String port=tagAction.getPort();
      env.put("String_Node_Str",port);
    }
    if (tagAction.getUser() != null) {
      String user=tagAction.getUser();
      env.put("String_Node_Str",user);
    }
    Jenkins j=Jenkins.getInstance();
    if (j != null) {
      @SuppressWarnings("String_Node_Str") Descriptor<SCM> scm=j.getDescriptor(PerforceScm.class);
      DescriptorImpl p4scm=(DescriptorImpl)scm;
      if (tagAction.getTicket() != null && !p4scm.isHideTicket()) {
        String ticket=tagAction.getTicket();
        env.put("String_Node_Str",ticket);
      }
    }
  }
}
Program: 142472
Project: 142472
Buggy source:
@Override public void buildEnvVars(AbstractBuild<?,?> build,Map<String,String> env){
  super.buildEnvVars(build,env);
  TagAction tagAction=build.getAction(TagAction.class);
  if (tagAction != null) {
    if (tagAction.getBuildChange() != null) {
      String change=getChangeNumber(tagAction);
      env.put("String_Node_Str",change);
    }
    if (tagAction.getClient() != null) {
      String client=tagAction.getClient();
      env.put("String_Node_Str",client);
    }
    if (tagAction.getPort() != null) {
      String port=tagAction.getPort();
      env.put("String_Node_Str",port);
    }
    if (tagAction.getUser() != null) {
      String user=tagAction.getUser();
      env.put("String_Node_Str",user);
    }
    Jenkins j=Jenkins.getInstance();
    if (j != null) {
      @SuppressWarnings("String_Node_Str") Descriptor<SCM> scm=j.getDescriptor(PerforceScm.class);
      DescriptorImpl p4scm=(DescriptorImpl)scm;
      if (tagAction.getTicket() != null && !p4scm.isHideTicket()) {
        String ticket=tagAction.getTicket();
        env.put("String_Node_Str",ticket);
      }
    }
    if (changelogFilename != null) {
      env.put("String_Node_Str",changelogFilename);
    }
 else {
      env.put("String_Node_Str","String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void buildEnvVars(AbstractBuild<?,?> build,Map<String,String> env){
  super.buildEnvVars(build,env);
  TagAction tagAction=build.getAction(TagAction.class);
  if (tagAction != null) {
    if (tagAction.getBuildChange() != null) {
      String change=getChangeNumber(tagAction);
      env.put("String_Node_Str",change);
    }
    if (tagAction.getClient() != null) {
      String client=tagAction.getClient();
      env.put("String_Node_Str",client);
    }
    if (tagAction.getPort() != null) {
      String port=tagAction.getPort();
      env.put("String_Node_Str",port);
    }
    if (tagAction.getUser() != null) {
      String user=tagAction.getUser();
      env.put("String_Node_Str",user);
    }
    Jenkins j=Jenkins.getInstance();
    if (j != null) {
      @SuppressWarnings("String_Node_Str") Descriptor<SCM> scm=j.getDescriptor(PerforceScm.class);
      DescriptorImpl p4scm=(DescriptorImpl)scm;
      if (tagAction.getTicket() != null && !p4scm.isHideTicket()) {
        String ticket=tagAction.getTicket();
        env.put("String_Node_Str",ticket);
      }
    }
    env.put("String_Node_Str",changelogFilename);
  }
}
Program: 142473
Project: 142473
Buggy source:
public void onChange(Saveable o,XmlFile xml){
  @SuppressWarnings("String_Node_Str") Descriptor<SCM> scm=Jenkins.getInstance().getDescriptor(PerforceScm.class);
  DescriptorImpl p4scm=(DescriptorImpl)scm;
  if (!p4scm.isAutoSave()) {
    return;
  }
  ClientHelper p4=null;
  try {
    String file=xml.getFile().getCanonicalPath();
    logger.info("String_Node_Str" + file);
    p4=getClientHelper(p4scm);
    p4.versionFile(file,"String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    p4.disconnect();
  }
}

Fixed version (ground truth):
public void onChange(Saveable o,XmlFile xml){
  Jenkins j=Jenkins.getInstance();
  if (j == null) {
    return;
  }
  @SuppressWarnings("String_Node_Str") Descriptor<SCM> scm=j.getDescriptor(PerforceScm.class);
  DescriptorImpl p4scm=(DescriptorImpl)scm;
  if (!p4scm.isAutoSave()) {
    return;
  }
  try {
    String file=xml.getFile().getCanonicalPath();
    logger.info("String_Node_Str" + file);
    ClientHelper p4=getClientHelper(p4scm);
    p4.versionFile(file,"String_Node_Str");
    p4.disconnect();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 142474
Project: 142474
Buggy source:
private ClientHelper getClientHelper(DescriptorImpl p4scm) throws Exception {
  LogTaskListener listener=new LogTaskListener(logger,Level.INFO);
  String credential=p4scm.getCredential();
  String clientName=p4scm.getClientName();
  String depotPath=p4scm.getDepotPath();
  depotPath=depotPath.endsWith("String_Node_Str") ? depotPath : depotPath + "String_Node_Str";
  String rootPath=Jenkins.getInstance().getRootDir().getCanonicalPath();
  StringBuffer view=new StringBuffer();
  view.append(depotPath + "String_Node_Str");
  view.append("String_Node_Str");
  view.append("String_Node_Str" + clientName + "String_Node_Str");
  WorkspaceSpec spec=new WorkspaceSpec(true,true,false,false,false,false,"String_Node_Str","String_Node_Str",view.toString());
  ManualWorkspaceImpl workspace=new ManualWorkspaceImpl("String_Node_Str",false,clientName,spec);
  workspace.setExpand(new HashMap<String,String>());
  workspace.setRootPath(rootPath);
  ClientHelper p4=new ClientHelper(credential,listener,clientName,"String_Node_Str");
  p4.setClient(workspace);
  return p4;
}

Fixed version (ground truth):
private ClientHelper getClientHelper(DescriptorImpl p4scm) throws Exception {
  LogTaskListener listener=new LogTaskListener(logger,Level.INFO);
  String credential=p4scm.getCredential();
  String clientName=p4scm.getClientName();
  String depotPath=p4scm.getDepotPath();
  depotPath=depotPath.endsWith("String_Node_Str") ? depotPath : depotPath + "String_Node_Str";
  Jenkins j=Jenkins.getInstance();
  if (j == null) {
    return null;
  }
  String rootPath=j.getRootDir().getCanonicalPath();
  StringBuffer view=new StringBuffer();
  view.append(depotPath + "String_Node_Str");
  view.append("String_Node_Str");
  view.append("String_Node_Str" + clientName + "String_Node_Str");
  WorkspaceSpec spec=new WorkspaceSpec(true,true,false,false,false,false,"String_Node_Str","String_Node_Str",view.toString());
  ManualWorkspaceImpl workspace=new ManualWorkspaceImpl("String_Node_Str",false,clientName,spec);
  workspace.setExpand(new HashMap<String,String>());
  workspace.setRootPath(rootPath);
  ClientHelper p4=new ClientHelper(credential,listener,clientName,"String_Node_Str");
  p4.setClient(workspace);
  return p4;
}
Program: 142476
Project: 142476
Buggy source:
@Override public void buildEnvVars(AbstractBuild<?,?> build,Map<String,String> env){
  super.buildEnvVars(build,env);
  TagAction tagAction=build.getAction(TagAction.class);
  if (tagAction != null) {
    if (tagAction.getBuildChange() != null) {
      String change=getChangeNumber(tagAction);
      env.put("String_Node_Str",change);
    }
    if (tagAction.getClient() != null) {
      String client=tagAction.getClient();
      env.put("String_Node_Str",client);
    }
    if (tagAction.getPort() != null) {
      String port=tagAction.getPort();
      env.put("String_Node_Str",port);
    }
    if (tagAction.getUser() != null) {
      String user=tagAction.getUser();
      env.put("String_Node_Str",user);
    }
    @SuppressWarnings("String_Node_Str") Descriptor<SCM> scm=Jenkins.getInstance().getDescriptor(PerforceScm.class);
    DescriptorImpl p4scm=(DescriptorImpl)scm;
    if (tagAction.getTicket() != null && !p4scm.isHideTicket()) {
      String ticket=tagAction.getTicket();
      env.put("String_Node_Str",ticket);
    }
  }
}

Fixed version (ground truth):
@Override public void buildEnvVars(AbstractBuild<?,?> build,Map<String,String> env){
  super.buildEnvVars(build,env);
  TagAction tagAction=build.getAction(TagAction.class);
  if (tagAction != null) {
    if (tagAction.getBuildChange() != null) {
      String change=getChangeNumber(tagAction);
      env.put("String_Node_Str",change);
    }
    if (tagAction.getClient() != null) {
      String client=tagAction.getClient();
      env.put("String_Node_Str",client);
    }
    if (tagAction.getPort() != null) {
      String port=tagAction.getPort();
      env.put("String_Node_Str",port);
    }
    if (tagAction.getUser() != null) {
      String user=tagAction.getUser();
      env.put("String_Node_Str",user);
    }
    Jenkins j=Jenkins.getInstance();
    if (j != null) {
      @SuppressWarnings("String_Node_Str") Descriptor<SCM> scm=j.getDescriptor(PerforceScm.class);
      DescriptorImpl p4scm=(DescriptorImpl)scm;
      if (tagAction.getTicket() != null && !p4scm.isHideTicket()) {
        String ticket=tagAction.getTicket();
        env.put("String_Node_Str",ticket);
      }
    }
  }
}
Program: 142477
Project: 142477
Buggy source:
@Override public URL getDiffLink(IFileSpec file) throws Exception {
  if (file.getAction() != FileAction.EDIT && file.getAction() != FileAction.INTEGRATE) {
    return null;
  }
  int r=new Integer(file.getEndRevision());
  if (r <= 1) {
    return null;
  }
  return new URL(url.toString() + file.getDepotPathString() + p4DiffEnd+ "String_Node_Str"+ (r - 1)+ "String_Node_Str"+ (r));
}

Fixed version (ground truth):
@Override public URL getDiffLink(IFileSpec file) throws Exception {
  if (file.getAction() != FileAction.EDIT && file.getAction() != FileAction.INTEGRATE) {
    return null;
  }
  int r=file.getEndRevision();
  if (r <= 1) {
    return null;
  }
  return new URL(url.toString() + file.getDepotPathString() + p4DiffEnd+ "String_Node_Str"+ (r - 1)+ "String_Node_Str"+ (r));
}
Program: 142478
Project: 142478
Buggy source:
@Override public URL getFileLink(IFileSpec file) throws Exception {
  int r=new Integer(file.getEndRevision());
  String path=file.getDepotPathString();
  path=path.replace("String_Node_Str","String_Node_Str");
  String rev="String_Node_Str" + r;
  return new URL(url.toString() + path + rev);
}

Fixed version (ground truth):
@Override public URL getFileLink(IFileSpec file) throws Exception {
  int r=file.getEndRevision();
  String path=file.getDepotPathString();
  path=path.replace("String_Node_Str","String_Node_Str");
  String rev="String_Node_Str" + r;
  return new URL(url.toString() + path + rev);
}
Program: 142479
Project: 142479
Buggy source:
public Date getDate(){
  return date;
}

Fixed version (ground truth):
public Date getDate(){
  return (Date)date.clone();
}
Program: 142481
Project: 142481
Buggy source:
@Override public void startElement(String uri,String localName,String qName,Attributes attributes) throws SAXException {
  if (qName.equalsIgnoreCase("String_Node_Str")) {
    text.setLength(0);
    return;
  }
  if (qName.equalsIgnoreCase("String_Node_Str")) {
    objects.push(new P4ChangeEntry(changeSet));
    text.setLength(0);
    return;
  }
  if (objects.peek() instanceof P4ChangeEntry) {
    P4ChangeEntry entry=(P4ChangeEntry)objects.peek();
    try {
      if (qName.equalsIgnoreCase("String_Node_Str")) {
        IFileSpec temp=new FileSpec();
        String safePath=attributes.getValue("String_Node_Str");
        String depotPath=URLDecoder.decode(safePath,"String_Node_Str");
        temp.setDepotPath(depotPath);
        String action=attributes.getValue("String_Node_Str");
        temp.setAction(FileAction.fromString(action));
        String strRev=attributes.getValue("String_Node_Str");
        int endRevision=new Integer(strRev);
        temp.setEndRevision(endRevision);
        entry.files.add(temp);
        text.setLength(0);
        return;
      }
      if (qName.equalsIgnoreCase("String_Node_Str")) {
        IFix temp=new Fix();
        String id=attributes.getValue("String_Node_Str");
        temp.setJobId(id);
        String status=attributes.getValue("String_Node_Str");
        temp.setStatus(status);
        entry.jobs.add(temp);
        text.setLength(0);
        return;
      }
    }
 catch (    Exception e) {
      entry=null;
    }
  }
  text.setLength(0);
}

Fixed version (ground truth):
@Override public void startElement(String uri,String localName,String qName,Attributes attributes) throws SAXException {
  if (qName.equalsIgnoreCase("String_Node_Str")) {
    text.setLength(0);
    return;
  }
  if (qName.equalsIgnoreCase("String_Node_Str")) {
    objects.push(new P4ChangeEntry(changeSet));
    text.setLength(0);
    return;
  }
  if (objects.peek() instanceof P4ChangeEntry) {
    P4ChangeEntry entry=(P4ChangeEntry)objects.peek();
    try {
      if (qName.equalsIgnoreCase("String_Node_Str")) {
        IFileSpec temp=new FileSpec();
        String safePath=attributes.getValue("String_Node_Str");
        String depotPath=URLDecoder.decode(safePath,"String_Node_Str");
        temp.setDepotPath(depotPath);
        String action=attributes.getValue("String_Node_Str");
        temp.setAction(FileAction.fromString(action));
        String strRev=attributes.getValue("String_Node_Str");
        int endRevision=Integer.parseInt(strRev);
        temp.setEndRevision(endRevision);
        entry.files.add(temp);
        text.setLength(0);
        return;
      }
      if (qName.equalsIgnoreCase("String_Node_Str")) {
        IFix temp=new Fix();
        String id=attributes.getValue("String_Node_Str");
        temp.setJobId(id);
        String status=attributes.getValue("String_Node_Str");
        temp.setStatus(status);
        entry.jobs.add(temp);
        text.setLength(0);
        return;
      }
    }
 catch (    UnsupportedEncodingException e) {
      entry=null;
    }
  }
  text.setLength(0);
}
Program: 142484
Project: 142484
Buggy source:
private void tidyPending(String path) throws Exception {
  TimeTask timer=new TimeTask();
  log("String_Node_Str");
  RevertFilesOptions rOpts=new RevertFilesOptions();
  List<IFileSpec> files=FileSpecBuilder.makeFileSpecList(path);
  List<IFileSpec> list=iclient.revertFiles(files,rOpts);
  validate.check(list,"String_Node_Str");
  log("String_Node_Str");
  for (  IFileSpec file : list) {
    if (file.getAction() == FileAction.ABANDONED) {
      String local=file.getLocalPathString();
      if (local == null) {
        local=depotToLocal(file);
      }
      if (local != null) {
        File unlink=new File(local);
        unlink.delete();
      }
    }
  }
  log("String_Node_Str" + timer.toString() + "String_Node_Str");
}

Fixed version (ground truth):
private void tidyPending(String path) throws Exception {
  TimeTask timer=new TimeTask();
  log("String_Node_Str");
  RevertFilesOptions rOpts=new RevertFilesOptions();
  List<IFileSpec> files=FileSpecBuilder.makeFileSpecList(path);
  List<IFileSpec> list=iclient.revertFiles(files,rOpts);
  validate.check(list,"String_Node_Str");
  log("String_Node_Str");
  for (  IFileSpec file : list) {
    if (file.getAction() == FileAction.ABANDONED) {
      String local=file.getLocalPathString();
      if (local == null) {
        local=depotToLocal(file);
      }
      if (local != null) {
        File unlink=new File(local);
        boolean ok=unlink.delete();
        if (!ok) {
          log("String_Node_Str" + local);
        }
      }
    }
  }
  log("String_Node_Str" + timer.toString() + "String_Node_Str");
}
Program: 142486
Project: 142486
Buggy source:
@CheckForNull public String getTicketValue(){
  return ticket.getTicketValue();
}

Fixed version (ground truth):
@CheckForNull public String getTicketValue(){
  return (ticket == null) ? "String_Node_Str" : ticket.getTicketValue();
}
Program: 142487
Project: 142487
Buggy source:
public boolean isTicketPathSet(){
  return ticket.isTicketPathSet();
}

Fixed version (ground truth):
public boolean isTicketPathSet(){
  return (ticket == null) ? false : ticket.isTicketPathSet();
}
Program: 142488
Project: 142488
Buggy source:
public boolean isTicketValueSet(){
  return ticket.isTicketValueSet();
}

Fixed version (ground truth):
public boolean isTicketValueSet(){
  return (ticket == null) ? false : ticket.isTicketValueSet();
}
Program: 142489
Project: 142489
Buggy source:
@CheckForNull public String getTicketPath(){
  return ticket.getTicketPath();
}

Fixed version (ground truth):
@CheckForNull public String getTicketPath(){
  return (ticket == null) ? "String_Node_Str" : ticket.getTicketPath();
}
Program: 142490
Project: 142490
Buggy source:
@DataBoundConstructor public TicketModeImpl(@CheckForNull String value,@CheckForNull String ticketValue,@CheckForNull String ticketPath){
  this.value=value;
  this.ticketValue=ticketValue;
  this.ticketPath=ticketPath;
}

Fixed version (ground truth):
@DataBoundConstructor public TicketModeImpl(String value,String ticketValue,String ticketPath){
  this.value=value;
  this.ticketValue=ticketValue;
  this.ticketPath=ticketPath;
}
Program: 142491
Project: 142491
Buggy source:
/** 
 * Construct workspace from environment and then look for changes.
 * @param envVars
 * @param listener
 * @return
 * @throws InterruptedException
 * @throws IOException
 */
private PollingResult pollWorkspace(EnvVars envVars,TaskListener listener,FilePath buildWorkspace) throws InterruptedException, IOException {
  PrintStream log=listener.getLogger();
  Node node=workspaceToNode(buildWorkspace);
  String nodeName=node.getNodeName();
  nodeName=(nodeName.isEmpty()) ? "String_Node_Str" : nodeName;
  envVars.put("String_Node_Str",envVars.get("String_Node_Str",nodeName));
  Workspace ws=(Workspace)workspace.clone();
  ws.setExpand(envVars);
  String client=ws.getFullName();
  log.println("String_Node_Str" + nodeName + "String_Node_Str"+ client);
  String pin=populate.getPin();
  if (pin != null && !pin.isEmpty()) {
    pin=ws.getExpand().format(pin,false);
    ws.getExpand().set(ReviewProp.LABEL.toString(),pin);
  }
  PollTask task=new PollTask(filter);
  task.setCredential(credential);
  task.setWorkspace(ws);
  task.setListener(listener);
  task.setLimit(pin);
  changes=buildWorkspace.act(task);
  if (!changes.isEmpty()) {
    return PollingResult.BUILD_NOW;
  }
  return PollingResult.NO_CHANGES;
}

Fixed version (ground truth):
/** 
 * Construct workspace from environment and then look for changes.
 * @param envVars
 * @param listener
 * @throws InterruptedException
 * @throws IOException
 */
private PollingResult pollWorkspace(EnvVars envVars,TaskListener listener,FilePath buildWorkspace) throws InterruptedException, IOException {
  PrintStream log=listener.getLogger();
  Node node=workspaceToNode(buildWorkspace);
  String nodeName=node.getNodeName();
  nodeName=(nodeName.isEmpty()) ? "String_Node_Str" : nodeName;
  envVars.put("String_Node_Str",envVars.get("String_Node_Str",nodeName));
  Workspace ws=(Workspace)workspace.clone();
  ws.setExpand(envVars);
  String client=ws.getFullName();
  log.println("String_Node_Str" + nodeName + "String_Node_Str"+ client);
  String pin=populate.getPin();
  if (pin != null && !pin.isEmpty()) {
    pin=ws.getExpand().format(pin,false);
    ws.getExpand().set(ReviewProp.LABEL.toString(),pin);
  }
  PollTask task=new PollTask(filter);
  task.setCredential(credential);
  task.setWorkspace(ws);
  task.setListener(listener);
  task.setLimit(pin);
  changes=buildWorkspace.act(task);
  if (!changes.isEmpty()) {
    return PollingResult.BUILD_NOW;
  }
  return PollingResult.NO_CHANGES;
}
Program: 142492
Project: 142492
Buggy source:
/** 
 * Helper: find the Remote/Local Computer used for build
 * @param workspace
 * @return
 */
private static Computer workspaceToComputer(FilePath workspace){
  Jenkins jenkins=Jenkins.getInstance();
  if (workspace != null && workspace.isRemote()) {
    for (    Computer computer : jenkins.getComputers()) {
      if (computer.getChannel() == workspace.getChannel()) {
        return computer;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Helper: find the Remote/Local Computer used for build
 * @param workspace
 */
private static Computer workspaceToComputer(FilePath workspace){
  Jenkins jenkins=Jenkins.getInstance();
  if (workspace != null && workspace.isRemote()) {
    for (    Computer computer : jenkins.getComputers()) {
      if (computer.getChannel() == workspace.getChannel()) {
        return computer;
      }
    }
  }
  return null;
}
Program: 142493
Project: 142493
Buggy source:
/** 
 * Helper: find the Node for slave build or return current instance.
 * @param workspace
 * @return
 */
private static Node workspaceToNode(FilePath workspace){
  Computer computer=workspaceToComputer(workspace);
  if (computer != null) {
    return computer.getNode();
  }
  Jenkins jenkins=Jenkins.getInstance();
  return jenkins;
}

Fixed version (ground truth):
/** 
 * Helper: find the Node for slave build or return current instance.
 * @param workspace
 */
private static Node workspaceToNode(FilePath workspace){
  Computer computer=workspaceToComputer(workspace);
  if (computer != null) {
    return computer.getNode();
  }
  Jenkins jenkins=Jenkins.getInstance();
  return jenkins;
}
Program: 142494
Project: 142494
Buggy source:
/** 
 * Called before a workspace is deleted on the given node, to provide SCM an opportunity to perform clean up.
 */
@Override public boolean processWorkspaceBeforeDeletion(Job<?,?> job,FilePath workspace,Node node) throws IOException, InterruptedException {
  logger.info("String_Node_Str");
  String scmCredential=getCredential();
  Run<?,?> run=job.getLastBuild();
  if (run == null) {
    logger.warning("String_Node_Str");
    return false;
  }
  String client="String_Node_Str";
  try {
    EnvVars envVars=run.getEnvironment(null);
    client=envVars.get("String_Node_Str");
  }
 catch (  Exception e) {
    logger.warning("String_Node_Str");
    return false;
  }
  ConnectionHelper connection=new ConnectionHelper(scmCredential,null);
  try {
    if (!connection.isClient(client)) {
      logger.warning("String_Node_Str" + client);
      return false;
    }
  }
 catch (  Exception e) {
    logger.warning("String_Node_Str");
    return false;
  }
  RemoveClientTask task=new RemoveClientTask(scmCredential,client,populate);
  boolean clean=workspace.act(task);
  logger.info("String_Node_Str" + clean);
  return clean;
}

Fixed version (ground truth):
/** 
 * Called before a workspace is deleted on the given node, to provide SCM an opportunity to perform clean up.
 */
@Override public boolean processWorkspaceBeforeDeletion(Job<?,?> job,FilePath workspace,Node node) throws IOException, InterruptedException {
  logger.info("String_Node_Str");
  String scmCredential=getCredential();
  Run<?,?> run=job.getLastBuild();
  if (run == null) {
    logger.warning("String_Node_Str");
    return false;
  }
  LogTaskListener listener=new LogTaskListener(logger,Level.INFO);
  EnvVars envVars=run.getEnvironment(listener);
  String client=envVars.get("String_Node_Str");
  if (client == null || client.isEmpty()) {
    logger.warning("String_Node_Str");
    return false;
  }
  ConnectionHelper connection=new ConnectionHelper(scmCredential,null);
  try {
    if (!connection.isClient(client)) {
      logger.warning("String_Node_Str" + client);
      return false;
    }
  }
 catch (  Exception e) {
    logger.warning("String_Node_Str");
    return false;
  }
  RemoveClientTask task=new RemoveClientTask(scmCredential,client,populate);
  boolean clean=workspace.act(task);
  logger.info("String_Node_Str" + clean);
  return clean;
}
Program: 142495
Project: 142495
Buggy source:
/** 
 * Determines the link to the diff between the version. in the  {@link PerforceChangeLogEntry.Change.File} to its previous version.
 * @return null if the browser doesn't have any URL for diff.
 */
public abstract URL getDiffLink(IFileSpec file) throws Exception ;

Fixed version (ground truth):
/** 
 * Determines the link to the diff between the version.
 * @return null if the browser doesn't have any URL for diff.
 */
public abstract URL getDiffLink(IFileSpec file) throws Exception ;
Program: 142496
Project: 142496
Buggy source:
/** 
 * Workaround for p4java bug. The 'setLocalSyntax(true)' option does not provide local syntax, so I have to use 'p4 where' to translate through the client view.
 * @param fileSpec
 * @return
 * @throws Exception
 */
private String depotToLocal(IFileSpec fileSpec) throws Exception {
  String depotPath=fileSpec.getDepotPathString();
  if (depotPath == null) {
    depotPath=fileSpec.getOriginalPathString();
  }
  if (depotPath == null) {
    return null;
  }
  List<IFileSpec> dSpec=FileSpecBuilder.makeFileSpecList(depotPath);
  List<IFileSpec> lSpec=iclient.where(dSpec);
  String path=lSpec.get(0).getLocalPathString();
  return path;
}

Fixed version (ground truth):
/** 
 * Workaround for p4java bug. The 'setLocalSyntax(true)' option does not provide local syntax, so I have to use 'p4 where' to translate through the client view.
 * @param fileSpec
 * @return Local syntax
 * @throws Exception
 */
private String depotToLocal(IFileSpec fileSpec) throws Exception {
  String depotPath=fileSpec.getDepotPathString();
  if (depotPath == null) {
    depotPath=fileSpec.getOriginalPathString();
  }
  if (depotPath == null) {
    return null;
  }
  List<IFileSpec> dSpec=FileSpecBuilder.makeFileSpecList(depotPath);
  List<IFileSpec> lSpec=iclient.where(dSpec);
  String path=lSpec.get(0).getLocalPathString();
  return path;
}
Program: 142497
Project: 142497
Buggy source:
/** 
 * Get the change number for the last change within the scope of the workspace view.
 * @return
 * @throws Exception
 */
public int getClientHead() throws Exception {
  String latestChange=connection.getCounter("String_Node_Str");
  int change=Integer.parseInt(latestChange);
  String ws="String_Node_Str" + iclient.getName() + "String_Node_Str";
  List<IFileSpec> files=FileSpecBuilder.makeFileSpecList(ws);
  GetChangelistsOptions opts=new GetChangelistsOptions();
  opts.setType(IChangelist.Type.SUBMITTED);
  opts.setMaxMostRecent(1);
  List<IChangelistSummary> list=connection.getChangelists(files,opts);
  if (!list.isEmpty() && list.get(0) != null) {
    change=list.get(0).getId();
  }
 else {
    log("String_Node_Str" + ws + "String_Node_Str"+ change);
  }
  return change;
}

Fixed version (ground truth):
/** 
 * Get the change number for the last change within the scope of the workspace view.
 * @return Perforce change
 * @throws Exception
 */
public int getClientHead() throws Exception {
  String latestChange=connection.getCounter("String_Node_Str");
  int change=Integer.parseInt(latestChange);
  String ws="String_Node_Str" + iclient.getName() + "String_Node_Str";
  List<IFileSpec> files=FileSpecBuilder.makeFileSpecList(ws);
  GetChangelistsOptions opts=new GetChangelistsOptions();
  opts.setType(IChangelist.Type.SUBMITTED);
  opts.setMaxMostRecent(1);
  List<IChangelistSummary> list=connection.getChangelists(files,opts);
  if (!list.isEmpty() && list.get(0) != null) {
    change=list.get(0).getId();
  }
 else {
    log("String_Node_Str" + ws + "String_Node_Str"+ change);
  }
  return change;
}