/*
internal methods
486243
protected Response addToTask(HttpHeaders headers, String containerId, Long tInstanceId, boolean removeExisting, String payload, int operation) {
        Variant v = getVariant(headers);
        String type = getContentType(headers);
        Header conversationIdHeader = buildConversationIdHeader(containerId, context, headers);
        try {
            switch (operation) {
                case POT_OWNER:
                    userTaskAdminServiceBase.addPotentialOwners(containerId, tInstanceId, removeExisting, payload, type);
                    break;

                case EXL_OWNER:
                    userTaskAdminServiceBase.addExcludedOwners(containerId, tInstanceId, removeExisting, payload, type);
                    break;

                case ADMIN:
                    userTaskAdminServiceBase.addBusinessAdmins(containerId, tInstanceId, removeExisting, payload, type);
                    break;
            }

            return createResponse("", v, Response.Status.CREATED, conversationIdHeader);
        } catch (TaskNotFoundException e) {
            return notFound(MessageFormat.format(TASK_INSTANCE_NOT_FOUND, tInstanceId), v, conversationIdHeader);
        } catch (DeploymentNotFoundException e) {
            return notFound(MessageFormat.format(CONTAINER_NOT_FOUND, containerId), v, conversationIdHeader);
        } catch (Exception e) {
            logger.error("Unexpected error during processing {}", e.getMessage(), e);
            return internalServerError(errorMessage(e), v, conversationIdHeader);
        }
    }
1021592
@Override
  public void writeExternal(ObjectOutput out) throws IOException {
    out.writeInt(DBIDUtil.asInteger(id));
    out.writeInt(values.length);
    for(double v : values) {
      out.writeDouble(v);
    }
  }
586398
private function _initialize()
    {
        $params = $this->getParameters();
        if ($params !== null) {
            for ($i = 0, $paramsCount = count($params); $i < $paramsCount; $i++) {
                if ($params[$i] !== null) {
                    $type = $params[$i]->getType();
                    if ($type === "tokenchar") {
                        $name = $params[$i]->getName();
                        if ($name === "begintoken") {
                            $this->_beginToken = substr($params[$i]->getValue(), 0, strlen($params[$i]->getValue()));
                        } else {
                            if ($name === "endtoken") {
                                $this->_endToken = substr($params[$i]->getValue(), 0, strlen($params[$i]->getValue()));
                            }
                        }
                    } else {
                        if ($type === "token") {
                            $name = $params[$i]->getName();
                            $value = $params[$i]->getValue();

                            $tok = new Token();
                            $tok->setKey($name);
                            $tok->setValue($value);

                            $this->_tokens[] = $tok;
                        } else {
                            if ($type === "tokensource") {
                                // Store data from nested tags in local array
                                $arr = [];

                                $subparams = $params[$i]->getParams();
                                foreach ($subparams as $subparam) {
                                    $arr[$subparam->getName()] = $subparam->getValue();
                                }

                                // Create TokenSource
                                $tokensource = new TokenSource();
                                if (isset($arr["classname"])) {
                                    $tokensource->setClassname($arr["classname"]);
                                }

                                // Copy other parameters 1:1 to freshly created TokenSource
                                foreach ($arr as $key => $value) {
                                    if (strtolower($key) === "classname") {
                                        continue;
                                    }
                                    $param = $tokensource->createParam();
                                    $param->setName($key);
                                    $param->setValue($value);
                                }

                                $this->_tokensources[] = $tokensource;
                            }
                        }
                    }
                }
            }
        }
    }
1074932
@Override
    protected void initPrototypeId(int id)
    {
        String s;
        int arity;
        switch (id) {
          case Id_defaultSettings:  arity=0; s="defaultSettings";  break;
          case Id_settings:         arity=0; s="settings";         break;
          case Id_setSettings:      arity=1; s="setSettings";      break;
          default: throw new IllegalArgumentException(String.valueOf(id));
        }
        initPrototypeMethod(XMLCTOR_TAG, id, s, arity);
    }
1270086
private void init() throws IOException {
    Map<String, Integer> minDays = null;
    Map<String, Integer> firstDays = null;

    loadPatches();
    
    List<Path> resources = Utils.listResources(FILES);
    sanityCheck(resources);
    for (Path path : resources) {
      String fileName = path.getFileName().toString();
      if (!fileName.endsWith(".json")) {
        continue;
      }

      JsonObject root = load(path);
      switch (fileName) {

        case "aliases.json":
        {
          parseTimeZoneAliases(root);
          parseLanguageAliases(root);
          parseTerritoryAliases(root);
          break;
        }
        
        case "availableLocales.json":
          JsonObject locales = resolve(root, "availableLocales");
          for (JsonElement elem : locales.getAsJsonArray("modern")) {
            availableLocales.add(elem.getAsString());
          }
          break;

        case "ca-gregorian.json":
        {
          String code = localeCode(root);
          LocaleID id = parseIdentity(code, root);
          root = resolve(root, "main", code);
          DateTimeData data = parseCalendar(root);
          data.id = id;
          calendars.put(id, data);
          break;
        }

        case "currencies.json":
        {
          String code = localeCode(root);
          LocaleID id = parseIdentity(code, root);
          root = resolve(root, "main", code);
          parseCurrencyData(id, code, root);
          break;
        }

        case "currencyData.json":
          parseSupplementalCurrencyData(root);
          break;

        case "defaultContent.json":
          parseDefaultContent(root);
          break;
          
        case "languageMatching-fix.json":
        {
          parseLanguageMatchingFix(root);
          break;
        }
        
        case "likelySubtags.json":
          parseLikelySubtags(root);
          break;

        case "metaZones.json":
        {
          parseMetaZones(root);
          break;
        }
          
        case "numbers.json":
        {
          String code = localeCode(root);
          root = patch(fileName, code, root);
          LocaleID id = parseIdentity(code, root);
          root = resolve(root, "main", code);
          parseNumberData(id, code, root);
          break;
        }

        case "ordinals.json":
          parsePlurals(root, "plurals-type-ordinal", ordinals);
          break;

        case "plurals.json":
          parsePlurals(root, "plurals-type-cardinal", cardinals);
          break;

        case "territoryContainment.json":
        {
          parseTerritoryContainment(root);
          break;
        }
          
        case "timeZoneNames.json":
        {
          String code = localeCode(root);
          LocaleID id = parseIdentity(code, root);
          TimeZoneData data = parseTimeZoneData(code, root);
          timezones.put(id, data);
          break;
        }
        
        case "units.json":
        {
          String code = localeCode(root);
          LocaleID id = parseIdentity(code, root);
          UnitData data = parseUnitData(code, root);
          units.put(id, data);
          break;
        }
        
        case "weekData.json":
          minDays = parseMinDays(root);
          firstDays = parseFirstDays(root);
          break;
      }
    }
    
    Integer defaultFirstDay = firstDays.get("001");
    Integer defaultMinDays = minDays.get("001");

    for (Map.Entry<LocaleID, DateTimeData> entry : calendars.entrySet()) {
      String territory = entry.getKey().territory;
      DateTimeData data = entry.getValue();

      Integer value = minDays.getOrDefault(territory, defaultMinDays);
      data.minDays = value;

      value = firstDays.getOrDefault(territory, defaultFirstDay);
      data.firstDay = value - 1;
    }
  }
510670
public function initialize()
    {
        if (!$this->isInitialized()) {
            $this->getOriginalNodeNames();
            $fetchDepth = $this->fetchDepth > 0 ? $this->fetchDepth + 1 : -1;
            $childNodes = $this->getNode($fetchDepth)->getNodes($this->filter);
            $this->collection = new ArrayCollection($this->getChildren($childNodes));
            $this->initialized = self::INITIALIZED_FROM_PHPCR;
        }
    }
1228080
public function init()
	{
		if(!isset($this->htmlOptions['id']))
			$this->htmlOptions['id']=$this->id;
		else
			$this->id=$this->htmlOptions['id'];

		if($this->stateful)
			echo CHtml::statefulForm($this->action, $this->method, $this->htmlOptions);
		else
			echo CHtml::beginForm($this->action, $this->method, $this->htmlOptions);

		if($this->errorMessageCssClass===null)
			$this->errorMessageCssClass=CHtml::$errorMessageCss;
	}
125796
function() {
        this.container = null;
        this.extent = null;
        this.size =  null;
        this.resolution = null;
        this.map = null;
    }
31920
private void init() {
    masterLanguage = null;
    additionalRootAttrs.clear();
    // the collection is not modifiable and therefore cannot be cleared.
    additionalNamespaces = new ArrayList<>();
    textNodeList.clear();
    parseWarnings.clear();
  }
936068
protected function initParams () {
		$params = array_merge($this->globalGet);
		if ($this->GetMethod() == self::METHOD_POST) {
			$postValues = [];
			if (count($this->globalPost) > 0) {
				$postValues = $this->globalPost;
			} else {
				$postValues = $this->initParamsCompletePostData();
			}
			$params = array_merge($params, $postValues);
		}
		$this->params = $params;
	}
39587
public function process()
    {
        parent::process();

        if (!$this->processValue()) {
            return;
        }

        if ($this->required && $this->isSensitive()) {
            // When values are not serialized, an empty string is treated as
            // null. As a result, you should not use a null value and an empty
            // string value in the same flydown except when using serialized
            // values.
            if (
                ($this->serialize_values && $this->value === null) ||
                (!$this->serialize_values && $this->value == '')
            ) {
                $this->addMessage($this->getValidationMessage('required'));
            }
        }
    }
97002
public function init()
    {
        parent::init();

        // If kind is not specified, figure out join type
        if (!isset($this->kind)) {
            $this->kind = $this->weak ? 'left' : 'inner';
        }

        // Add necessary hooks
        if ($this->reverse) {
            $this->owner->addHook('afterInsert', $this, null, -5);
            $this->owner->addHook('beforeUpdate', $this, null, -5);
            $this->owner->addHook('beforeDelete', [$this, 'doDelete'], null, -5);
        } else {
            $this->owner->addHook('beforeInsert', $this);
            $this->owner->addHook('beforeUpdate', $this);
            $this->owner->addHook('afterDelete', [$this, 'doDelete']);
            $this->owner->addHook('afterLoad', $this);
        }
    }
1181656
@Override
	public void internalWrite(Server server, Query query, ImmutableList<Result> results) throws Exception {
		checkFile(query);
		List<String> typeNames = getTypeNames();

		for (Result result : results) {
			String[] keyString = KeyUtils.getKeyString(server, query, result, typeNames, null).split("\\.");
			if (isNumeric(result.getValue()) && filters.contains(keyString[2])) {
				int thresholdPos = filters.indexOf(keyString[2]);
				StringBuilder sb = new StringBuilder();

				sb.append("[");
				sb.append(result.getEpoch());
				sb.append("] PROCESS_SERVICE_CHECK_RESULT;");
				sb.append(nagiosHost);
				sb.append(";");
				if (prefix != null) {
					sb.append(prefix);
				}
				sb.append(keyString[2]);
				if (suffix != null) {
					sb.append(suffix);
				}
				sb.append(";");
				sb.append(nagiosCheckValue(result.getValue().toString(), thresholds.get(thresholdPos)));
				sb.append(";");
				//Missing the performance information

				logger.info(sb.toString());
			}
		}
	}
949937
public void init()
    {
        ServletContext config=getServletContext();
        _servletHandler=((ServletHandler.Context)config).getServletHandler();

        Enumeration e = getInitParameterNames();
        while(e.hasMoreElements())
        {
            String param=(String)e.nextElement();
            String value=getInitParameter(param);
            String lvalue=value.toLowerCase();
            if ("nonContextServlets".equals(param))
            {
                _nonContextServlets=value.length()>0 && lvalue.startsWith("t");
            }
            if ("verbose".equals(param))
            {
                _verbose=value.length()>0 && lvalue.startsWith("t");
            }
            else
            {
                if (_parameters==null)
                    _parameters=new HashMap();
                _parameters.put(param,value);
            }
        }
    }
1028320
@Override
	protected void unserializeFrom(RawDataBuffer in)
    {
    	super.unserializeFrom(in);
    	browserId = new IntegerID(in.readInt());   
    }
118654
function Internal(message, code_id) {
    Error.call(this);
    this.message = message || "internal error";
    this.code_id = code_id || null;
    this.statusCode = 500;
}
132156
public function initialize()
    {
        if ($this->initialized === false) {
            $this->data = $this->cursor->toArray();
        }
        $this->initialized = true;
    }