Program: 94565
Project: 94565
Buggy source:
public static boolean generate(){
  devices=new LinkedList<GPUDevice>();
  OS os=OS.getOS();
  String path=os.getCUDALib();
  if (path == null) {
    System.out.println("String_Node_Str");
    return false;
  }
  CUDA cudalib=null;
  try {
    cudalib=(CUDA)Native.loadLibrary(path,CUDA.class);
  }
 catch (  java.lang.UnsatisfiedLinkError e) {
    System.out.println("String_Node_Str" + path + "String_Node_Str");
    return false;
  }
catch (  java.lang.ExceptionInInitializerError e) {
    System.out.println("String_Node_Str" + e);
    return false;
  }
catch (  Exception e) {
    System.out.println("String_Node_Str" + e);
    return false;
  }
  int result=CUresult.CUDA_ERROR_UNKNOWN;
  result=cudalib.cuInit(0);
  if (result != CUresult.CUDA_SUCCESS) {
    System.out.println("String_Node_Str" + result + "String_Node_Str");
    if (result == CUresult.CUDA_ERROR_UNKNOWN) {
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str");
    }
    return false;
  }
  if (result == CUresult.CUDA_ERROR_NO_DEVICE) {
    return false;
  }
  IntByReference count=new IntByReference();
  result=cudalib.cuDeviceGetCount(count);
  if (result != CUresult.CUDA_SUCCESS) {
    System.out.println("String_Node_Str" + CUresult.stringFor(result) + "String_Node_Str");
    return false;
  }
  for (int num=0; num < count.getValue(); num++) {
    byte name[]=new byte[256];
    result=cudalib.cuDeviceGetName(name,256,num);
    if (result != CUresult.CUDA_SUCCESS) {
      System.out.println("String_Node_Str" + CUresult.stringFor(result) + "String_Node_Str");
      continue;
    }
    LongByReference ram=new LongByReference();
    try {
      result=cudalib.cuDeviceTotalMem_v2(ram,num);
    }
 catch (    UnsatisfiedLinkError e) {
      result=cudalib.cuDeviceTotalMem(ram,num);
    }
    if (result != CUresult.CUDA_SUCCESS) {
      System.out.println("String_Node_Str" + CUresult.stringFor(result) + "String_Node_Str");
      return false;
    }
    devices.add(new GPUDevice(new String(name).trim(),ram.getValue(),"String_Node_Str" + Integer.toString(num)));
  }
  return true;
}

Fixed version (ground truth):
public static boolean generate(){
  devices=new LinkedList<GPUDevice>();
  OS os=OS.getOS();
  String path=os.getCUDALib();
  if (path == null) {
    System.out.println("String_Node_Str");
    return false;
  }
  CUDA cudalib=null;
  try {
    cudalib=(CUDA)Native.loadLibrary(path,CUDA.class);
  }
 catch (  java.lang.UnsatisfiedLinkError e) {
    System.out.println("String_Node_Str" + path + "String_Node_Str");
    return false;
  }
catch (  java.lang.ExceptionInInitializerError e) {
    System.out.println("String_Node_Str" + e);
    return false;
  }
catch (  Exception e) {
    System.out.println("String_Node_Str" + e);
    return false;
  }
  int result=CUresult.CUDA_ERROR_UNKNOWN;
  result=cudalib.cuInit(0);
  if (result != CUresult.CUDA_SUCCESS) {
    System.out.println("String_Node_Str" + result + "String_Node_Str");
    if (result == CUresult.CUDA_ERROR_UNKNOWN) {
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str");
    }
    return false;
  }
  if (result == CUresult.CUDA_ERROR_NO_DEVICE) {
    return false;
  }
  IntByReference count=new IntByReference();
  result=cudalib.cuDeviceGetCount(count);
  if (result != CUresult.CUDA_SUCCESS) {
    System.out.println("String_Node_Str" + CUresult.stringFor(result) + "String_Node_Str");
    return false;
  }
  HashMap<Integer,GPUDevice> devicesWithPciId=new HashMap<Integer,GPUDevice>(count.getValue());
  for (int num=0; num < count.getValue(); num++) {
    IntByReference aDevice=new IntByReference();
    result=cudalib.cuDeviceGet(aDevice,num);
    if (result != CUresult.CUDA_SUCCESS) {
      System.out.println("String_Node_Str" + CUresult.stringFor(result) + "String_Node_Str");
      continue;
    }
    IntByReference pciBusId=new IntByReference();
    result=cudalib.cuDeviceGetAttribute(pciBusId,CUDeviceAttribute.CU_DEVICE_ATTRIBUTE_PCI_BUS_ID,aDevice.getValue());
    if (result != CUresult.CUDA_SUCCESS) {
      System.out.println("String_Node_Str" + CUresult.stringFor(result) + "String_Node_Str");
      continue;
    }
    byte name[]=new byte[256];
    result=cudalib.cuDeviceGetName(name,256,num);
    if (result != CUresult.CUDA_SUCCESS) {
      System.out.println("String_Node_Str" + CUresult.stringFor(result) + "String_Node_Str");
      continue;
    }
    LongByReference ram=new LongByReference();
    try {
      result=cudalib.cuDeviceTotalMem_v2(ram,num);
    }
 catch (    UnsatisfiedLinkError e) {
      result=cudalib.cuDeviceTotalMem(ram,num);
    }
    if (result != CUresult.CUDA_SUCCESS) {
      System.out.println("String_Node_Str" + CUresult.stringFor(result) + "String_Node_Str");
      return false;
    }
    devicesWithPciId.put(pciBusId.getValue(),new GPUDevice(new String(name).trim(),ram.getValue(),"String_Node_Str"));
  }
  int i=0;
  for (  HashMap.Entry<Integer,GPUDevice> entry : devicesWithPciId.entrySet()) {
    GPUDevice aDevice=entry.getValue();
    aDevice.setCudaName("String_Node_Str" + Integer.toString(i));
    devices.add(aDevice);
    i++;
  }
  return true;
}