Generates code to increment a version property value, already on the stack.

@throws SupportException if version type is not supported
543558
public static void incrementVersion(CodeBuilder b, TypeDesc type)
        throws SupportException
    {
        adjustVersion(b, type, 0, true);
    }
1237071
protected function validateAndCompleteVersionFieldMapping(VersionFieldMetadata $property)
    {
        $this->versionProperty = $property;

        $options = $property->getOptions();

        if (isset($options['default'])) {
            return;
        }

        if (in_array($property->getTypeName(), ['integer', 'bigint', 'smallint'], true)) {
            $property->setOptions(array_merge($options, ['default' => 1]));

            return;
        }

        if (in_array($property->getTypeName(), ['datetime', 'datetime_immutable', 'datetimetz', 'datetimetz_immutable'], true)) {
            $property->setOptions(array_merge($options, ['default' => 'CURRENT_TIMESTAMP']));

            return;
        }

        throw MappingException::unsupportedOptimisticLockingType($property->getType());
    }
1366328
protected function setReleaseVersion()
    {
        try {
            $currentVersion = Context::get('version-persister')->getCurrentVersion();
        } catch (\Exception $e) {
            $currentVersion = Context::get('version-generator')->getInitialVersion();
        }

        $this->releaseVersion = Context::get('version-generator')->generateNextVersion($currentVersion);
    }
707520
public function initializeUpdateAction()
    {
        $propertyMappingConfiguration = $this->arguments->getArgument('workspace')->getPropertyMappingConfiguration();
        $propertyMappingConfiguration->allowProperties('name', 'baseWorkspace');
        $propertyMappingConfiguration->setTypeConverterOption(PersistentObjectConverter::class, PersistentObjectConverter::CONFIGURATION_MODIFICATION_ALLOWED, true);
    }
618142
public function Upgrade172to181()
    {
        $this->_batch->addTask('Db_CreateNewTables');
        $this->_batch->addTask('Db_AddPatches', 59);

        $this->_batch->addTask('Echo', $this->_('Make sure to read the changelog as it contains important instructions'));
        $this->_batch->addTask('Echo', $this->_('Check the Code compatibility report for any issues with project specific code!'));

        return true;
    }
994902
private function setProjectVersionProperties()
  {
    if ($this->myVersionProperty)
    {
      $this->project->setProperty($this->myVersionProperty, $this->myNewVersion['version']);
    }

    if ($this->myReleaseProperty)
    {
      $this->project->setProperty($this->myReleaseProperty, $this->myNewVersion['release']);
    }
    if ($this->myPreReleaseProperty)
    {
      $this->project->setProperty($this->myPreReleaseProperty, $this->myNewVersion['pre-release']);
    }


    if ($this->myMajorProperty)
    {
      $this->project->setProperty($this->myMajorProperty, $this->myNewVersion['major']);
    }
    if ($this->myMinorProperty)
    {
      $this->project->setProperty($this->myMinorProperty, $this->myNewVersion['minor']);
    }
    if ($this->myPatchProperty)
    {
      $this->project->setProperty($this->myPatchProperty, $this->myNewVersion['patch']);
    }
  }
258678
public void setVersion(int major, int minor)
        throws IllegalArgumentException {

        if (major != JDK1_1_MAJOR_VERSION ||
            minor != JDK1_1_MINOR_VERSION) {

            throw new IllegalArgumentException("Version " + major + ", " +
                                               minor + " is not supported");
        }

        mMajorVersion = major;
        mMinorVersion = minor;
    }
136543
public void setVersion(int major, int minor) {
        if (major > 65535 || minor > 65535) {
            throw new IllegalArgumentException("Version number element cannot exceed 65535");
        }

        mVersion = (minor << 16) | (major & 0xffff);

        String target;
        switch (major) {
        default:
            target = null;
            break;
        case 45:
            target = minor == 3 ? "1.0" : null;
            break;
        case 46:
            target = minor == 0 ? "1.2" : null;
            break;
        case 47:
            target = minor == 0 ? "1.3" : null;
            break;
        case 48:
            target = minor == 0 ? "1.4" : null;
            break;
        case 49:
            target = minor == 0 ? "1.5" : null;
            break;
        case 50:
            target = minor == 0 ? "1.6" : null;
            break;
        case 51:
            target = minor == 0 ? "1.7" : null;
            break;
        }

        mTarget = target;
    }
207337
def increment_api_version_string(api_version_string: nil, increment_by: :patch)
      versions = api_version_string.split(".")
      major = versions[0].to_i
      minor = versions[1].to_i
      patch = versions[2].to_i

      case increment_by
      when :patch
        patch += 1
      when :minor
        minor += 1
        patch = 0
      when :major
        major += 1
        minor = 0
        patch = 0
      end

      new_version_string = [major, minor, patch].join(".")
      return new_version_string
    end
299200
public static void setVersion(Object object, int version) {
		try {
			Field versionField = object.getClass().getField("version");
			versionField.set(object, version);
		} catch (NoSuchFieldException | SecurityException | IllegalAccessException e) {
			throw new RuntimeException(e);
		}
	}
1083402
function checkIfVersionUpdated() {

        var latestBuildNumber = updateJsonHandler.get("latestBuildNumber"),
            currentBuildNumber = Number(/-([0-9]+)/.exec(brackets.metadata.version)[1]);

        return latestBuildNumber === currentBuildNumber;
    }
1176870
def handle_addVersion(repo, **kwargs):
    """"""
    log.info('addVersion: %s %s' %(repo, kwargs))
    try:
        v = repo.addVersion(**kwargs)
        return v.serialize()
    except RepoError, e:
        raise
896292
@Override
    public int getDatabaseMajorVersion() throws SQLException
    {
        checkClosed();
        System.out.println("\n\n\nVERSION: " + versionString);
        return Integer.valueOf(versionString.split("\\.")[0]);
    }
1047536
public static function upgrade()
        {
            Symphony::Configuration()->set('version', static::getVersion(), 'symphony');
            Symphony::Configuration()->set('useragent', 'Symphony/' . static::getVersion(), 'general');

            if (Symphony::Configuration()->write() === false) {
                throw new Exception('Failed to write configuration file, please check the file permissions.');
            } else {
                return true;
            }
        }
141413
public static void incrementVersion(Object target) {
        MetaClass metaClass = GroovySystem.getMetaClassRegistry().getMetaClass(target.getClass());
        if (metaClass.hasProperty(target, GormProperties.VERSION)!=null) {
            Object version = metaClass.getProperty(target, GormProperties.VERSION);
            if (version instanceof Long) {
                Long newVersion = (Long) version + 1;
                metaClass.setProperty(target, GormProperties.VERSION, newVersion);
            }
        }
    }
512793
public static void initialVersion(CodeBuilder b, TypeDesc type, int value)
        throws SupportException
    {
        adjustVersion(b, type, value, false);
    }
356277
public void incrementVersion(int node, long time) {
        if(node < 0 || node > Short.MAX_VALUE)
            throw new IllegalArgumentException(node
                                               + " is outside the acceptable range of node ids.");

        this.timestamp = time;

        Long version = versionMap.get((short) node);
        if(version == null) {
            version = 1L;
        } else {
            version = version + 1L;
        }

        versionMap.put((short) node, version);
        if(versionMap.size() >= MAX_NUMBER_OF_VERSIONS) {
            throw new IllegalStateException("Vector clock is full!");
        }

    }