/*----------------------------------------------------------------------------
325502
private int trGetC(final int isa, final int isaD, final int isaN, final int p) {
        return isaD + p < isaN ?
                SA[isaD + p]
              : SA[isa + ((isaD - isa + p) % (isaN - isa))];
    }
1205071
public function write() {
        $this->getAbstractClass()->write();
        $child = $this->buildChild();
        if(!file_exists($child->getFileName())) {
            $child->write();
        }
        $this->buildTestTable()->write();
        $this->getValidationClass()->write();
        if(!file_exists($this->getValidationChildClass()->getFileName())) {
            $this->getValidationChildClass()->write();
        }
    }
1070896
private void requestInitialized(ServletRequest request)
    {
        ServletRequestEvent event = new ServletRequestEvent(_servletContext,request);
        for (int i=0;i<LazyList.size(_requestListeners);i++)
            ((ServletRequestListener)LazyList.get(_requestListeners,i))
                        .requestInitialized(event);
    }
869816
public function init()
    {
        $this->filter = isset($_REQUEST['filter']) ? $_REQUEST['filter'] : [];
        $this->sort   = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : [];
    }
1033482
public function process()
    {
        parent::process();

        if ($this->value === null) {
            return;
        }

        try {
            $integer_value = $this->getNumericValue($this->value);

            if ($integer_value === null) {
                $this->addMessage($this->getValidationMessage('integer'));
            } else {
                $this->value = $integer_value;
            }
        } catch (SwatIntegerOverflowException $e) {
            if ($e->getSign() > 0) {
                $this->addMessage(
                    $this->getValidationMessage('integer-maximum')
                );
            } else {
                $this->addMessage(
                    $this->getValidationMessage('integer-minimum')
                );
            }

            $integer_value = null;
        }
    }
522591
private void encodeThis() throws IOException {
        if (id == null) {
            this.extensionValue = null;
            return;
        }
        DerOutputStream os = new DerOutputStream();
        id.encode(os);
        this.extensionValue = os.toByteArray();
    }
53301
protected final static void init(HttpServletRequest req) {
		// -- 字符集的过滤
		String charset = HuluSetting.charset;
		try {
			req.setCharacterEncoding(charset);
		} catch (Exception e) {
			log.warn("Charset [{}] not support!", charset);
		}
		servletRequestLocal.set(req);
		
		if(isMultipart()){
			try {
				multipartFormDataLocal.set(parseMultipart());
			} catch (IOException e) {
				throw new ActionRuntimeException(e);
			}
		}
	}
647781
public function init()
    {
        $valid = null;

        if ($this->cache->has(self::CACHE_KEY)) {
            $cached = $this->cache->get(self::CACHE_KEY);
            $valid  = $cached && isset($cached['hosts']) && count($cached['hosts']);
        }


        if ($valid) {
            $this->map = $cached;
        } else {
            $this->build();
        }
    }
542068
private void initOut() throws IOException
   {
      if (out == null)
      {
         FileOutputStream os = PrivilegedFileHelper.fileOutputStream(logFile, false);
         out = os.getChannel();
      }
   }
650438
public static void initServletRequest(ServletRequest servletRequest, TemplatedURLFormatter formatter)
    {
        assert servletRequest != null : "The ServletRequest cannot be null.";

        if (servletRequest == null) {
            throw new IllegalArgumentException("The ServletRequest cannot be null.");
        }

        servletRequest.setAttribute(TEMPLATED_URL_FORMATTER_ATTR, formatter);
    }
1174745
public function onBeforeWrite()
    {
        if (!$this->isInDB()) {
            $this->CreatorID = Member::currentUserID();
        }

        if (!$this->VersionNumber) {
            $versions = DataObject::get(
                'FileVersion', sprintf('"FileID" = %d', $this->FileID)
            );

            if ($versions) {
                $this->VersionNumber = $versions->Count() + 1;
            } else {
                $this->VersionNumber = 1;
            }
        }

        if (!$this->Filename) {
            $this->Filename = $this->saveCurrentVersion();
        }

        parent::onBeforeWrite();
    }
898472
private void process()
    {
        if (requestUri.length() > 1) {
            parts = new ArrayList<String>(10);
            for ( int i = 1; i < requestUri.length(); ) {
                int sIdx = i;
                int eIdx = requestUri.indexOf('/', sIdx + 1);
                
                //not matched or reach the end
                if ( eIdx == -1 ) {
                    parts.add(requestUri.substring(sIdx));
                    break;
                } 
                
                parts.add(requestUri.substring(sIdx, eIdx));
                i = eIdx + 1;
            }
            
            /*
             * check and add a empty method name
             * with request style like /tokenizer/
            */
            if ( requestUri.charAt(requestUri.length()-1) == '/' ) {
                parts.add("");
            }
            
            int length = parts.size();
            if ( length > 1 ) {
                IStringBuffer sb = new IStringBuffer();
                for ( int i = 0; i < length - 1; i++ ) {
                    int l = sb.length();
                    sb.append(parts.get(i));
                    
                    //make sure the first letter is uppercase
                    char chr = sb.charAt(l);
                    if ( chr >= 90 ) {
                        chr -= 32;
                        sb.set(l, chr);
                    }
                }
                
                controller = sb.toString();
            }
            
            method = parts.get(length-1);
        }
    }
827244
@Override
	protected StringBuffer doPostProcessBundle(BundleProcessingStatus status, StringBuffer bundleData)
			throws IOException {

		if (jsEngine == null) {
			initialize(status.getJawrConfig());
		}

		StopWatch stopWatch = new StopWatch();
		stopWatch.start("Processing Autoprefixer on '" + status.getLastPathAdded() + "'");

		String cssSource = bundleData.toString();
		String res = null;
		try {
			res = (String) jsEngine.invokeFunction("process", cssSource, options);

		} catch (NoSuchMethodException | ScriptException e) {
			throw new BundlingProcessException(e);
		}

		stopWatch.stop();
		if (PERF_LOGGER.isDebugEnabled()) {
			PERF_LOGGER.debug(stopWatch.shortSummary());
		}
		return new StringBuffer(res);
	}
101193
@PostLoad
    @PostPersist
    @PostUpdate
    @PostRemove
    private void init() {
        if (this.internalPortletDefinitionId != -1
                && (this.portletDefinitionId == null
                        || this.portletDefinitionId.getLongId()
                                != this.internalPortletDefinitionId)) {
            this.portletDefinitionId =
                    PortletDefinitionIdImpl.create(this.internalPortletDefinitionId);
        }
    }
722431
@Override
	public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
		//-- 处理请求，如果处理失败（无对应的Action），继续后续步骤
		if(false == ActionContext.handle(req, res)) {
			chain.doFilter(req, res);
		}
	}
1289520
@Override
    public void setHeader(String name, String value) {
        this.checkState();
        super.setHeader(name, value);
    }
964249
@Override
    String sourceContentFor(String aSource, Boolean nullOnMissing) {
        for (int i = 0; i < this._sections.size(); i++) {
            ParsedSection section = this._sections.get(i);
            String content = section.consumer.sourceContentFor(aSource, true);
            if (content != null) {
                return content;
            }
        }
        if (nullOnMissing != null && nullOnMissing) {
            return null;
        } else {
            throw new RuntimeException("\"" + aSource + "\" is not in the SourceMap.");
        }
    }