Source:
<code>public void onCreate() { LogManager.i(TAG, "beaconService version %s is starting up", BuildConfig.VERSION_NAME); bluetoothCrashResolver = new BluetoothCrashResolver(this); bluetoothCrashResolver.start(); mExecutor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() + 1); mCycledScanner = CycledLeScanner.createScanner(this, BeaconManager.DEFAULT_FOREGROUND_SCAN_PERIOD, BeaconManager.DEFAULT_FOREGROUND_BETWEEN_SCAN_PERIOD, mBackgroundFlag, mCycledLeScanCallback, bluetoothCrashResolver); beaconManager = BeaconManager.getInstanceForApplication(getApplicationContext()); if (beaconManager.getBeaconParsers() != null) { <START> beaconParsers.addAll(beaconManager.getBeaconParsers()); <END> for (BeaconParser beaconParser : beaconManager.getBeaconParsers()) { beaconParsers.addAll(beaconParser.getExtraDataParsers()); } } defaultDistanceCalculator = new ModelSpecificDistanceCalculator(this, BeaconManager.getDistanceModelUpdateUrl()); Beacon.setDistanceCalculator(defaultDistanceCalculator); monitoringStatus = MonitoringStatus.getInstanceForApplication(getApplicationContext()); try { Class klass = Class.forName("org.altbeacon.beacon.SimulatedScanData"); java.lang.reflect.Field f = klass.getField("beacons"); this.simulatedScanData = (List<Beacon>) f.get(null); } catch (ClassNotFoundException e) { LogManager.d(TAG, "No org.altbeacon.beacon.SimulatedScanData class exists."); } catch (Exception e) { LogManager.e(e, TAG, "Cannot get simulated Scan data. Make sure your org.altbeacon.beacon.SimulatedScanData class defines a field with the signature 'public static List<Beacon> beacons'"); } }</code><technical_language>making beaconParsers a Set instead of a List here? is custom hashCode defined for BeaconParser this do is identical objects added list. Is this a concern</technical_language>

Target:
public void onCreate() { LogManager.i(TAG, "beaconService version %s is starting up", BuildConfig.VERSION_NAME); bluetoothCrashResolver = new BluetoothCrashResolver(this); bluetoothCrashResolver.start(); mExecutor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() + 1); mCycledScanner = CycledLeScanner.createScanner(this, BeaconManager.DEFAULT_FOREGROUND_SCAN_PERIOD, BeaconManager.DEFAULT_FOREGROUND_BETWEEN_SCAN_PERIOD, mBackgroundFlag, mCycledLeScanCallback, bluetoothCrashResolver); beaconManager = BeaconManager.getInstanceForApplication(getApplicationContext()); boolean matchBeaconsByServiceUUID = true; if (beaconManager.getBeaconParsers() != null) { beaconParsers.addAll(beaconManager.getBeaconParsers()); for (BeaconParser beaconParser : beaconManager.getBeaconParsers()) { if (beaconParser.getExtraDataParsers().size() > 0) { matchBeaconsByServiceUUID = false; beaconParsers.addAll(beaconParser.getExtraDataParsers()); } } } mExtraDataBeaconTracker = new ExtraDataBeaconTracker(matchBeaconsByServiceUUID); defaultDistanceCalculator = new ModelSpecificDistanceCalculator(this, BeaconManager.getDistanceModelUpdateUrl()); Beacon.setDistanceCalculator(defaultDistanceCalculator); monitoringStatus = MonitoringStatus.getInstanceForApplication(getApplicationContext()); try { Class klass = Class.forName("org.altbeacon.beacon.SimulatedScanData"); java.lang.reflect.Field f = klass.getField("beacons"); this.simulatedScanData = (List<Beacon>) f.get(null); } catch (ClassNotFoundException e) { LogManager.d(TAG, "No org.altbeacon.beacon.SimulatedScanData class exists."); } catch (Exception e) { LogManager.e(e, TAG, "Cannot get simulated Scan data. Make sure your org.altbeacon.beacon.SimulatedScanData class defines a field with the signature 'public static List<Beacon> beacons'"); } }