Creates a new object of type Version
This method extracts the values for the object parameters from vStr

@param vStr - string input
425154
public static Version createVersion(String vStr) {
        if (vStr == null || vStr.isEmpty())
            return null;
        int major = 0;
        int minor = 0;
        int micro = 0;
        String qualifier = "";
        String v[] = vStr.split("\\.", 4);
        try {
            if (v.length > 0) {
                major = Integer.valueOf(v[0]).intValue();
            }
            if (v.length > 1) {
                minor = Integer.valueOf(v[1]).intValue();
            }
            if (v.length > 2) {
                micro = Integer.valueOf(v[2]).intValue();
            }
            if (v.length > 3) {
                qualifier = v[3];
            }
            return new Version(major, minor, micro, qualifier);
        } catch (NumberFormatException e) {
            return null;
        }
    }
535823
static AttrHold createFromString(final String str)
    throws BOSHException {
        if (str == null) {
            return null;
        } else {
            return new AttrHold(str);
        }
    }
188793
private void addAttrVal(String attr, String val, boolean encoded,
       boolean url) throws NamingException {
//  System.out.println("addAttr " + attr + " = " + val);

    if (state == stateNeedDn) {
      // Only version or dn here
      if (attr.equals("version")) {
        if (version != null) throwmsg("Repeated version record");
        // Should probably parse this.
        if (!(val.equals("1")))
          throwmsg("Invalid LDIF version " + val.toString());

        version = val;
      } else if (attr.equals("dn")) {
        setDn(makeVal(val, encoded, url));

        state = stateHadDn;
      } else {
        invalid();
      }
    } else if (state == stateHadDn) {
      // We might see a control or changetype here
      if (attr.equals("control")) {
        /** control records occur as an optional part of change records.
            We should not have seen any changesrecords yet.
            Flag this as a change record.
         */

        setIsContent(false);
        throwmsg("controls unimplemented");
      } else if (attr.equals("changetype")) {
        setIsContent(false);
        doChangeType(val);
      } else {
        // We presume that we have an attribute value. If we had control records
        // then we expected a changetype.
        if (haveControls) throwmsg("Missing changetype");
        state = stateNotModRec;

        // Recurse to process the attribute
        addAttrVal(attr, val, encoded, url);
      }
    } else if (state == stateDeleteRec) {
      throwmsg("Should have no values for delete");
    } else if (state == stateNotModRec) {
      /** add or content. Just some attribute and its value.
          Add the attribute name and val to the table.
       */

      addAttr(attr, makeVal(val, encoded, url));
    } else if (state == stateModrdn) {
      /** We expect up to 3 attributes
         newrdn: <rdn-val>
         deleteoldrdn: 0|1
         newsuperior: <dn-val>      ; optional
       */
      throwmsg("changetype: mod(r)dn unimplemented");
    } else if (state == stateModify) {
      // We expect ("add"|"delete"|"replace"): <attr-desc>
      if (encoded || url) {
        throwmsg("Invalid LDIF mod-spec");
      }

      curChange = new Change();
      if (attr.equals("add")) {
        curChange.changeType = DirContext.ADD_ATTRIBUTE;
      } else if (attr.equals("replace")) {
        curChange.changeType = DirContext.REPLACE_ATTRIBUTE;
      } else if (attr.equals("delete")) {
        curChange.changeType = DirContext.REMOVE_ATTRIBUTE;
      } else {
        throwmsg("Invalid LDIF mod-spec changetype");
      }

      curChange.name = val; // ???????? options
      state = stateModSpec;
    } else if (state == stateModSpec) {
      // Attribute + value to add to current change
      if ((curChange == null) || (curChange.name == null)) {
        throwmsg("LDIF software error: No current change");
      }

      if (!curChange.name.equalsIgnoreCase(attr)) {
        throwmsg("Invalid LDIF mod-spec: attribute name mismatch");
      }

      // Add the value to the change
      if (curChange.vals == null) {
        curChange.vals = new Vector();
      }
      curChange.vals.addElement(makeVal(val, encoded, url));
    } else {
      throwmsg("LDIF software error: invalid state " + state);
    }
    somedata = true;
  }
133351
private Object itemValue(Object obj, Object item) throws NoSuchMethodException,
            ClassNotFoundException, InvocationTargetException, IllegalAccessException
    {
        // String value
        if (item instanceof String) return item;

        XmlParser.Node node = (XmlParser.Node) item;
        String tag = node.getTag();
        if ("Call".equals(tag)) return call(obj, node);
        if ("Get".equals(tag)) return get(obj, node);
        if ("New".equals(tag)) return newObj(obj, node);
        if ("Ref".equals(tag)) return refObj(obj, node);
        if ("Array".equals(tag)) return newArray(obj, node);

        if ("SystemProperty".equals(tag))
        {
            String name = node.getAttribute("name");
            String defaultValue = node.getAttribute("default");
            return System.getProperty(name, defaultValue);
        }

        log.warn("Unknown value tag: " + node, new Throwable());
        return null;
    }
1373907
private static void writeVersionToVerFile(String version) throws IOException {
        //declared in a try-with-resource statement, it will be closed regardless of it completes normally or not      
    	try (PrintWriter writer = new PrintWriter(new File(DoradusServer.class.getResource("/" + VERSION_FILE).getPath()))) {
    		writer.write(version);
    	}

    }
1171099
public void checkAttrWrite(String nsURI, String localName)
        throws XMLStreamException
    {
        AttrName an = new AttrName(nsURI, localName);
        if (mAttrSet == null) {
            /* 13-Dec-2005, TSa: Should use a more efficient Set/Map value
             *   for this in future -- specifically one that could use
             *   ns/local-name pairs without intermediate objects
             */
            mAttrSet = new HashSet<AttrName>();
        }
        if (!mAttrSet.add(an)) {
            throw new XMLStreamException("Duplicate attribute write for attribute '"+an+"'");
        }
    }
516613
public void init(final String name,
			final byte[] value, final int dim_x, final int dim_y) {
		buildAttributeValueObject(name);
		insert_uc(value, dim_x, dim_y);
    }
1065791
@FFDCIgnore(NumberFormatException.class)
    private void readWriteTimeAndJavaSpecVersion(WsResource res, String line) {
        int timeIndex = line.indexOf('=');
        int javaSpecVersionIndex = timeIndex >= 0 ? line.indexOf(';', timeIndex) : -1;
        if (timeIndex != -1) {
            try {
                String sTime = javaSpecVersionIndex > timeIndex ? line.substring(timeIndex + 1, javaSpecVersionIndex) : line.substring(timeIndex + 1);
                writeTime = Long.parseLong(sTime);
                if (javaSpecVersionIndex != -1) {
                    javaSpecVersion = Integer.valueOf(line.substring(javaSpecVersionIndex + 1));
                }
            } catch (NumberFormatException nfe) {
            }
        }

        if (writeTime <= 0) {
            writeTime = res.getLastModified();
        }
    }
398744
@Override
    public Uid create(
            final ObjectClass objClass,
            final Set<Attribute> attrs,
            final OperationOptions options) {

        LOG.ok("Account creation");

        // check objectclass
        if (objClass == null || (!objClass.equals(ObjectClass.ACCOUNT))) {
            throw new IllegalArgumentException("Invalid objectclass");
        }

        // check attributes
        if (attrs == null || attrs.isEmpty()) {
            throw new IllegalArgumentException("No attribute specified");
        }

        // get web service client
        final Provisioning provisioning = connection.getProvisioning();
        if (provisioning == null) {
            throw new IllegalStateException("Web Service client not found");
        }

        // get account name
        final Name name = AttributeUtil.getNameFromAttributes(attrs);
        if (name == null) {
            throw new IllegalArgumentException("No name specified");
        }

        LOG.ok("Account to be created: " + name.getNameValue());

        // to be user in order to pass information to the web service
        final List<WSAttributeValue> attributes = new ArrayList<WSAttributeValue>();

        // retrieve attributes
        for (Attribute attr : attrs) {
            final WSAttribute wsAttribute = new WSAttribute(attr.getName());

            if (attr.is(Name.NAME)) {
                wsAttribute.setKey(true);
                wsAttribute.setNullable(false);
            }

            if (attr.is(OperationalAttributeInfos.PASSWORD.getName())) {
                wsAttribute.setName(OperationalAttributeInfos.PASSWORD.getName());
                wsAttribute.setPassword(true);
            }

            if (LOG.isOk()) {
                LOG.ok(
                        "\nAttribute: "
                        + "\n\tName: " + wsAttribute.getName()
                        + "\n\tType: " + wsAttribute.getType()
                        + "\n\tIsKey: " + wsAttribute.isKey()
                        + "\n\tIsPassword: " + wsAttribute.isPassword());
            }

            final WSAttributeValue wsAttributeValue = new WSAttributeValue(wsAttribute);
            attributes.add(wsAttributeValue);

            final List<Object> value = attr.getValue();
            if (value != null && value.size() == 1
                    && (value.get(0) instanceof GuardedString || value.get(0) instanceof GuardedByteArray)) {

                wsAttributeValue.addValue(value.toString());
            } else {
                wsAttributeValue.setValues(value);
            }
        }

        LOG.ok("\nUser " + name.getNameValue() + "\n\tattributes: " + attributes.size());

        try {
            // user creation
            provisioning.create(attributes);
        } catch (ProvisioningException e) {
            throw new ConnectorException("Creation failed", e);
        } catch (Throwable t) {
            throw new ConnectorException("Communication exception", t);
        }

        // return Uid
        return new Uid(name.getNameValue());
    }
410874
@Nullable
  private Type getPrimitiveOrVoidType(String typeStr) {
    switch (typeStr) {
      case "byte":
        return getSymtab().byteType;
      case "short":
        return getSymtab().shortType;
      case "int":
        return getSymtab().intType;
      case "long":
        return getSymtab().longType;
      case "float":
        return getSymtab().floatType;
      case "double":
        return getSymtab().doubleType;
      case "boolean":
        return getSymtab().booleanType;
      case "char":
        return getSymtab().charType;
      case "void":
        return getSymtab().voidType;
      default:
        return null;
    }
  }
719391
def _Serialize(self, val, info, defNS):
      
      if not IsChildVersion(self.version, info.version):
         return

      if val is None:
         if info.flags & F_OPTIONAL:
            return
         else:
            raise TypeError('Field "{0}" is not optional'.format(info.name))
      elif isinstance(val, list) and len(val) == 0:
         if info.type is object:
            # Make sure an empty array assigned to Any is typed
            if not isinstance(val, Array):
               raise TypeError('Field "{0}": Cannot assign empty native python array to an Any'.format(info.name))
         elif info.flags & F_OPTIONAL:
            # Skip optional non-Any
            return
         else:
             raise TypeError('Field "{0}" not optional'.format(info.name))

      if self.outermostAttrs:
         attr = self.outermostAttrs
         self.outermostAttrs = None
      else:
         attr = ''
      currDefNS = defNS
      # Emit default ns if tag ns is not the same
      currTagNS = GetWsdlNamespace(info.version)
      if currTagNS != defNS:
         attr += ' xmlns="{0}"'.format(currTagNS)
         currDefNS = currTagNS

      if isinstance(val, DataObject):
         if isinstance(val, MethodFault):
            newVal = LocalizedMethodFault(fault=val, localizedMessage=val.msg)
            if info.type is object:
               faultType = object
            else:
               faultType = LocalizedMethodFault
            newInfo = Object(name=info.name, type=faultType,
                             version=info.version, flags=info.flags)
            self._SerializeDataObject(newVal, newInfo, attr, currDefNS)
         else:
            self._SerializeDataObject(val, info, attr, currDefNS)
      elif isinstance(val, ManagedObject):
         if info.type is object:
            nsattr, qName = self._QName(ManagedObject, currDefNS)
            attr += '{0} {1}type="{2}"'.format(nsattr, self.xsiPrefix, qName)
         if val._serverGuid is not None:
            attr += ' serverGuid="{0}"'.format(val._serverGuid)
         # val in vim type attr is not namespace qualified
         # TODO: Add a new "typens" attr?
         ns, name = GetQualifiedWsdlName(Type(val))
         attr += ' type="{0}"'.format(name)
         self.writer.write('<{0}{1}>{2}</{3}>'.format(info.name, attr,
                                              val._moId,
                                              info.name))
      elif isinstance(val, list):
         if info.type is object:
            itemType = val.Item
            if (itemType is ManagedMethod or itemType is PropertyPath
            or  itemType is type):
               tag = 'string'
               typ = GetVmodlType("string[]")
            elif issubclass(itemType, ManagedObject):
               tag = 'ManagedObjectReference'
               typ = ManagedObject.Array
            else:
               tag = GetWsdlName(itemType)
               typ = Type(val)
            nsattr, qName = self._QName(typ, currDefNS)

            # For WSDL, since we set tag of ManagedObjects to ManagedObjectReferences,
            # the name of its array should be ArrayOfManagedObjectReference
            if qName.endswith("ArrayOfManagedObject"):
               qName += "Reference"

            attr += '{0} {1}type="{2}"'.format(nsattr, self.xsiPrefix, qName)
            self.writer.write('<{0}{1}>'.format(info.name, attr))

            itemInfo = Object(name=tag, type=itemType,
                              version=info.version, flags=info.flags)
            for it in val:
               self._Serialize(it, itemInfo, currDefNS)
            self.writer.write('</{0}>'.format(info.name))
         else:
            itemType = info.type.Item
            itemInfo = Object(name=info.name, type=itemType,
                              version=info.version, flags=info.flags)
            for it in val:
               self._Serialize(it, itemInfo, defNS)
      elif isinstance(val, type) or isinstance(val, type(Exception)):
         if info.type is object:
            attr += ' {0}type="{1}string"'.format(self.xsiPrefix, self.xsdPrefix)
         self.writer.write('<{0}{1}>{2}</{0}>'.format(
                           info.name, attr, GetWsdlName(val)))
      elif isinstance(val, ManagedMethod):
         if info.type is object:
            attr += ' {0}type="{1}string"'.format(self.xsiPrefix, self.xsdPrefix)
         self.writer.write('<{0}{1}>{2}</{0}>'.format(
                              info.name, attr, val.info.wsdlName))
      elif isinstance(val, datetime):
         if info.type is object:
            nsattr, qName = self._QName(Type(val), currDefNS)
            attr += '{0} {1}type="{2}"'.format(nsattr, self.xsiPrefix, qName)
         result = Iso8601.ISO8601Format(val)
         self.writer.write('<{0}{1}>{2}</{0}>'.format(info.name, attr, result))
      elif isinstance(val, binary):
         if info.type is object:
            nsattr, qName = self._QName(Type(val), currDefNS)
            attr += '{0} {1}type="{2}"'.format(nsattr, self.xsiPrefix, qName)
         result = base64.b64encode(val)
         if PY3:
            # In python3 the bytes result after the base64 encoding has a
            # leading 'b' which causes error when we use it to construct the
            # soap message. Workaround the issue by converting the result to
            # string. Since the result of base64 encoding contains only subset
            # of ASCII chars, converting to string will not change the value.
            result = str(result, XML_ENCODING)
         self.writer.write('<{0}{1}>{2}</{0}>'.format(info.name, attr, result))
      elif isinstance(val, bool):
         if info.type is object:
            nsattr, qName = self._QName(Type(val), currDefNS)
            attr += '{0} {1}type="{2}"'.format(nsattr, self.xsiPrefix, qName)
         result = val and "true" or "false"
         self.writer.write('<{0}{1}>{2}</{0}>'.format(info.name, attr, result))
      elif isinstance(val, six.integer_types) or isinstance(val, float):
         if info.type is object:
            nsattr, qName = self._QName(Type(val), currDefNS)
            attr += '{0} {1}type="{2}"'.format(nsattr, self.xsiPrefix, qName)
         result = six.text_type(val)
         self.writer.write('<{0}{1}>{2}</{0}>'.format(info.name, attr, result))
      elif isinstance(val, Enum):
         if info.type is object:
            nsattr, qName = self._QName(Type(val), currDefNS)
            attr += '{0} {1}type="{2}"'.format(nsattr, self.xsiPrefix, qName)
         self.writer.write('<{0}{1}>{2}</{0}>'.format(info.name, attr, val))
      else:
         if info.type is object:
            if isinstance(val, PropertyPath):
               attr += ' {0}type="{1}string"'.format(self.xsiPrefix, self.xsdPrefix)
            else:
               nsattr, qName = self._QName(Type(val), currDefNS)
               attr += '{0} {1}type="{2}"'.format(nsattr, self.xsiPrefix, qName)

         if isinstance(val, six.binary_type):
            # Use UTF-8 rather than self.encoding.  self.encoding is for
            # output of serializer, while 'val' is our input.  And regardless
            # of what our output is, our input should be always UTF-8.  Yes,
            # it means that if you emit output in other encoding than UTF-8,
            # you cannot serialize it again once more.  That's feature, not
            # a bug.
            val = val.decode(XML_ENCODING)
         result = XmlEscape(val)
         self.writer.write(u'<{0}{1}>{2}</{0}>'.format(info.name, attr, result))
1244584
protected ValueMetadata createStringValue(ParserContext context, String str) {
        MutableValueMetadata value = context.createMetadata(MutableValueMetadata.class);
        value.setStringValue(str);
        return value;
    }
487677
public IVersion getVersion(String vstring) throws InvalidRangeException
  {
    IVersionRange range = getRange(vstring);
    if (range == null) {
      return null;
    }
    return range.getMinimum();
  }
1203726
private static String make(final CharSequence name,
        final CharSequence value, final CharSequence... attrs) {
        final StringBuilder text = new StringBuilder(
            String.format("%s=%s;", name, value)
        );
        for (final CharSequence attr : attrs) {
            text.append(attr).append(';');
        }
        return text.toString();
    }
628367
function (value) {
        // extract the version logic and in case it failes and value passed is an object, we use that assuming parsed
        // value has been sent.
        var ver = semver.parse(value) || value || {};

        _.assign(this, /** @lends Version.prototype */ {
            /**
             * The raw URL string. If {@link Version#set} is called with a string parameter, the string is saved here
             * before parsing various Version components.
             *
             * @type {String}
             */
            raw: ver.raw,

            /**
             * @type {String}
             */
            major: ver.major,

            /**
             * @type {String}
             */
            minor: ver.minor,

            /**
             * @type {String}
             */
            patch: ver.patch,

            /**
             * @type {String}
             */
            prerelease: ver.prerelease && ver.prerelease.join && ver.prerelease.join() || ver.prerelease,

            /**
             * @type {String}
             */
            build: ver.build && ver.build.join && ver.build.join() || ver.build,

            /**
             * @type {String}
             */
            string: ver.version
        });
    }
1063130
function(str){
        var versionArray = str.split(",");//replace with regex
        return {
            "raw":str,
            "major":parseInt(versionArray[0].split(" ")[1], 10),
            "minor":parseInt(versionArray[1], 10),
            "revision":parseInt(versionArray[2], 10),
            "revisionStr":versionArray[2]
        };
    }
384657
function createVirtualDomNode(el, attr) {
	var ns = el.namespaceURI !== HTML_NAMESPACE ? el.namespaceURI : null;
	var key = attr && el.getAttribute(attr) ? el.getAttribute(attr) : null;

	return new VNode(
		el.tagName
		, createProperties(el)
		, createChildren(el, attr)
		, key
		, ns
	);
}