Program: 162714
Project: 162714
Buggy source:
/** 
 * Construct an iBeacon from a Bluetooth LE packet collected by Android's Bluetooth APIs
 * @param scanData The actual packet bytes
 * @param rssi The measured signal strength of the packet
 * @return An instance of an <code>IBeacon</code>
 */
public static IBeacon fromScanData(byte[] scanData,int rssi){
  int startByte=2;
  boolean patternFound=false;
  while (startByte <= 5) {
    if (((int)scanData[startByte] & 0xff) == 0x4c && ((int)scanData[startByte + 1] & 0xff) == 0x00 && ((int)scanData[startByte + 2] & 0xff) == 0x02 && ((int)scanData[startByte + 3] & 0xff) == 0x15) {
      patternFound=true;
      break;
    }
 else     if (((int)scanData[startByte] & 0xff) == 0x2d && ((int)scanData[startByte + 1] & 0xff) == 0x24 && ((int)scanData[startByte + 2] & 0xff) == 0xbf && ((int)scanData[startByte + 3] & 0xff) == 0x16) {
      IBeacon iBeacon=new IBeacon();
      iBeacon.major=0;
      iBeacon.minor=0;
      iBeacon.proximityUuid="String_Node_Str";
      iBeacon.txPower=-55;
      return iBeacon;
    }
    startByte++;
  }
  if (patternFound == false) {
    if (IBeaconManager.LOG_DEBUG)     Log.d(TAG,"String_Node_Str" + bytesToHex(scanData));
    return null;
  }
  IBeacon iBeacon=new IBeacon();
  iBeacon.major=(scanData[startByte + 20] & 0xff) * 0x100 + (scanData[startByte + 21] & 0xff);
  iBeacon.minor=(scanData[startByte + 22] & 0xff) * 0x100 + (scanData[startByte + 23] & 0xff);
  iBeacon.txPower=(int)scanData[startByte + 24];
  iBeacon.rssi=rssi;
  byte[] proximityUuidBytes=new byte[16];
  System.arraycopy(scanData,startByte + 4,proximityUuidBytes,0,16);
  String hexString=bytesToHex(proximityUuidBytes);
  StringBuilder sb=new StringBuilder();
  sb.append(hexString.substring(0,8));
  sb.append("String_Node_Str");
  sb.append(hexString.substring(8,12));
  sb.append("String_Node_Str");
  sb.append(hexString.substring(12,16));
  sb.append("String_Node_Str");
  sb.append(hexString.substring(16,20));
  sb.append("String_Node_Str");
  sb.append(hexString.substring(20,32));
  iBeacon.proximityUuid=sb.toString();
  return iBeacon;
}

Fixed version (ground truth):
/** 
 * Construct an iBeacon from a Bluetooth LE packet collected by Android's Bluetooth APIs
 * @param scanData The actual packet bytes
 * @param rssi The measured signal strength of the packet
 * @return An instance of an <code>IBeacon</code>
 */
public static IBeacon fromScanData(byte[] scanData,int rssi){
  int startByte=2;
  boolean patternFound=false;
  while (startByte <= 5) {
    if (((int)scanData[startByte] & 0xff) == 0x4c && ((int)scanData[startByte + 1] & 0xff) == 0x00 && ((int)scanData[startByte + 2] & 0xff) == 0x02 && ((int)scanData[startByte + 3] & 0xff) == 0x15) {
      patternFound=true;
      break;
    }
 else     if (((int)scanData[startByte] & 0xff) == 0x2d && ((int)scanData[startByte + 1] & 0xff) == 0x24 && ((int)scanData[startByte + 2] & 0xff) == 0xbf && ((int)scanData[startByte + 3] & 0xff) == 0x16) {
      if (IBeaconManager.LOG_DEBUG)       Log.d(TAG,"String_Node_Str");
      IBeacon iBeacon=new IBeacon();
      iBeacon.major=0;
      iBeacon.minor=0;
      iBeacon.proximityUuid="String_Node_Str";
      iBeacon.txPower=-55;
      return iBeacon;
    }
 else     if (((int)scanData[startByte] & 0xff) == 0xad && ((int)scanData[startByte + 1] & 0xff) == 0x77 && ((int)scanData[startByte + 2] & 0xff) == 0x00 && ((int)scanData[startByte + 3] & 0xff) == 0xc6) {
      if (IBeaconManager.LOG_DEBUG)       Log.d(TAG,"String_Node_Str");
      IBeacon iBeacon=new IBeacon();
      iBeacon.major=0;
      iBeacon.minor=0;
      iBeacon.proximityUuid="String_Node_Str";
      iBeacon.txPower=-55;
      return iBeacon;
    }
    startByte++;
  }
  if (patternFound == false) {
    if (IBeaconManager.LOG_DEBUG)     Log.d(TAG,"String_Node_Str" + bytesToHex(scanData));
    return null;
  }
  IBeacon iBeacon=new IBeacon();
  iBeacon.major=(scanData[startByte + 20] & 0xff) * 0x100 + (scanData[startByte + 21] & 0xff);
  iBeacon.minor=(scanData[startByte + 22] & 0xff) * 0x100 + (scanData[startByte + 23] & 0xff);
  iBeacon.txPower=(int)scanData[startByte + 24];
  iBeacon.rssi=rssi;
  byte[] proximityUuidBytes=new byte[16];
  System.arraycopy(scanData,startByte + 4,proximityUuidBytes,0,16);
  String hexString=bytesToHex(proximityUuidBytes);
  StringBuilder sb=new StringBuilder();
  sb.append(hexString.substring(0,8));
  sb.append("String_Node_Str");
  sb.append(hexString.substring(8,12));
  sb.append("String_Node_Str");
  sb.append(hexString.substring(12,16));
  sb.append("String_Node_Str");
  sb.append(hexString.substring(16,20));
  sb.append("String_Node_Str");
  sb.append(hexString.substring(20,32));
  iBeacon.proximityUuid=sb.toString();
  return iBeacon;
}