nus-yam/ex-repair huggingface dataset:
Program: 41308
Project: 41308
Buggy source:
@Override public boolean start() throws Exception {
  LOGGER.log(Level.FINE,"String_Node_Str");
  FilePath workspace=getContext().get(FilePath.class);
  String podName=workspace.child(HOSTNAME_FILE).readToString().trim();
  String namespace=workspace.child(Config.KUBERNETES_NAMESPACE_PATH).readToString().trim();
  String containerName=step.getName();
  Node node=getContext().get(Node.class);
  if (!(node instanceof KubernetesSlave)) {
    throw new AbortException(String.format("String_Node_Str",node.getNodeName()));
  }
  KubernetesSlave slave=(KubernetesSlave)node;
  KubernetesCloud cloud=(KubernetesCloud)slave.getCloud();
  if (cloud == null) {
    throw new AbortException(String.format("String_Node_Str",slave.getCloudName()));
  }
  client=cloud.connect();
  decorator=new ContainerExecDecorator(client,podName,containerName,namespace);
  getContext().newBodyInvoker().withContext(BodyInvoker.mergeLauncherDecorators(getContext().get(LauncherDecorator.class),decorator)).withCallback(new ContainerExecCallback(decorator)).start();
  return false;
}

Fixed version (ground truth):
@Override public boolean start() throws Exception {
  LOGGER.log(Level.FINE,"String_Node_Str");
  FilePath workspace=getContext().get(FilePath.class);
  String podName=workspace.child(HOSTNAME_FILE).readToString().trim();
  String namespace=workspace.child(Config.KUBERNETES_NAMESPACE_PATH).readToString().trim();
  String containerName=step.getName();
  Node node=getContext().get(Node.class);
  if (!(node instanceof KubernetesSlave)) {
    throw new AbortException(String.format("String_Node_Str",node.getNodeName()));
  }
  KubernetesSlave slave=(KubernetesSlave)node;
  KubernetesCloud cloud=(KubernetesCloud)slave.getCloud();
  if (cloud == null) {
    throw new AbortException(String.format("String_Node_Str",slave.getCloudName()));
  }
  client=cloud.connect();
  decorator=new ContainerExecDecorator(client,podName,containerName,namespace);
  getContext().newBodyInvoker().withContext(BodyInvoker.mergeLauncherDecorators(getContext().get(LauncherDecorator.class),decorator)).withCallback(new ContainerExecCallback()).start();
  return false;
}
Program: 41309
Project: 41309
Buggy source:
private Object readResolve(){
  if ((serverCertificate != null) && !serverCertificate.startsWith("String_Node_Str")) {
    serverCertificate=new String(Base64.decodeBase64(serverCertificate.getBytes()));
    LOGGER.log(Level.INFO,"String_Node_Str",serverCertificate.substring(0,80));
  }
  return this;
}

Fixed version (ground truth):
private Object readResolve(){
  if ((serverCertificate != null) && !serverCertificate.startsWith("String_Node_Str")) {
    serverCertificate=new String(Base64.decodeBase64(serverCertificate.getBytes(UTF_8)),UTF_8);
    LOGGER.log(Level.INFO,"String_Node_Str",serverCertificate.substring(0,80));
  }
  return this;
}
Program: 41311
Project: 41311
Buggy source:
@DataBoundSetter public void setEnvVars(List<PodEnvVar> envVars){
  if (envVars != null) {
    this.envVars=new ArrayList<PodEnvVar>();
    this.addEnvVars(envVars);
  }
}

Fixed version (ground truth):
@DataBoundSetter public void setEnvVars(List<PodEnvVar> envVars){
  if (envVars != null) {
    this.envVars.clear();
    this.addEnvVars(envVars);
  }
}
Program: 41312
Project: 41312
Buggy source:
@DataBoundSetter public void setImagePullSecrets(List<PodImagePullSecret> imagePullSecrets){
  if (imagePullSecrets != null) {
    this.imagePullSecrets=new ArrayList<PodImagePullSecret>();
    this.addImagePullSecrets(imagePullSecrets);
  }
}

Fixed version (ground truth):
@DataBoundSetter public void setImagePullSecrets(List<PodImagePullSecret> imagePullSecrets){
  if (imagePullSecrets != null) {
    this.imagePullSecrets.clear();
    this.addImagePullSecrets(imagePullSecrets);
  }
}
Program: 41316
Project: 41316
Buggy source:
@Override public void write(int b) throws IOException {
  queue.add(b);
  byte[] bb=new byte[]{(byte)b};
  System.out.print(new String(bb));
}

Fixed version (ground truth):
@Override public void write(int b) throws IOException {
  queue.add(b);
  byte[] bb=new byte[]{(byte)b};
  System.out.print(new String(bb,StandardCharsets.UTF_8));
}
Program: 41317
Project: 41317
Buggy source:
@Override public void eventReceived(Action action,Pod resource){
switch (action) {
case MODIFIED:
    if (isContainerReady(resource,containerName)) {
      latch.countDown();
    }
  break;
default :
}
}

Fixed version (ground truth):
@Override public void eventReceived(Action action,Pod resource){
switch (action) {
case MODIFIED:
    if (isContainerReady(resource,containerName)) {
      latch.countDown();
    }
  break;
default :
break;
}
}
Program: 41318
Project: 41318
Buggy source:
@DataBoundSetter public void setIdleMinutes(int instanceCap){
  this.idleMinutes=idleMinutes;
}

Fixed version (ground truth):
@DataBoundSetter public void setIdleMinutes(int idleMinutes){
  this.idleMinutes=idleMinutes;
}
Program: 41320
Project: 41320
Buggy source:
@Override public Proc launch(ProcStarter starter) throws IOException {
  if (!waitUntilContainerIsReady()) {
    throw new IOException("String_Node_Str" + "String_Node_Str" + containerName + "String_Node_Str"+ podName+ "String_Node_Str"+ "String_Node_Str");
  }
  launcher.getListener().getLogger().println("String_Node_Str" + containerName + "String_Node_Str"+ podName+ "String_Node_Str");
  watch=client.pods().withName(podName).inContainer(containerName).redirectingInput().writingOutput(launcher.getListener().getLogger()).writingError(launcher.getListener().getLogger()).withTTY().usingListener(new ExecListener(){
    @Override public void onOpen(    Response response){
      alive.set(true);
      started.countDown();
    }
    @Override public void onFailure(    IOException e,    Response response){
      alive.set(false);
      e.printStackTrace(launcher.getListener().getLogger());
      started.countDown();
      finished.countDown();
    }
    @Override public void onClose(    int i,    String s){
      alive.set(false);
      started.countDown();
      finished.countDown();
    }
  }
).exec();
  waitQuietly(started);
  watch.getInput().write(("String_Node_Str" + path + NEWLINE).getBytes(StandardCharsets.UTF_8));
  doExec(watch,launcher.getListener().getLogger(),getCommands(starter));
  proc=new ContainerExecProc(watch,alive,finished);
  return proc;
}

Fixed version (ground truth):
@Override public Proc launch(ProcStarter starter) throws IOException {
  if (!waitUntilContainerIsReady()) {
    throw new IOException("String_Node_Str" + "String_Node_Str" + containerName + "String_Node_Str"+ podName+ "String_Node_Str"+ "String_Node_Str");
  }
  launcher.getListener().getLogger().println("String_Node_Str" + containerName + "String_Node_Str"+ podName+ "String_Node_Str");
  watch=client.pods().withName(podName).inContainer(containerName).redirectingInput().writingOutput(launcher.getListener().getLogger()).writingError(launcher.getListener().getLogger()).withTTY().usingListener(new ExecListener(){
    @Override public void onOpen(    Response response){
      alive.set(true);
      started.countDown();
    }
    @Override public void onFailure(    IOException e,    Response response){
      alive.set(false);
      e.printStackTrace(launcher.getListener().getLogger());
      started.countDown();
      finished.countDown();
    }
    @Override public void onClose(    int i,    String s){
      alive.set(false);
      started.countDown();
      finished.countDown();
    }
  }
).exec();
  waitQuietly(started);
  watch.getInput().write(String.format("String_Node_Str",path,NEWLINE).getBytes(StandardCharsets.UTF_8));
  doExec(watch,launcher.getListener().getLogger(),getCommands(starter));
  proc=new ContainerExecProc(watch,alive,finished);
  return proc;
}
Program: 41321
Project: 41321
Buggy source:
@BeforeClass public static void configureCloud() throws Exception {
  assumeMiniKube();
  cloud.setServerUrl(miniKubeUrl().toExternalForm());
  cloud.setNamespace("String_Node_Str");
  cloud.connect();
}

Fixed version (ground truth):
private void configureCloud(JenkinsRuleNonLocalhost r) throws Exception {
  URL url=r.getURL();
  URL nonLocalhostUrl=new URL(url.getProtocol(),InetAddress.getLocalHost().getHostAddress(),url.getPort(),url.getFile());
  JenkinsLocationConfiguration.get().setUrl(nonLocalhostUrl.toString());
  r.jenkins.clouds.add(cloud);
}
Program: 41322
Project: 41322
Buggy source:
@Test public void runInPod() throws Exception {
  URL url=r.getURL();
  URL nonLocalhostUrl=new URL(url.getProtocol(),InetAddress.getLocalHost().getHostAddress(),url.getPort(),url.getFile());
  JenkinsLocationConfiguration.get().setUrl(nonLocalhostUrl.toString());
  r.jenkins.clouds.add(cloud);
  WorkflowJob p=r.jenkins.createProject(WorkflowJob.class,"String_Node_Str");
  p.setDefinition(new CpsFlowDefinition("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",true));
  WorkflowRun b=p.scheduleBuild2(0).waitForStart();
  assertNotNull(b);
  r.assertBuildStatusSuccess(r.waitForCompletion(b));
  r.assertLogContains("String_Node_Str",b);
  r.assertLogContains("String_Node_Str",b);
  r.assertLogContains("String_Node_Str",b);
}

Fixed version (ground truth):
@Test public void runInPod() throws Exception {
  configureCloud(r);
  WorkflowJob p=r.jenkins.createProject(WorkflowJob.class,"String_Node_Str");
  p.setDefinition(new CpsFlowDefinition("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",true));
  WorkflowRun b=p.scheduleBuild2(0).waitForStart();
  assertNotNull(b);
  r.assertBuildStatusSuccess(r.waitForCompletion(b));
  r.assertLogContains("String_Node_Str",b);
  r.assertLogContains("String_Node_Str",b);
  r.assertLogContains("String_Node_Str",b);
}
Program: 41323
Project: 41323
Buggy source:
/** 
 * Connects to Docker.
 * @return Docker client.
 * @throws CertificateEncodingException
 */
public KubernetesClient connect() throws UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException, IOException, CertificateEncodingException {
  LOGGER.log(Level.FINE,"String_Node_Str" + name + "String_Node_Str"+ serverUrl);
  if (client == null) {
synchronized (this) {
      if (client != null)       return client;
      client=new KubernetesFactoryAdapter(serverUrl,serverCertificate,credentialsId,skipTlsVerify).createClient();
    }
  }
  return client;
}

Fixed version (ground truth):
/** 
 * Connects to Kubernetes.
 * @return Kubernetes client.
 */
@SuppressFBWarnings({"String_Node_Str","String_Node_Str"}) public KubernetesClient connect() throws UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException, IOException, CertificateEncodingException {
  LOGGER.log(Level.FINE,"String_Node_Str" + name + "String_Node_Str"+ serverUrl);
  if (client == null) {
synchronized (this) {
      if (client == null) {
        client=new KubernetesFactoryAdapter(serverUrl,serverCertificate,credentialsId,skipTlsVerify).createClient();
      }
    }
  }
  return client;
}
Program: 41326
Project: 41326
Buggy source:
@Override public void taskCompleted(Executor executor,Queue.Task task,long durationMS){
  Queue.Executable executable=executor.getCurrentExecutable();
  LOGGER.log(Level.FINE,"String_Node_Str" + this + "String_Node_Str");
  super.taskCompleted(executor,task,durationMS);
}

Fixed version (ground truth):
@Override public void taskCompleted(Executor executor,Queue.Task task,long durationMS){
  LOGGER.log(Level.FINE,"String_Node_Str" + this + "String_Node_Str");
  super.taskCompleted(executor,task,durationMS);
}
Program: 41327
Project: 41327
Buggy source:
private static String pemEncodeKey(Key key){
  return Base64.encodeBase64String(new StringBuilder().append("String_Node_Str").append(Base64.encodeBase64String(key.getEncoded())).append("String_Node_Str").toString().getBytes());
}

Fixed version (ground truth):
private static String pemEncodeKey(Key key){
  return Base64.encodeBase64String(new StringBuilder().append("String_Node_Str").append(Base64.encodeBase64String(key.getEncoded())).append("String_Node_Str").toString().getBytes(StandardCharsets.UTF_8));
}
Program: 41328
Project: 41328
Buggy source:
@Override protected void _terminate(TaskListener listener) throws IOException, InterruptedException {
  LOGGER.log(Level.INFO,"String_Node_Str",name);
  if (toComputer() == null) {
    LOGGER.log(Level.SEVERE,"String_Node_Str",name);
    return;
  }
  try {
    cloud.connect().pods().inNamespace(cloud.getNamespace()).withName(name).delete();
    LOGGER.log(Level.INFO,"String_Node_Str",name);
    toComputer().disconnect(OfflineCause.create(new Localizable(HOLDER,"String_Node_Str")));
    LOGGER.log(Level.INFO,"String_Node_Str",name);
  }
 catch (  Exception e) {
    LOGGER.log(Level.SEVERE,"String_Node_Str" + name,e);
  }
}

Fixed version (ground truth):
@Override protected void _terminate(TaskListener listener) throws IOException, InterruptedException {
  LOGGER.log(Level.INFO,"String_Node_Str",name);
  Computer computer=toComputer();
  if (computer == null) {
    LOGGER.log(Level.SEVERE,"String_Node_Str",name);
    return;
  }
  try {
    cloud.connect().pods().inNamespace(cloud.getNamespace()).withName(name).delete();
    LOGGER.log(Level.INFO,"String_Node_Str",name);
    computer.disconnect(OfflineCause.create(new Localizable(HOLDER,"String_Node_Str")));
    LOGGER.log(Level.INFO,"String_Node_Str",name);
  }
 catch (  Exception e) {
    LOGGER.log(Level.SEVERE,"String_Node_Str" + name,e);
  }
}
Program: 41330
Project: 41330
Buggy source:
public DescriptorImpl(){
  if (!new File("String_Node_Str").exists()) {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
@SuppressFBWarnings("String_Node_Str") public DescriptorImpl(){
  if (!new File(SERVICEACCOUNT_TOKEN_PATH).exists()) {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 41331
Project: 41331
Buggy source:
@Override public String getToken(String serviceAddress,String caCertData,boolean skipTlsVerify){
  try {
    return FileUtils.readFileToString(new File("String_Node_Str"));
  }
 catch (  IOException e) {
    return null;
  }
}

Fixed version (ground truth):
@Override @SuppressFBWarnings("String_Node_Str") public String getToken(String serviceAddress,String caCertData,boolean skipTlsVerify){
  try {
    return FileUtils.readFileToString(new File(SERVICEACCOUNT_TOKEN_PATH));
  }
 catch (  IOException e) {
    return null;
  }
}
Program: 41332
Project: 41332
Buggy source:
@Override public boolean start() throws Exception {
  Cloud cloud=Jenkins.getInstance().getCloud(step.getCloud());
  if (cloud instanceof KubernetesCloud) {
    KubernetesCloud kubernetesCloud=(KubernetesCloud)cloud;
    PodTemplate newTemplate;
    String name=String.format(NAME_FORMAT,UUID.randomUUID().toString().replaceAll("String_Node_Str","String_Node_Str"));
    PodTemplate podTemplate=StringUtils.isBlank(step.getInheritFrom()) ? null : kubernetesCloud.getTemplate(Label.get(step.getInheritFrom()));
    if (podTemplate != null) {
      newTemplate=new PodTemplate(podTemplate);
      newTemplate.getContainers().addAll(step.getContainers());
      for (      PodVolumes.PodVolume volume : step.getVolumes()) {
        String mountPath=volume.getMountPath();
        if (!PodVolumes.podVolumeExists(mountPath,podTemplate.getVolumes())) {
          newTemplate.getVolumes().add(volume);
        }
      }
    }
 else {
      newTemplate=new PodTemplate();
      newTemplate.setVolumes(step.getVolumes());
      newTemplate.setContainers(step.getContainers());
    }
    newTemplate.setLabel(step.getLabel());
    newTemplate.setName(name);
    kubernetesCloud.addTemplate(newTemplate);
    getContext().newBodyInvoker().withCallback(new PodTemplateCallback(newTemplate)).start();
    return false;
  }
 else {
    getContext().onFailure(new IllegalStateException("String_Node_Str" + step.getCloud() + "String_Node_Str"));
    return true;
  }
}

Fixed version (ground truth):
@Override public boolean start() throws Exception {
  Cloud cloud=Jenkins.getActiveInstance().getCloud(step.getCloud());
  if (cloud instanceof KubernetesCloud) {
    KubernetesCloud kubernetesCloud=(KubernetesCloud)cloud;
    PodTemplate newTemplate;
    String name=String.format(NAME_FORMAT,UUID.randomUUID().toString().replaceAll("String_Node_Str","String_Node_Str"));
    PodTemplate podTemplate=StringUtils.isBlank(step.getInheritFrom()) ? null : kubernetesCloud.getTemplate(Label.get(step.getInheritFrom()));
    if (podTemplate != null) {
      newTemplate=new PodTemplate(podTemplate);
      newTemplate.getContainers().addAll(step.getContainers());
      for (      PodVolumes.PodVolume volume : step.getVolumes()) {
        String mountPath=volume.getMountPath();
        if (!PodVolumes.podVolumeExists(mountPath,podTemplate.getVolumes())) {
          newTemplate.getVolumes().add(volume);
        }
      }
    }
 else {
      newTemplate=new PodTemplate();
      newTemplate.setVolumes(step.getVolumes());
      newTemplate.setContainers(step.getContainers());
    }
    newTemplate.setLabel(step.getLabel());
    newTemplate.setName(name);
    kubernetesCloud.addTemplate(newTemplate);
    getContext().newBodyInvoker().withCallback(new PodTemplateCallback(newTemplate)).start();
    return false;
  }
 else {
    getContext().onFailure(new IllegalStateException("String_Node_Str" + step.getCloud() + "String_Node_Str"));
    return true;
  }
}
Program: 41333
Project: 41333
Buggy source:
@Override protected void finished(StepContext context) throws Exception {
  Cloud cloud=Jenkins.getInstance().getCloud(step.getCloud());
  if (cloud instanceof KubernetesCloud) {
    KubernetesCloud kubernetesCloud=(KubernetesCloud)cloud;
    kubernetesCloud.removeTemplate(podTemplate);
  }
}

Fixed version (ground truth):
@Override protected void finished(StepContext context) throws Exception {
  Cloud cloud=Jenkins.getActiveInstance().getCloud(step.getCloud());
  if (cloud instanceof KubernetesCloud) {
    KubernetesCloud kubernetesCloud=(KubernetesCloud)cloud;
    kubernetesCloud.removeTemplate(podTemplate);
  }
}
Program: 41334
Project: 41334
Buggy source:
static String getSlaveName(PodTemplate template){
  String hex=Long.toHexString(System.nanoTime());
  String name=template.getName();
  if (name == null) {
    return hex;
  }
  name=template.getName().replace("String_Node_Str","String_Node_Str").toLowerCase();
  name=name.substring(0,Math.min(name.length(),256 - hex.length()));
  return String.format("String_Node_Str",name,hex);
}

Fixed version (ground truth):
static String getSlaveName(PodTemplate template){
  String hex=Long.toHexString(System.nanoTime());
  String name=template.getName();
  if (StringUtils.isEmpty(name)) {
    return hex;
  }
  name=template.getName().replace("String_Node_Str","String_Node_Str").toLowerCase();
  name=name.substring(0,Math.min(name.length(),256 - hex.length()));
  return String.format("String_Node_Str",name,hex);
}
Program: 41335
Project: 41335
Buggy source:
@DataBoundConstructor public PodTemplate(String name,String image,List<? extends PodVolume> volumes){
  Preconditions.checkArgument(!StringUtils.isBlank(image));
  this.name=name;
  this.image=image;
  this.volumes=(volumes == null) ? new ArrayList<PodVolume>() : new ArrayList<PodVolume>(volumes);
}

Fixed version (ground truth):
PodTemplate(String name,String image,List<? extends PodVolume> volumes){
  Preconditions.checkArgument(!StringUtils.isBlank(image));
  this.name=name;
  this.image=image;
  this.volumes=(volumes == null) ? new ArrayList<PodVolume>() : new ArrayList<PodVolume>(volumes);
}
Program: 41336
Project: 41336
Buggy source:
@Test public void testGetSlaveName(){
  List<? extends PodVolume> volumes=Collections.emptyList();
  assertTrue(KubernetesSlave.getSlaveName(new PodTemplate("String_Node_Str",volumes)).matches("String_Node_Str"));
  assertTrue(KubernetesSlave.getSlaveName(new PodTemplate("String_Node_Str","String_Node_Str",volumes)).matches("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testGetSlaveName(){
  List<? extends PodVolume> volumes=Collections.emptyList();
  assertTrue(KubernetesSlave.getSlaveName(new PodTemplate("String_Node_Str",volumes)).matches("String_Node_Str"));
  assertTrue(KubernetesSlave.getSlaveName(new PodTemplate("String_Node_Str","String_Node_Str",volumes)).matches("String_Node_Str"));
  assertTrue(KubernetesSlave.getSlaveName(new PodTemplate("String_Node_Str","String_Node_Str",volumes)).matches("String_Node_Str"));
}
Program: 41337
Project: 41337
Buggy source:
public FormValidation doTestConnection(@QueryParameter URL serverUrl,@QueryParameter String username,@QueryParameter String password) throws KubernetesClientException, URISyntaxException {
  RestFactory factory=new RestFactory(KubernetesCloud.class.getClassLoader());
  KubernetesAPIClientInterface client=new KubernetesApiClient(serverUrl.toString() + "String_Node_Str",username,password,factory);
  client.getAllPods();
  return FormValidation.ok("String_Node_Str");
}

Fixed version (ground truth):
public FormValidation doTestConnection(@QueryParameter URL serverUrl,@QueryParameter String username,@QueryParameter String password) throws KubernetesClientException, URISyntaxException {
  RestFactory factory=new RestFactory(KubernetesCloud.class.getClassLoader());
  KubernetesAPIClientInterface client=new KubernetesApiClient(serverUrl.toString(),username,password,factory);
  client.getAllPods();
  return FormValidation.ok("String_Node_Str");
}
Program: 41338
Project: 41338
Buggy source:
private String getControllerName(){
  String entry=form.getControllerName();
  if (null == entry || entry.isEmpty()) {
    return null;
  }
  if (entry.lastIndexOf('.') <= 0) {
    return entry;
  }
 else {
    return VerifyHelper.verifyClassName(entry.substring(entry.lastIndexOf('.') + 1));
  }
}

Fixed version (ground truth):
private String getControllerName(){
  String entry=form.getControllerName();
  if (null == entry || entry.isEmpty()) {
    return null;
  }
  String className=null;
  if (entry.lastIndexOf('.') <= 0) {
    className=entry;
  }
 else {
    className=VerifyHelper.verifyClassName(entry.substring(entry.lastIndexOf('.') + 1));
  }
  if (Character.isUpperCase(className.charAt(0))) {
    return className;
  }
 else {
    return (new StringBuilder()).append(Character.toUpperCase(className.charAt(0))).append(className.substring(1)).toString();
  }
}
Program: 41339
Project: 41339
Buggy source:
public String buildUrl(boolean isTemplatized){
  StringBuilder builder=new StringBuilder(base);
  for (  PathPart path : pathParts) {
    builder.append("String_Node_Str");
    if (isTemplatized) {
      builder.append(path.getTemplatizedPath());
    }
 else {
      builder.append(path.getPathValue());
    }
  }
  if (pathEndsWithSlash) {
    builder.append("String_Node_Str");
  }
  if (queries.size() > 0) {
    builder.append("String_Node_Str");
    for (    Query query : queries) {
      String queryString=query.getKey() + "String_Node_Str" + query.getValue()+ "String_Node_Str";
      builder.append(queryString);
    }
    if (queries.size() > 0) {
      builder.deleteCharAt(builder.length() - 1);
    }
  }
  Logger.info(getClass(),builder.toString());
  return builder.toString();
}

Fixed version (ground truth):
public String buildUrl(boolean isTemplatized){
  StringBuilder builder=new StringBuilder(base);
  for (  PathPart path : pathParts) {
    builder.append("String_Node_Str");
    if (isTemplatized) {
      builder.append(path.getTemplatizedPath());
    }
 else {
      builder.append(path.getEncodedValue());
    }
  }
  if (pathEndsWithSlash) {
    builder.append("String_Node_Str");
  }
  if (queries.size() > 0) {
    builder.append("String_Node_Str");
    for (    Query query : queries) {
      String queryString=query.getEncodedKey() + "String_Node_Str" + query.getEncodedValue()+ "String_Node_Str";
      builder.append(queryString);
    }
    if (queries.size() > 0) {
      builder.deleteCharAt(builder.length() - 1);
    }
  }
  Logger.info(getClass(),builder.toString());
  return builder.toString();
}
Program: 41340
Project: 41340
Buggy source:
public String getValue(){
  try {
    return java.net.URLEncoder.encode(value,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
catch (  NullPointerException ex) {
    ex.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
public String getValue(){
  return value;
}
Program: 41341
Project: 41341
Buggy source:
public PathPartPanel(PathParamCallBack callBack,PathPart pathPart){
  this.callBack=callBack;
  this.pathPart=pathPart;
  variableNameField.setText(pathPart.getVariableName());
  isVariableCheckBox.setSelected(pathPart.isTemplatized());
  this.pathPartField.setText(pathPart.getPathValue());
}

Fixed version (ground truth):
public PathPartPanel(PathParamCallBack callBack,PathPart pathPart){
  this.callBack=callBack;
  this.pathPart=pathPart;
  variableNameField.setText(pathPart.getVariableName());
  isVariableCheckBox.setSelected(pathPart.isTemplatized());
  this.pathPartField.setText(pathPart.getValue());
}
Program: 41342
Project: 41342
Buggy source:
public PathPart getPathPartField(){
  pathPart.setPathValue(this.pathPartField.getText());
  pathPart.setVariableName(variableNameField.getText());
  pathPart.setTemplatized(isVariableCheckBox.isSelected());
  return pathPart;
}

Fixed version (ground truth):
public PathPart getPathPartField(){
  pathPart.setValue(this.pathPartField.getText());
  pathPart.setVariableName(variableNameField.getText());
  pathPart.setTemplatized(isVariableCheckBox.isSelected());
  return pathPart;
}
Program: 41343
Project: 41343
Buggy source:
public void removeQueryParam(int index){
  queries.remove(index);
}

Fixed version (ground truth):
public void removeQueryParam(int index){
  if (index > -1 && index < queries.size()) {
    queries.remove(index);
  }
}
Program: 41344
Project: 41344
Buggy source:
public void removePathParam(int index){
  pathParts.remove(index);
}

Fixed version (ground truth):
public void removePathParam(int index){
  if (index > -1 && index < pathParts.size()) {
    pathParts.remove(index);
  }
}
Program: 41345
Project: 41345
Buggy source:
private void removeAllQueries(){
  for (  QueryPanel qp : queries) {
    deleted(qp);
  }
  queries.clear();
}

Fixed version (ground truth):
private void removeAllQueries(){
  for (  QueryPanel qp : new ArrayList<QueryPanel>(queries)) {
    deleted(qp);
  }
  queries.clear();
}
Program: 41346
Project: 41346
Buggy source:
private void clearFields(){
  baseUrlField.setText("String_Node_Str");
  removeAllPathes();
  removeAllQueries();
}

Fixed version (ground truth):
private void clearFields(){
  baseUrlField.setText("String_Node_Str");
  removeAllPaths();
  removeAllQueries();
}
Program: 41347
Project: 41347
Buggy source:
public void setUrl(final String url){
  if (url == null) {
    return;
  }
  if (null == parsedUrl || !parsedUrl.buildUrl(false).equals(url)) {
    parsedUrl=UrlParser.parseUrl(url);
    clearFields();
    baseUrlField.setText(parsedUrl.getBase());
    List<PathPart> pathPartList=parsedUrl.getPathParts();
    List<Query> queries=parsedUrl.getQueries();
    for (    PathPart aPathPart : pathPartList) {
      addPath(aPathPart);
    }
    for (    Query query : queries) {
      addQuery(query);
    }
  }
}

Fixed version (ground truth):
public void setUrl(final String url){
  if (url == null) {
    return;
  }
  if (null == parsedUrl || !parsedUrl.buildUrl(false).equals(url)) {
    parsedUrl=UrlParser.parseUrl(url);
    clearFields();
    parsedUrl=UrlParser.parseUrl(url);
    baseUrlField.setText(parsedUrl.getBase());
    List<PathPart> pathPartList=parsedUrl.getPathParts();
    List<Query> queries=parsedUrl.getQueries();
    for (    PathPart aPathPart : pathPartList) {
      addPath(aPathPart);
    }
    for (    Query query : queries) {
      addQuery(query);
    }
  }
}
Program: 41348
Project: 41348
Buggy source:
public static StringBuilder getErrorMessage(List<ValidationResultEntry> errors){
  StringBuilder errorMessage=new StringBuilder();
  for (  ValidationResultEntry error : errors) {
    errorMessage.append(error.getMessage()).append("String_Node_Str");
  }
  return errorMessage;
}

Fixed version (ground truth):
public static StringBuilder getErrorMessage(List<ValidationResultEntry> errors){
  StringBuilder errorMessage=new StringBuilder();
  for (  ValidationResultEntry error : errors) {
    errorMessage.append(null != error.getMessage() ? error.getMessage() : error.toString()).append("String_Node_Str");
  }
  return errorMessage;
}
Program: 41349
Project: 41349
Buggy source:
private boolean checkResponse(){
  boolean result=true;
  for (  MethodTabPanel methodTabPanel : tabManager.getTabs()) {
    String text=methodTabPanel.getResponse();
    BodyValidationResult validationResult=JSONValidator.validateBody(text);
    if (!validationResult.isValid()) {
      int okCancelResult=Messages.showOkCancelDialog(methodTabPanel,Rest2MobileMessages.getMessage(Rest2MobileMessages.VALIDATION_WARNING_QUESTION) + "String_Node_Str" + JSONValidator.getErrorMessage(validationResult.getErrors()),Rest2MobileMessages.getMessage(Rest2MobileMessages.VALIDATION_WARNING_TITLE),Rest2MobileMessages.getMessage(Rest2MobileMessages.VALIDATION_WARNING_CONTINUE),Rest2MobileMessages.getMessage(Rest2MobileMessages.VALIDATION_WARNING_CANCEL),null);
      result=okCancelResult == 0;
      break;
    }
  }
  return result;
}

Fixed version (ground truth):
private boolean checkResponse(){
  boolean result=true;
  for (  MethodTabPanel methodTabPanel : tabManager.getTabs()) {
    String text=methodTabPanel.getResponse();
    BodyValidationResult validationResult=JSONValidator.validateBody(text);
    if (!validationResult.isValid()) {
      int okCancelResult=Messages.showOkCancelDialog(contentPane,Rest2MobileMessages.getMessage(Rest2MobileMessages.VALIDATION_WARNING_QUESTION) + "String_Node_Str" + JSONValidator.getErrorMessage(validationResult.getErrors()),Rest2MobileMessages.getMessage(Rest2MobileMessages.VALIDATION_WARNING_TITLE),Rest2MobileMessages.getMessage(Rest2MobileMessages.VALIDATION_WARNING_CONTINUE),Rest2MobileMessages.getMessage(Rest2MobileMessages.VALIDATION_WARNING_CANCEL),null);
      result=okCancelResult == 0;
      break;
    }
  }
  return result;
}
Program: 41350
Project: 41350
Buggy source:
@Override public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
  this.setText((String)value);
  this.setWrapStyleWord(true);
  this.setLineWrap(true);
  setSize(table.getColumnModel().getColumn(column).getWidth(),getPreferredSize().height);
  if (table.getRowHeight(row) != getPreferredSize().height) {
    table.setRowHeight(row,getPreferredSize().height);
  }
  if (isSelected) {
    this.setBackground((Color)UIManager.get("String_Node_Str"));
    this.setForeground((Color)UIManager.get("String_Node_Str"));
    this.selectAll();
  }
  return this;
}

Fixed version (ground truth):
@Override public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
  this.setText((String)value);
  this.setWrapStyleWord(true);
  this.setLineWrap(true);
  setSize(table.getColumnModel().getColumn(column).getWidth(),getPreferredSize().height);
  if (table.getRowHeight(row) != getPreferredSize().height) {
    table.setRowHeight(row,getPreferredSize().height);
  }
  if (isSelected) {
    this.setBackground((Color)UIManager.get("String_Node_Str"));
    this.setForeground((Color)UIManager.get("String_Node_Str"));
    this.selectAll();
  }
 else {
    this.setBackground((Color)UIManager.get("String_Node_Str"));
    this.setForeground((Color)UIManager.get("String_Node_Str"));
  }
  return this;
}
Program: 41351
Project: 41351
Buggy source:
private void resetService(final Map<String,String> config){
  LOG.info("String_Node_Str" + config);
  resetSolrClients();
}

Fixed version (ground truth):
private void resetService(final Map<String,String> config){
  LOG.info("String_Node_Str" + config);
}
Program: 41352
Project: 41352
Buggy source:
@Override public void handleEvent(Event event){
  if (pageIsNotIndexable(event)) {
    return;
  }
  PageEvent pageEvent=PageEvent.fromEvent(event);
  if (null == pageEvent) {
    return;
  }
  Iterator<PageModification> modifications=pageEvent.getModifications();
  while (modifications.hasNext()) {
    PageModification modification=modifications.next();
    String modificationPath=modification.getPath();
    if (pageIsNotInObservedPath(modificationPath)) {
      return;
    }
    PageModification.ModificationType type=modification.getType();
    if (type == PageModification.ModificationType.DELETED) {
      LOG.info("String_Node_Str",modificationPath);
      indexService.deleteTreeAndCommit(modification.getPath());
      return;
    }
 else     if (type == PageModification.ModificationType.CREATED) {
      LOG.info("String_Node_Str",modificationPath);
      addOrUpdatePage(modification);
    }
 else     if (type == PageModification.ModificationType.MODIFIED) {
      LOG.info("String_Node_Str",modificationPath);
      addOrUpdatePage(modification);
    }
 else     if (type == PageModification.ModificationType.MOVED) {
      LOG.info("String_Node_Str",modificationPath,modification.getDestination());
      addOrUpdatePage(modification);
      indexService.deleteTreeAndCommit(modificationPath);
    }
 else {
      LOG.info("String_Node_Str",type);
    }
  }
}

Fixed version (ground truth):
@Override public void handleEvent(Event event){
  if (pageIsNotIndexable(event)) {
    return;
  }
  PageEvent pageEvent=PageEvent.fromEvent(event);
  if (null == pageEvent) {
    return;
  }
  Iterator<PageModification> modifications=pageEvent.getModifications();
  while (modifications.hasNext()) {
    PageModification modification=modifications.next();
    String modificationPath=modification.getPath();
    if (pageIsNotInObservedPath(modificationPath)) {
      return;
    }
    PageModification.ModificationType type=modification.getType();
    if (type == PageModification.ModificationType.DELETED) {
      LOG.info("String_Node_Str",modificationPath);
      indexService.deleteTreeAndCommit(modification.getPath());
    }
 else     if (type == PageModification.ModificationType.CREATED) {
      LOG.info("String_Node_Str",modificationPath);
      addOrUpdatePage(modification);
    }
 else     if (type == PageModification.ModificationType.MODIFIED) {
      LOG.info("String_Node_Str",modificationPath);
      addOrUpdatePage(modification);
    }
 else     if (type == PageModification.ModificationType.MOVED) {
      LOG.info("String_Node_Str",modificationPath,modification.getDestination());
      addOrUpdatePage(modification);
      indexService.deleteTreeAndCommit(modificationPath);
    }
 else {
      LOG.info("String_Node_Str",type);
    }
  }
}
Program: 41353
Project: 41353
Buggy source:
@Override public void handleEvent(Event event){
  if (pageIsNotIndexable(event)) {
    return;
  }
  PageEvent pageEvent=PageEvent.fromEvent(event);
  if (null == pageEvent) {
    return;
  }
  Iterator<PageModification> modifications=pageEvent.getModifications();
  while (modifications.hasNext()) {
    PageModification modification=modifications.next();
    String modificationPath=modification.getPath();
    if (pageIsNotInObservedPath(modificationPath)) {
      return;
    }
    PageModification.ModificationType type=modification.getType();
    if (type == PageModification.ModificationType.DELETED) {
      LOG.info("String_Node_Str",modificationPath);
      indexService.deleteAndCommit(modification.getPath());
      return;
    }
 else     if (type == PageModification.ModificationType.CREATED) {
      LOG.info("String_Node_Str",modificationPath);
      addOrUpdatePage(modification);
    }
 else     if (type == PageModification.ModificationType.MODIFIED) {
      LOG.info("String_Node_Str",modificationPath);
      addOrUpdatePage(modification);
    }
 else {
      LOG.info("String_Node_Str",type);
    }
  }
}

Fixed version (ground truth):
@Override public void handleEvent(Event event){
  if (pageIsNotIndexable(event)) {
    return;
  }
  PageEvent pageEvent=PageEvent.fromEvent(event);
  if (null == pageEvent) {
    return;
  }
  Iterator<PageModification> modifications=pageEvent.getModifications();
  while (modifications.hasNext()) {
    PageModification modification=modifications.next();
    String modificationPath=modification.getPath();
    if (pageIsNotInObservedPath(modificationPath)) {
      return;
    }
    PageModification.ModificationType type=modification.getType();
    if (type == PageModification.ModificationType.DELETED) {
      LOG.info("String_Node_Str",modificationPath);
      indexService.deleteAndCommit(modification.getPath());
      return;
    }
 else     if (type == PageModification.ModificationType.CREATED) {
      LOG.info("String_Node_Str",modificationPath);
      addOrUpdatePage(modification);
    }
 else     if (type == PageModification.ModificationType.MODIFIED) {
      LOG.info("String_Node_Str",modificationPath);
      addOrUpdatePage(modification);
    }
 else     if (type == PageModification.ModificationType.MOVED) {
      LOG.info("String_Node_Str",modificationPath,modification.getDestination());
      addOrUpdatePage(modification);
      indexService.deleteAndCommit(modificationPath);
    }
 else {
      LOG.info("String_Node_Str",type);
    }
  }
}
Program: 41354
Project: 41354
Buggy source:
protected void addOrUpdatePage(PageModification modification){
  final String modificationPath=modification.getPath();
  if (null == resourceResolver) {
    LOG.warn("String_Node_Str",modificationPath);
    return;
  }
  final Resource resource=resourceResolver.getResource(modificationPath);
  if (ResourceUtil.isNonExistingResource(resource)) {
    LOG.warn("String_Node_Str",modificationPath);
    return;
  }
  GeometrixxMediaContentType contentPage=GeometrixxMediaContentTypeFactory.getInstance(resource);
  indexService.addAndCommit(contentPage.getSolrDoc());
}

Fixed version (ground truth):
protected void addOrUpdatePage(PageModification modification){
  final String modificationPath=(modification.getType() == PageModification.ModificationType.MOVED) ? modification.getDestination() : modification.getPath();
  if (null == resourceResolver) {
    LOG.warn("String_Node_Str",modificationPath);
    return;
  }
  final Resource resource=resourceResolver.getResource(modificationPath);
  if (ResourceUtil.isNonExistingResource(resource)) {
    LOG.warn("String_Node_Str",modificationPath);
    return;
  }
  GeometrixxMediaContentType contentPage=GeometrixxMediaContentTypeFactory.getInstance(resource);
  indexService.addAndCommit(contentPage.getSolrDoc());
}
Program: 41357
Project: 41357
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  mSwipeCardEntry=(TestSwipeCardEntry)findViewById(R.id.swipecardentry);
  mPayButton=(Button)findViewById(R.id.paybutton);
  mSwipeCardEntry.setListener(new TestSwipeCardEntry.Listener(){
    @Override public void onCardEntryCompleted(    boolean completed){
      mPayButton.setEnabled(completed);
    }
  }
);
}
Program: 41359
Project: 41359
Buggy source:
private CardType guessCardType(CharSequence cardType){
  for (  CardType type : CardType.values()) {
    if (type.guess(cardType)) {
      return type;
    }
  }
  return CardType.MASTERCARD;
}

Fixed version (ground truth):
private CardType guessCardType(CharSequence cardType){
  for (  CardType type : CardType.values()) {
    if (type.guess(cardType)) {
      return type;
    }
  }
  return CardType.UNKNOWN;
}
Program: 41360
Project: 41360
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  mSwipeCardEntry=(TestSwipeCardEntry)findViewById(R.id.swipecardentry);
  mPayButton=(Button)findViewById(R.id.paybutton);
  mSwipeCardEntry.setListener(new TestSwipeCardEntry.Listener(){
    @Override public void onCardEntryCompleted(    boolean completed){
      mPayButton.setEnabled(completed);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  mSwipeCardEntry=(TestSwipeCardEntry)findViewById(R.id.swipecardentry);
  mSwipeCardEntry.setNumber("String_Node_Str");
  mPayButton=(Button)findViewById(R.id.paybutton);
  mSwipeCardEntry.setListener(new TestSwipeCardEntry.Listener(){
    @Override public void onCardEntryCompleted(    boolean completed){
      mPayButton.setEnabled(completed);
    }
  }
);
}
Program: 41362
Project: 41362
Buggy source:
void CardType(String guess,String whole,int length,int resource,int cvvResource,int[] breaks,int cvcLength){
  mPartial=Pattern.compile(guess);
  mWhole=Pattern.compile(whole);
  mLength=length;
  mResource=resource;
  mCVCResource=cvvResource;
  mBreaks=breaks;
  mCVCLength=cvcLength;
}

Fixed version (ground truth):
void CardType(String guess,String whole,int length,int resource,int cvvResource,int[] breaks,String cvcHint){
  mPartial=Pattern.compile(guess);
  mWhole=Pattern.compile(whole);
  mLength=length;
  mResource=resource;
  mCVCResource=cvvResource;
  mBreaks=breaks;
  mCVCLength=cvcHint.length();
  mCVCHint=cvcHint;
}
Program: 41364
Project: 41364
Buggy source:
private void validateNumber(){
  if (mCardType.validateNumber(mNumber)) {
    mMode=Mode.EXPIRYMONTH;
    mAnimator.start();
  }
 else {
    mError=true;
  }
}

Fixed version (ground truth):
private void validateNumber(){
  if (mCardType.validateNumber(mNumber)) {
    mMode=Mode.EXPIRYMONTH;
    final int numberLength=mCardType.mLength;
    final int lastBreakIndex=mCardType.mBreaks[mCardType.mBreaks.length - 1];
    final int fourNumberTextWidth=(int)mTextPaint.measureText(mNumber,lastBreakIndex,numberLength);
    final int expiryTextWidth=(int)mTextPaint.measureText(EXPIRY_HINT);
    final int cvcTextWidth=(int)mTextPaint.measureText(mCardType.mCVCHint);
    final int formattedNumberWidth=(int)mTextPaint.measureText(mNumberFormatted,0,mNumberFormatted.length());
    final int paddingLeft=getPaddingLeft();
    final int imageEndPosition=paddingLeft + mBitmap.getWidth() + (2 * IMAGE_BUFFER_PADDING);
    final int twelveNumberTextWidth=formattedNumberWidth - fourNumberTextWidth;
    final int wholeWidth=(getMeasuredWidth() + twelveNumberTextWidth) - (paddingLeft + getPaddingRight());
    mCVCOffset=wholeWidth - cvcTextWidth;
    final int leftPosition=(imageEndPosition + formattedNumberWidth);
    mExpiryOffset=(((mCVCOffset - leftPosition) - expiryTextWidth) / 2) + leftPosition;
    mAnimator.setFloatValues(0.0f,0 - twelveNumberTextWidth);
    mAnimator.start();
  }
 else {
    mError=true;
  }
}
Program: 41365
Project: 41365
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int verticalPadding=getPaddingTop() + getPaddingBottom();
  int horizontalPadding=getPaddingLeft() + getPaddingRight();
  int textHeight=(int)(mTextPaint.descent() - mTextPaint.ascent());
  int imageHeight=mBitmap.getHeight();
  int height=Math.max(textHeight,imageHeight);
  mTextOffsetY=(height - textHeight) / 2;
  height+=verticalPadding;
  int minimumTextWidth=(int)mTextPaint.measureText(NUMBER_HINT);
  int width=mBitmap.getWidth() + (2 * IMAGE_BUFFER_PADDING) + minimumTextWidth+ horizontalPadding;
  setMeasuredDimension(resolveSizeAndState(width,widthMeasureSpec,0),resolveSizeAndState(height,heightMeasureSpec,0));
  int fourNumberTextWidth=(int)mTextPaint.measureText(NUMBER_HINT,0,4);
  int expiryTextWidth=(int)mTextPaint.measureText(EXPIRY_HINT);
  int cvcTextWidth=(int)mTextPaint.measureText(CVC_HINT);
  mCVCOffset=minimumTextWidth - cvcTextWidth;
  int expirySpace=minimumTextWidth - (cvcTextWidth + fourNumberTextWidth);
  expirySpace=(expirySpace - expiryTextWidth) / 2;
  mExpiryOffset=expirySpace + fourNumberTextWidth;
  int twelveNumberTextWidth=minimumTextWidth - fourNumberTextWidth;
  mCVCOffset+=minimumTextWidth + expirySpace + getPaddingLeft();
  mExpiryOffset+=minimumTextWidth + expirySpace + getPaddingLeft();
  mAnimator.setFloatValues(0.0f,0 - twelveNumberTextWidth);
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int verticalPadding=getPaddingTop() + getPaddingBottom();
  int horizontalPadding=getPaddingLeft() + getPaddingRight();
  int textHeight=(int)(mTextPaint.descent() - mTextPaint.ascent());
  int imageHeight=mBitmap.getHeight();
  int height=Math.max(textHeight,imageHeight);
  mTextOffsetY=(height - textHeight) / 2;
  height+=verticalPadding;
  int minimumTextWidth=(int)mTextPaint.measureText(NUMBER_HINT);
  int width=mBitmap.getWidth() + (2 * IMAGE_BUFFER_PADDING) + minimumTextWidth+ horizontalPadding;
  setMeasuredDimension(resolveSizeAndState(width,widthMeasureSpec,0),resolveSizeAndState(height,heightMeasureSpec,0));
}
Program: 41366
Project: 41366
Buggy source:
/** 
 * Clears CVC, Expiry and Number fields and sets the number to the given parameter. If this is valid then we the state will move to expiry month to fill in the rest of the details.
 * @param number the number to fill in. (Not null)
 */
public void setNumber(String number){
  mNumber.clear();
  mMonth.clear();
  mYear.clear();
  mCVC.clear();
  mNumberFormatted.clear();
  mExpiryFormatted.clear();
  mCardType=CardType.UNKNOWN;
  mMode=Mode.NUMBER;
  mNumber.append(number);
  mNumberFormatted.append(number);
  if (mNumber.length() >= 2) {
    setCardType(guessCardType(mNumber));
  }
  for (int index=mCardType.mBreaks.length; --index >= 0; ) {
    int space=mCardType.mBreaks[index];
    if (mNumberFormatted.length() > space) {
      mNumberFormatted.insert(space,"String_Node_Str");
    }
  }
  if (mCardType.isCorrectLength(mNumber.length())) {
    validateNumber();
  }
  checkIsCompleted();
  postInvalidate();
}

Fixed version (ground truth):
/** 
 * Clears CVC, Expiry and Number fields and sets the number to the given parameter. If this is valid then we the state will move to expiry month to fill in the rest of the details.
 * @param number the number to fill in. (Not null)
 */
public void setNumber(String number){
  mNumber.clear();
  mMonth.clear();
  mYear.clear();
  mCVC.clear();
  mNumberFormatted.clear();
  mExpiryFormatted.clear();
  mCardType=CardType.UNKNOWN;
  mMode=Mode.NUMBER;
  mNumber.append(number);
  mNumberFormatted.append(number);
  if (mNumber.length() >= 2) {
    setCardType(guessCardType(mNumber.subSequence(0,2)));
  }
  for (int index=mCardType.mBreaks.length; --index >= 0; ) {
    int space=mCardType.mBreaks[index];
    if (mNumberFormatted.length() > space) {
      mNumberFormatted.insert(space,"String_Node_Str");
    }
  }
  if (mCardType.isCorrectLength(mNumber.length())) {
    validateNumber();
  }
  checkIsCompleted();
  postInvalidate();
}
Program: 41367
Project: 41367
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public String toString(){
  return contents;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public String toString(){
  StringBuffer buff=new StringBuffer("String_Node_Str");
  buff.append(contents);
  return buff.toString();
}