Generates code to push an initial version property value on the stack.

@throws SupportException if version type is not supported
512793
public static void initialVersion(CodeBuilder b, TypeDesc type, int value)
        throws SupportException
    {
        adjustVersion(b, type, value, false);
    }
44385
private void unsetVersionProperty(CodeBuilder b) throws SupportException {
        StorableProperty<?> property = mInfo.getVersionProperty();

        // Set the property state to uninitialized.
        {
            String stateFieldName =
                StorableGenerator.PROPERTY_STATE_FIELD_NAME + (property.getNumber() >> 4);
            b.loadThis();
            b.loadThis();
            b.loadField(stateFieldName, TypeDesc.INT);
            int shift = (property.getNumber() & 0xf) * 2;
            b.loadConstant(~(StorableGenerator.PROPERTY_STATE_MASK << shift));
            b.math(Opcode.IAND);
            b.storeField(stateFieldName, TypeDesc.INT);
        }

        // Zero the property value.
        TypeDesc type = TypeDesc.forClass(property.getType());
        b.loadThis();
        CodeBuilderUtil.blankValue(b, type);
        b.storeField(property.getName(), type);
    }
1121080
public void push(final V value) throws IndexOutOfBoundsException {
        if (top + locals >= values.length) {
            throw new IndexOutOfBoundsException(
                    "Insufficient maximum stack size.");
        }
        values[top++ + locals] = value;
    }
390684
private Versioned<Collection<byte[]>> toVersioned(
      MapEntryValues value) {
    return value == null
        ? new Versioned<>(Collections.emptyList(), -1)
        : new Versioned<>(value.values(), value.version());
  }
853168
protected void handleVersion(
      EntityDesc entityDesc, EntityPropertyDesc propertyDesc, ColumnMeta columnMeta) {
    if (isVersionAnnotatable(propertyDesc.getPropertyClassName())) {
      if (versionColumnNamePattern.matcher(columnMeta.getName()).matches()) {
        propertyDesc.setVersion(true);
      }
    }
  }
940325
public function pushValue($value)
    {
        $old = $this->value;
        if (!$this->stackable) {
            $this->setValue($value);
            return;
        }
        if (!is_array($this->value)) {
            $this->value = [$this->value, $value];
        } else {
            $f = false;
            foreach ($this->value as $k => $v) {
                if (!is_int($k)) {
                    $f = true;
                    break;
                }
            }
            if (!$f) {
                $this->value[] = $value;
            } else {
                $this->value = [$this->value, $value];
            }
        }
        $this->onUpdate($old);
    }
220150
private void setVersion(Object val) throws CertificateException {
        if (!(val instanceof CertificateVersion)) {
            throw new CertificateException("Version class type invalid.");
        }
        version = (CertificateVersion)val;
    }
663860
private void buildApplicationData(Context context) throws JSONException {
        app = new JSONObject();
        app.put("package", context.getPackageName());
        try {
            PackageInfo info = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
            app.put("versionCode", info.versionCode);
            app.put("versionName", info.versionName);
            // TODO firstInstallTime and lastUpdate
        } catch (NameNotFoundException e) {
            // Cannot happen as we're checking a know package.
        }
    }
165018
private void pushUIComponentClassicTagBase() {

        List<UIComponentClassicTagBase> list = TypedCollections.dynamicallyCastList((List)
                context.getAttributes().get(COMPONENT_TAG_STACK_ATTR), UIComponentClassicTagBase.class);
        if (list == null) {
            //noinspection CollectionWithoutInitialCapacity
            list = new ArrayList<UIComponentClassicTagBase>();
            context.getAttributes().put(COMPONENT_TAG_STACK_ATTR, list);
        }
        list.add(this);

    }
1087725
private static void initializeVersion() {
        InputStream inputStream = ClassLoaderHelper.getResourceAsStream(
                VERSION_INFO_FILE, true, VersionInfoUtils.class);
        Properties versionInfoProperties = new Properties();
        try {
            if (inputStream == null)
                throw new Exception(VERSION_INFO_FILE + " not found on classpath");

            versionInfoProperties.load(inputStream);
            version = versionInfoProperties.getProperty("version");
            platform = versionInfoProperties.getProperty("platform");
        } catch (Exception e) {
            log.info("Unable to load version information for the running SDK: " + e.getMessage());
            version = "unknown-version";
            platform = "java";
        } finally {
            closeQuietly(inputStream, log);
        }
    }
926895
protected void pushNewInstance(GeneratorAdapter generatorAdapter, Type typeToInstantiate) {
        generatorAdapter.newInstance(typeToInstantiate);
        generatorAdapter.dup();
        generatorAdapter.invokeConstructor(typeToInstantiate, METHOD_DEFAULT_CONSTRUCTOR);
    }
30261
@Override
    public VulnerableSoftware build() throws CpeValidationException {
        final VulnerableSoftware vs = new VulnerableSoftware(getPart(), getVendor(), getProduct(),
                getVersion(), getUpdate(), getEdition(),
                getLanguage(), getSwEdition(), getTargetSw(), getTargetHw(), getOther(),
                versionEndExcluding, versionEndIncluding, versionStartExcluding,
                versionStartIncluding, vulnerable);
        reset();
        return vs;
    }
135914
private void marshalVersionField() {
    PropertyMetadata versionMetadata = entityMetadata.getVersionMetadata();
    if (versionMetadata != null) {
      long version = (long) IntrospectionUtils.getFieldValue(versionMetadata, entity);
      ValueBuilder<?, ?, ?> valueBuilder = versionMetadata.getMapper().toDatastore(version + 1);
      valueBuilder.setExcludeFromIndexes(!versionMetadata.isIndexed());
      entityBuilder.set(versionMetadata.getMappedName(), valueBuilder.build());
    }
  }
1233262
void setInitializationData(Bundle contributingBundle, ServiceReference<?> urlConverterSR) {
		if (this.contributingBundle != null || this.urlConverterSR != null) {
			throw new IllegalStateException();
		}
		this.contributingBundle = contributingBundle;
		this.urlConverterSR = urlConverterSR;
	}
779842
public function processPreAdd($entity, $name, &$value, $locale=null, $hook=true, $silentException=false) {
		if($hook)
			$this->trigger('set', [$entity, $name, &$value, $locale]);

		if(!$this->hasProperty($name))
			return;

		if($this->property($name)->get('hooks.set')) {
			$hook  = $this->property($name)->get('hooks.set');
			$value = call_user_func_array($hook, [$value, $entity]);
		}

		$value = $this->property($name)->_doSet($value, $entity, $name, $silentException);
	}
742106
public function rewritingSelfVersionDependencies()
    {
        $composer = $this->embeddedComposer->createComposer($this->io);
        $package = $composer->getPackage();
        $configSource = new JsonConfigSource(new JsonFile('composer.json'));

        foreach (BasePackage::$supportedLinkTypes as $type => $meta) {
            foreach ($package->{'get'.$meta['method']}() as $link) {
                if ($link->getPrettyConstraint() === 'self.version') {
                    $configSource->addLink(
                        $type,
                        $link->getTarget(),
                        $package->getPrettyVersion()
                    );
                }
            }
        }
    }
988858
function(initialValue, settings) {

		this.value = initialValue;

		this._set = settings.set || this._set;
		this._get = settings.get || this._get;

		// This allows updater to be called without any arguments.
		// selfUpdater flag can be set by things that want to call updater themselves.
		if(!settings.__selfUpdater) {
			var self = this,
				oldUpdater = this.updater;
			this.updater = function() {
				oldUpdater.call(self, self._get(), self.value);
			};
		}


		this._on = settings.on ? settings.on : this._on;
		this._off = settings.off ? settings.off : this._off;
	}