Determines if a {@link android.bluetooth.BluetoothDevice} is a Bean based on its scan record
value.

@param scanRecord    The scanRecord provided by
{@link android.bluetooth.BluetoothAdapter.LeScanCallback}
@return              true if device is a Bean
506958
private boolean isBean(byte[] scanRecord) {
        List<UUID> uuids = parseUUIDs(scanRecord);
        return uuids.contains(BEAN_UUID);
    }
1023160
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    if (pvalue == null) {
      return true;
    }
    try {
      final Object field1Value = BeanPropertyReaderUtil.getNullSaveProperty(pvalue, field1Name);
      final Object field2Value = BeanPropertyReaderUtil.getNullSaveProperty(pvalue, field2Name);
      if (!smaller(field1Value, field2Value)) {
        switchContext(pcontext);
        return false;
      }
      return true;
    } catch (final Exception ignore) {
      switchContext(pcontext);
      return false;
    }
  }
905071
public ScanListener getScanListener()
    {
    	if (m_listener == null)
    	{
    		String strClassName = this.getProperty(LISTENER_CLASS);
    		if (strClassName == null)
    			strClassName = ReplaceScanListener.class.getName();
			m_listener = (ScanListener)ClassServiceUtility.getClassService().makeObjectFromClassName(strClassName);
			if (m_listener != null)
				((BaseScanListener)m_listener).init(this, null);
			else
				System.exit(0);
    	}
    	return m_listener;
    }
1305519
@TargetApi(Build.VERSION_CODES.FROYO)
    public static boolean hasBluetoothFeature(PackageManager manager) {
        return manager.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH);
    }
620569
@Override
    void setScanResult(final ScanResult scanResult) {
        super.setScanResult(scanResult);
        if (enumValue != null) {
            enumValue.setScanResult(scanResult);
        } else if (classRef != null) {
            classRef.setScanResult(scanResult);
        } else if (annotationInfo != null) {
            annotationInfo.setScanResult(scanResult);
        } else if (objectArrayValue != null) {
            for (final ObjectTypedValueWrapper anObjectArrayValue : objectArrayValue) {
                if (anObjectArrayValue != null) {
                    anObjectArrayValue.setScanResult(scanResult);
                }
            }
        }
    }
254639
public boolean beanDoesNotExistOrHasTimedOut(TimeoutElement elt, BeanId beanId) {
        if (elt == null) {
            // Not in the reaper list, but it might be in local
            // failover cache if not in reaper list.  So check it if
            // there is a local SfFailoverCache object (e.g. when SFSB
            // failover is enabled to use failover cache).
            if (ivSfFailoverCache != null) {
                // Not in reaper list, but SFSB failover enabled.
                // Have local SfFailoverCache determine if bean does not exist
                // or has timed out.
                return ivSfFailoverCache.beanDoesNotExistOrHasTimedOut(beanId);
            }

            // Return true since bean not found in reaper list
            // and SFSB failover is not enabled so not in failover
            // cache list.
            return true;
        }

        // SFSB found in reaper list, so return whether it
        // has timed out or not.
        return elt.isTimedOut(); // F61004.5
    }
1213826
public final boolean useLSD() //LIDB859-4
    {
        if (_isHome)
        {
            return true;
        }
        else
        {
            BeanMetaData bmd = home.getBeanMetaData(j2eeName);
            if (bmd.type == InternalConstants.TYPE_CONTAINER_MANAGED_ENTITY || // 126512
                bmd.type == InternalConstants.TYPE_SINGLETON_SESSION || // F743-508
                bmd.type == InternalConstants.TYPE_STATELESS_SESSION || // PQ81101
                bmd.type == InternalConstants.TYPE_BEAN_MANAGED_ENTITY || // 126512
                bmd.ivSFSBFailover) // d209849
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
647189
private boolean hasOperationOfType(SQLiteDatabaseSchema schema, MethodSpec.Builder methodBuilder, JQLType jqlType) {
		boolean hasOperation = false;
		for (SQLiteDaoDefinition daoDefinition : schema.getCollection()) {

			if (daoDefinition.getElement().getAnnotation(BindContentProviderPath.class) == null)
				continue;

			for (SQLiteModelMethod daoMethod : daoDefinition.getCollection()) {
				if (daoMethod.jql.operationType != jqlType) {
					continue;
				}
				if (!daoMethod.hasAnnotation(BindContentProviderEntry.class)) {
					continue;
				}

				hasOperation = true;
				// methodBuilder.addJavadoc("method $L.$L\n",
				// daoDefinition.getName(), daoMethod.getName());
			}
		}
		return hasOperation;
	}
1092023
public boolean remove(BeanId id) // d129562
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "remove (" + id + ")");

        TimeoutElement elt = null;

        elt = ivStatefulBeanList.remove(id);

        synchronized (this) {
            if (elt != null) {
                numObjects--;
                numRemoves++;

                if (numObjects == 0) { // F743-33394
                    stopAlarm();
                }
            } else {
                numNullRemoves++;
            }
        }

        boolean result = elt != null;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(tc, "remove (" + result + ")");
        return result; // d129562
    }
701353
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
    public static boolean hasBluetoothLEFeature(PackageManager manager) {
        return manager.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE);
    }
871221
public static DruidQueryRel fullScan(
      final LogicalTableScan scanRel,
      final RelOptTable table,
      final DruidTable druidTable,
      final QueryMaker queryMaker
  )
  {
    return new DruidQueryRel(
        scanRel.getCluster(),
        scanRel.getCluster().traitSetOf(Convention.NONE),
        table,
        druidTable,
        queryMaker,
        PartialDruidQuery.create(scanRel)
    );
  }
351941
public boolean hasBeanAsParameter() {
		TypeName entityTypeName = TypeUtility.typeName(this.getEntity().getElement());

		for (Pair<String, TypeName> item : this.parameters) {
			if (item.value1.equals(entityTypeName)) {
				return true;
			}
		}

		return false;
	}
1373006
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    final String valueAsString = Objects.toString(pvalue, null);

    if (StringUtils.isEmpty(valueAsString)) {
      // empty field is ok
      return true;
    }
    try {
      String countryCode =
          BeanPropertyReaderUtil.getNullSaveStringProperty(pvalue, this.fieldCountryCode);
      final String phoneNumber =
          BeanPropertyReaderUtil.getNullSaveStringProperty(pvalue, this.fieldPhoneNumber);
      if (StringUtils.isEmpty(phoneNumber)) {
        return true;
      }

      if (this.allowLowerCaseCountryCode) {
        countryCode = StringUtils.upperCase(countryCode);
      }
      this.phoneNumberUtil.setCountryCode(countryCode);
      final PhoneNumberData parsedNumber = this.phoneNumberUtil.parsePhoneNumber(phoneNumber);

      if (parsedNumber.isValid()) {
        if (this.allowDin5008 && (StringUtils.equals(phoneNumber,
            this.phoneNumberUtil.formatDin5008National(parsedNumber))
            || StringUtils.equals(phoneNumber,
                this.phoneNumberUtil.formatDin5008International(parsedNumber)))) {
          return true;
        }
        if (this.allowE123 && (StringUtils.equals(phoneNumber,
            this.phoneNumberUtil.formatE123National(parsedNumber))
            || StringUtils.equals(phoneNumber,
                this.phoneNumberUtil.formatE123International(parsedNumber)))) {
          return true;
        }
        if (this.allowUri
            && StringUtils.equals(phoneNumber, this.phoneNumberUtil.formatUrl(parsedNumber))) {
          return true;
        }
        if (this.allowMs
            && StringUtils.equals(phoneNumber, this.phoneNumberUtil.formatMs(parsedNumber))) {
          return true;
        }
        if (this.allowCommon && (StringUtils.equals(phoneNumber,
            this.phoneNumberUtil.formatCommonNational(parsedNumber))
            || StringUtils.equals(phoneNumber,
                this.phoneNumberUtil.formatCommonInternational(parsedNumber)))) {
          return true;
        }
      }
      this.switchContext(pcontext);
      return false;
    } catch (final Exception ignore) {
      this.switchContext(pcontext);
      return false;
    }
  }
450512
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public ScanRecord parseFromBytes(byte[] scanRecord) {
        if (scanRecord == null) {
            return null;
        }

        int currentPos = 0;
        int advertiseFlag = -1;
        List<ParcelUuid> serviceUuids = new ArrayList<ParcelUuid>();
        String localName = null;
        int txPowerLevel = Integer.MIN_VALUE;

        SparseArray<byte[]> manufacturerData = new SparseArray<>();
        Map<ParcelUuid, byte[]> serviceData = new HashMap<>();

        try {
            while (currentPos < scanRecord.length) {
                // length is unsigned int.
                int length = scanRecord[currentPos++] & 0xFF;
                if (length == 0) {
                    break;
                }
                // Note the length includes the length of the field type itself.
                int dataLength = length - 1;
                // fieldType is unsigned int.
                int fieldType = scanRecord[currentPos++] & 0xFF;
                switch (fieldType) {
                    case DATA_TYPE_FLAGS:
                        advertiseFlag = scanRecord[currentPos] & 0xFF;
                        break;
                    case DATA_TYPE_SERVICE_UUIDS_16_BIT_PARTIAL:
                    case DATA_TYPE_SERVICE_UUIDS_16_BIT_COMPLETE:
                        parseServiceUuid(scanRecord, currentPos,
                                dataLength, UUID_BYTES_16_BIT, serviceUuids);
                        break;
                    case DATA_TYPE_SERVICE_UUIDS_32_BIT_PARTIAL:
                    case DATA_TYPE_SERVICE_UUIDS_32_BIT_COMPLETE:
                        parseServiceUuid(scanRecord, currentPos, dataLength,
                                UUID_BYTES_32_BIT, serviceUuids);
                        break;
                    case DATA_TYPE_SERVICE_UUIDS_128_BIT_PARTIAL:
                    case DATA_TYPE_SERVICE_UUIDS_128_BIT_COMPLETE:
                        parseServiceUuid(scanRecord, currentPos, dataLength,
                                UUID_BYTES_128_BIT, serviceUuids);
                        break;
                    case DATA_TYPE_LOCAL_NAME_SHORT:
                    case DATA_TYPE_LOCAL_NAME_COMPLETE:
                        localName = new String(
                                extractBytes(scanRecord, currentPos, dataLength));
                        break;
                    case DATA_TYPE_TX_POWER_LEVEL:
                        txPowerLevel = scanRecord[currentPos];
                        break;
                    case DATA_TYPE_SERVICE_DATA:
                        // The first two bytes of the service data are service data UUID in little
                        // endian. The rest bytes are service data.
                        int serviceUuidLength = UUID_BYTES_16_BIT;
                        byte[] serviceDataUuidBytes = extractBytes(scanRecord, currentPos,
                                serviceUuidLength);
                        ParcelUuid serviceDataUuid = parseUuidFrom(serviceDataUuidBytes);
                        byte[] serviceDataArray = extractBytes(scanRecord,
                                currentPos + serviceUuidLength, dataLength - serviceUuidLength);
                        serviceData.put(serviceDataUuid, serviceDataArray);
                        break;
                    case DATA_TYPE_MANUFACTURER_SPECIFIC_DATA:
                        // The first two bytes of the manufacturer specific data are
                        // manufacturer ids in little endian.
                        int manufacturerId = ((scanRecord[currentPos + 1] & 0xFF) << 8)
                                + (scanRecord[currentPos] & 0xFF);
                        byte[] manufacturerDataBytes = extractBytes(scanRecord, currentPos + 2,
                                dataLength - 2);
                        manufacturerData.put(manufacturerId, manufacturerDataBytes);
                        break;
                    default:
                        // Just ignore, we don't handle such data type.
                        break;
                }
                currentPos += dataLength;
            }

            if (serviceUuids.isEmpty()) {
                serviceUuids = null;
            }
            return new ScanRecordImplCompat(serviceUuids, manufacturerData, serviceData,
                    advertiseFlag, txPowerLevel, localName, scanRecord);
        } catch (Exception e) {
            RxBleLog.e(e, "Unable to parse scan record: %s", LoggerUtil.bytesToHex(scanRecord));
            // As the record is invalid, ignore all the parsed results for this packet
            // and return an empty record with raw scanRecord bytes in results
            return new ScanRecordImplCompat(null, null, null, -1, Integer.MIN_VALUE, null, scanRecord);
        }
    }
298298
public boolean isCallerInRole(String roleName, Object bean)
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
        {
            Tr.entry(tc, "isCallerInRole, role = " + roleName
                         + " EJB = " + bean); //182011
        }

        // Check whether security is enabled or not. Note, the subclasses
        // do override this method to do additional processing and then they
        // call super.isCallerInRole which usually causes this code to
        // execute.  However, the subclass will throw IllegalStateException
        // (e.g. MessageDrivenBeanO) if not valid to call isCallerInRole.
        boolean inRole; //d444696.2
        EJBSecurityCollaborator<?> securityCollaborator = container.ivSecurityCollaborator;
        if (securityCollaborator == null) //d444696.2
        {
            // Security is disabled, so return false for 1.x and 2.x modules to
            // ensure pre EJB 3 applications see no behavior change. For EJB 3 modules
            // or later, return true so that we are consistent with web container.
            BeanMetaData bmd = home.beanMetaData;
            if (isTraceOn && tc.isDebugEnabled())
            {
                Tr.debug(tc, "isCallerInRole called with security disabled for EJB module version = "
                             + bmd.ivModuleVersion);
            }
            inRole = (bmd.ivModuleVersion >= BeanMetaData.J2EE_EJB_VERSION_3_0);
        }
        else //d444696.2
        {
            // Pass null EJSDeployedSupport for callback methods.            d739835
            EJSDeployedSupport s = bean == null ? null : EJSContainer.getMethodContext();

            try
            {
                inRole = isCallerInRole(securityCollaborator, roleName, s);
            } catch (RuntimeException ex)
            {
                FFDCFilter.processException(ex, CLASS_NAME + ".isCallerInRole", "982", this);
                if (isTraceOn && tc.isEntryEnabled())
                    Tr.exit(tc, "isCallerInRole collaborator throwing", ex);
                throw ex;
            }
        }

        if (isTraceOn && tc.isEntryEnabled()) //d444696.2
        {
            Tr.exit(tc, "isCallerInRole returning " + inRole);
        }
        return inRole; //d444696.2
    }
1305428
public static void traceEJBCallExit(String methodDesc)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        {
            StringBuffer sbuf = new StringBuffer();

            sbuf
                            .append(BeanLifeCycle_EJBCallExit_Type_Str).append(DataDelimiter)
                            .append(BeanLifeCycle_EJBCallExit_Type).append(DataDelimiter)
                            .append(methodDesc);

            Tr.debug(tc, sbuf.toString());
        }
    }
216640
public static boolean hasField(Class<?> beanClass, String name) throws SecurityException {
		return null != getField(beanClass, name);
	}