static initializer
495441
static function __static()
    {
        if (extension_loaded(self::BACKING_OPENSSL)) {
            self::useOpenSslBacking();
        } elseif (extension_loaded(self::BACKING_MCRYPT)) {
            self::useMcryptBacking();
        } else {
            self::usePlaintextBacking();
        }
    }
263173
static Class<?> loadClass(ClassLoader cl, String classTypeName) throws InvocationException {
        try {
            return cl.loadClass(classTypeName);
        } catch (ClassNotFoundException e) {
            throw new InvocationException(e, "Unable to load class {0} with class loader {1}", classTypeName, cl);
        }
    }
1113833
protected static function init()
    {
        if (static::$init) {
            return;
        }
        static::$init = true;

        if (!static::$name) {
            throw new \Exception("Cannot start session, no name has been specified");
        }

        session_cache_limiter(false);

        session_name(static::$name);

        session_start();

        # Grab the sessions data to respond to get()
        static::$data = $_SESSION;

        # Remove the lock from the session file
        session_write_close();
    }
1025225
Expr staticMember() {
		if (peek().sym != Sym.ID) {
			return sharedMethod();
		}
		
		int begin = forward;
		while (move().sym == Sym.DOT && move().sym == Sym.ID) {
			;
		}
		// ID.ID.ID::
		if (peek().sym != Sym.STATIC || tokenList.get(forward - 1).sym != Sym.ID) {
			resetForward(begin);
			return sharedMethod();
		}
		
		String clazz = getClazz(begin);
		match(Sym.STATIC);
		String memberName = match(Sym.ID).value();
		
		// com.jfinal.kit.Str::isBlank(str)
		if (peek().sym == Sym.LPAREN) {
			move();
			if (peek().sym == Sym.RPAREN) {
				move();
				return new StaticMethod(clazz, memberName, location);
			}
			
			ExprList exprList = exprList();
			match(Sym.RPAREN);
			return new StaticMethod(clazz, memberName, exprList, location);
		}
		
		// com.jfinal.core.Const::JFINAL_VERSION
		return new StaticField(clazz, memberName, location);
	}
573405
private static synchronized void init() {
        LOGGER.trace("Reads static resources definition from [static-resources.xml]");

        final File staticResources = Latkes.getWebFile("/WEB-INF/static-resources.xml");
        if (null == staticResources || !staticResources.exists()) {
            throw new IllegalStateException("Not found static resources definition from [static-resources.xml]");
        }

        final DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();

        try {
            final DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            final Document document = documentBuilder.parse(staticResources);
            final Element root = document.getDocumentElement();

            root.normalize();

            final StringBuilder logBuilder = new StringBuilder("Reading static files: [").append(Strings.LINE_SEPARATOR);
            final NodeList includes = root.getElementsByTagName("include");
            for (int i = 0; i < includes.getLength(); i++) {
                final Element include = (Element) includes.item(i);
                String path = include.getAttribute("path");
                final URI uri = new URI("http", "b3log.org", path, null);
                final String s = uri.toASCIIString();
                path = StringUtils.substringAfter(s, "b3log.org");

                STATIC_RESOURCE_PATHS.add(path);

                logBuilder.append("    ").append("path pattern [").append(path).append("]");
                if (i < includes.getLength() - 1) {
                    logBuilder.append(",");
                }
                logBuilder.append(Strings.LINE_SEPARATOR);
            }

            logBuilder.append("]");

            if (LOGGER.isTraceEnabled()) {
                LOGGER.debug(logBuilder.toString());
            }
        } catch (final Exception e) {
            LOGGER.log(Level.ERROR, "Reads [" + staticResources.getName() + "] failed", e);
            throw new RuntimeException(e);
        }

        final StringBuilder logBuilder = new StringBuilder("Static files: [").append(Strings.LINE_SEPARATOR);
        final Iterator<String> iterator = STATIC_RESOURCE_PATHS.iterator();
        while (iterator.hasNext()) {
            final String pattern = iterator.next();

            logBuilder.append("    ").append(pattern);
            if (iterator.hasNext()) {
                logBuilder.append(',');
            }
            logBuilder.append(Strings.LINE_SEPARATOR);
        }
        logBuilder.append("], ").append('[').append(STATIC_RESOURCE_PATHS.size()).append("] path patterns");

        if (LOGGER.isTraceEnabled()) {
            LOGGER.trace(logBuilder.toString());
        }

        inited = true;
    }
696042
public function call_static() {
		$args  = func_get_args();
		$class = array_shift( $args );
		$name  = array_shift( $args );

		return call_user_func_array( [$class, $name], $args );
	}
1178524
public static function init()
    {
        if(static::$isInited)
        {
            throw new \RuntimeException('MemoryTableManager can not repeated init');
        }
        foreach(static::$tables as $name => $option)
        {
            $table = new \Swoole\Table($option['size'] ?? 1024, $option['conflictProportion'] ?? 0.2);
            foreach($option['columns'] as $column)
            {
                $table->column($column['name'], $column['type'] ?? swoole_table::TYPE_STRING, $column['size'] ?? 0);
            }
            if(!$table->create())
            {
                throw new \RuntimeException('MemoryTableManager create table failed');
            }
            static::$tables[$name] = $table;
        }
        static::$isInited = true;
    }
50600
public static function __static()
	{
		ValueProxy::$valueFactory = array();
		ValueProxy::$dynamicValueType = Type::FromNameAndTypeCode( ValueProxy::$CLASSNAME, TypeCode::Object );
	}
495649
public static function initialize() {
		if( static::isInitialized() ) { return; }
		static::$initialized = true;

		$routes = array();

		// TODO: Add cache, but what kind of ?

		static::loadRoutes($routes);

		// Register routes
		foreach( $routes as $type => $typeRoutes ) {
			$routeClass = RequestHandler::getRouteClass($type);
			if( !class_exists($routeClass, true) || !in_array(get_class(), class_parents($routeClass)) ) {
				continue;
			}
			foreach( $typeRoutes as $routeName => $routeConfig ) {
				$routeClass::registerConfig($routeName, $routeConfig);
			}
		}
	}
10376
static function initialize()
    {
        if ( !isset( $GLOBALS['eZ1337Translator'] ) ||
             !( $GLOBALS['eZ1337Translator'] instanceof eZ1337Translator ) )
        {
            $GLOBALS['eZ1337Translator'] = new eZ1337Translator();
        }

        $man = eZTranslatorManager::instance();
        $man->registerHandler( $GLOBALS['eZ1337Translator'] );
        return $GLOBALS['eZ1337Translator'];
    }
1254242
private void initVariables() {
        if (this.currentChunk == null) {
            this.currentChunk = new Instances(this.getModelContext());
        }

        if (this.classDistributions == null) {
            this.classDistributions = new long[this.getModelContext().classAttribute().numValues()];

            for (int i = 0; i < this.classDistributions.length; i++) {
                this.classDistributions[i] = 0;
            }
        }
    }
803398
public final void arrayInitializer() throws RecognitionException {
		int arrayInitializer_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 45) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:500:5: ( '{' ( variableInitializer ( ',' variableInitializer )* ( ',' )? )? '}' )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:500:7: '{' ( variableInitializer ( ',' variableInitializer )* ( ',' )? )? '}'
			{
			match(input,121,FOLLOW_121_in_arrayInitializer1534); if (state.failed) return;
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:500:11: ( variableInitializer ( ',' variableInitializer )* ( ',' )? )?
			int alt63=2;
			int LA63_0 = input.LA(1);
			if ( ((LA63_0 >= CharacterLiteral && LA63_0 <= DecimalLiteral)||LA63_0==FloatingPointLiteral||(LA63_0 >= HexLiteral && LA63_0 <= Identifier)||(LA63_0 >= OctalLiteral && LA63_0 <= StringLiteral)||LA63_0==29||LA63_0==36||(LA63_0 >= 40 && LA63_0 <= 41)||(LA63_0 >= 44 && LA63_0 <= 45)||LA63_0==53||LA63_0==65||LA63_0==67||(LA63_0 >= 70 && LA63_0 <= 71)||LA63_0==77||(LA63_0 >= 79 && LA63_0 <= 80)||LA63_0==82||LA63_0==85||LA63_0==92||LA63_0==94||(LA63_0 >= 97 && LA63_0 <= 98)||LA63_0==105||LA63_0==108||LA63_0==111||LA63_0==115||LA63_0==118||LA63_0==121||LA63_0==126) ) {
				alt63=1;
			}
			switch (alt63) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:500:12: variableInitializer ( ',' variableInitializer )* ( ',' )?
					{
					pushFollow(FOLLOW_variableInitializer_in_arrayInitializer1537);
					variableInitializer();
					state._fsp--;
					if (state.failed) return;
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:500:32: ( ',' variableInitializer )*
					loop61:
					while (true) {
						int alt61=2;
						int LA61_0 = input.LA(1);
						if ( (LA61_0==43) ) {
							int LA61_1 = input.LA(2);
							if ( ((LA61_1 >= CharacterLiteral && LA61_1 <= DecimalLiteral)||LA61_1==FloatingPointLiteral||(LA61_1 >= HexLiteral && LA61_1 <= Identifier)||(LA61_1 >= OctalLiteral && LA61_1 <= StringLiteral)||LA61_1==29||LA61_1==36||(LA61_1 >= 40 && LA61_1 <= 41)||(LA61_1 >= 44 && LA61_1 <= 45)||LA61_1==53||LA61_1==65||LA61_1==67||(LA61_1 >= 70 && LA61_1 <= 71)||LA61_1==77||(LA61_1 >= 79 && LA61_1 <= 80)||LA61_1==82||LA61_1==85||LA61_1==92||LA61_1==94||(LA61_1 >= 97 && LA61_1 <= 98)||LA61_1==105||LA61_1==108||LA61_1==111||LA61_1==115||LA61_1==118||LA61_1==121||LA61_1==126) ) {
								alt61=1;
							}

						}

						switch (alt61) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:500:33: ',' variableInitializer
							{
							match(input,43,FOLLOW_43_in_arrayInitializer1540); if (state.failed) return;
							pushFollow(FOLLOW_variableInitializer_in_arrayInitializer1542);
							variableInitializer();
							state._fsp--;
							if (state.failed) return;
							}
							break;

						default :
							break loop61;
						}
					}

					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:500:59: ( ',' )?
					int alt62=2;
					int LA62_0 = input.LA(1);
					if ( (LA62_0==43) ) {
						alt62=1;
					}
					switch (alt62) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:500:60: ','
							{
							match(input,43,FOLLOW_43_in_arrayInitializer1547); if (state.failed) return;
							}
							break;

					}

					}
					break;

			}

			match(input,125,FOLLOW_125_in_arrayInitializer1554); if (state.failed) return;
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 45, arrayInitializer_StartIndex); }

		}
	}
136504
final protected static function initializeMembers()
    {
        if (null === static::CONSTANCE_PATTERN) {
            foreach (get_defined_constants() as $key => $value) {
                new static($key, $value);
            }
        } else {
            foreach (get_defined_constants() as $key => $value) {
                if (preg_match(static::CONSTANCE_PATTERN, $key)) {
                    new static($key, $value);
                }
            }
        }
    }
369323
@Deprecated
    public static void initializeClass(Class theClass) {
        // ***HACK*** We ask the VM to create an instance
        // by voluntarily providing illegal arguments to force
        // the VM to run the class' static initializer, while
        // at the same time not running a valid constructor.

        final Constructor[] cons = theClass.getDeclaredConstructors();
        //At least one constructor is guaranteed to be there, but check anyway.
        if (cons != null) {
            if (cons.length > 0 && cons[0] != null) {
                final String[] strs = new String[NUMBER_OF_STRINGS];
                try {
                    cons[0].newInstance((Object[]) strs);
                    // Expecting an exception to be thrown by this call:
                    // IllegalArgumentException: wrong number of Arguments
                } catch (Exception e) {
                    // Ignore - we are interested only in the side
                    // effect - that of getting the static initializers
                    // invoked.  As we do not want to call a valid
                    // constructor to get this side effect, an
                    // attempt is made to call a hopefully
                    // invalid constructor - come on, nobody
                    // would have a constructor that takes in
                    // 256 String arguments ;-)
                    // (In fact, they can't - according to JVM spec
                    // section 4.10, the number of method parameters is limited
                    // to 255 by the definition of a method descriptor.
                    // Constructors count as methods here.)
                }
            }
        }
    }
20226
public static function __static()
	{
		// NameValue::$nameStartChar = "[:_\p{Ll}\p{Lu}\p{Lt}\p{Lo}\p{Nl}]";
		NameValue::$nameStartChar = SchemaTypes::$nameStartChar;
		NameValue::$nameChar = SchemaTypes::$nameChar;
		NameValue::$name = SchemaTypes::$name;
		NameValue::$ncName = SchemaTypes::$ncName;
	}
989480
@Override
    public void visitCode(Code obj) {
        if (Values.STATIC_INITIALIZER.equals(getMethod().getName())) {
            state = State.SAW_NOTHING;
            super.visitCode(obj);
        }
    }
87354
final protected static function initializeMembers()
    {
        $reflector = new ReflectionClass(get_called_class());

        foreach ($reflector->getReflectionConstants() as $constant) {
            if ($constant->isPublic()) {
                new static($constant->getName(), $constant->getValue());
            }
        }
    }