CGLIB has a private exception field which needs to initialized early to ensure that
the stacktrace doesn't retain a reference to the RestartClassLoader.
160210
private void preInitializeLeakyClasses() {
		try {
			Class<?> readerClass = ClassNameReader.class;
			Field field = readerClass.getDeclaredField("EARLY_EXIT");
			field.setAccessible(true);
			((Throwable) field.get(null)).fillInStackTrace();
		}
		catch (Exception ex) {
			this.logger.warn("Unable to pre-initialize classes", ex);
		}
	}
169264
private void initializeNonPersistent() {
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.entry(tc, "initializeNonPersistent");

        // Initialise MatchSpace
        _messageProcessorMatching = new MessageProcessorMatching(this);

        // Create the access checker for discriminator authorization
        _topicAuthorization = new TopicAuthorization(this);

        _searchResultsPool.setTopicAuthorization(_topicAuthorization);

        // set the authorizer into the general MP Access Checker
        _accessChecker.setTopicAuthorization(_topicAuthorization);

        // Create the administrator
        // Needs to be done before D3 initialise as it is used by D3.
        // Needs to be done after a DestinationManager has been recovered/setup
        _administrator = new AdministratorImpl(this);

        // Venu Liberty change
        //making all TRM related objects to NULL
        // These objects all togehter can have been removed, however as the decission had been take to 
        // keep ME-ME communication, retaining them so that ME-ME related artifacts would get built
        /*
         * // 175358 Locate TRM class using JsConstants
         * TrmMeMain trm = (TrmMeMain) _engine
         * .getEngineComponent(JsConstants.SIB_CLASS_TO_ENGINE);
         * 
         * if (trm == null) {
         * if (TraceComponent.isAnyTracingEnabled()
         * && tc.isEntryEnabled())
         * SibTr.exit(tc, "initializeNonPersistent", "WsRuntimeException");
         * 
         * // Log error to console
         * SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001", new Object[] {
         * "com.ibm.ws.sib.processor.impl.MessageProcessor",
         * "1:2117:1.445" });
         * 
         * throw new SIErrorException(nls.getFormattedMessage(
         * "INTERNAL_MESSAGING_ERROR_CWSIP0001", new Object[] {
         * "com.ibm.ws.sib.processor.impl.MessageProcessor",
         * "1:2122:1.445" }, null));
         * }
         * 
         * _destinationLocationManager = trm.getDestinationLocationManager();
         * _linkManager = trm.getLinkManager();
         * _mqLinkManager = trm.getMQLinkManager();
         * RoutingManager routingManager = trm.getRoutingManager();
         * CommsErrorListener errorListener = trm.getCommsErrorListener();
         */
        _destinationLocationManager = null;
        _linkManager = null;
        _mqLinkManager = null;
        RoutingManager routingManager = null;
        CommsErrorListener errorListener = null;

        _mpio.init(errorListener, routingManager);

        try {
            // Venu Liberty change:
            //commenting below line to avoid PMI
            //_rmImpl = SIBPmiRm.getInstance();
        } catch (Exception e) {
            FFDCFilter
                            .processException(
                                              e,
                                              "com.ibm.ws.sib.processor.impl.MessageProcessor.initializeNonPersistent",
                                              "1:2142:1.445", this);

            SIErrorException e2 = new SIErrorException(nls.getFormattedMessage(
                                                                               "INTERNAL_MESSAGING_ERROR_CWSIP0002",
                                                                               new Object[] {
                                                                                             "com.ibm.ws.sib.processor.impl.MessageProcessor",
                                                                                             "1:2150:1.445", e }, null), e);

            SibTr.exception(tc, e2);

            if (TraceComponent.isAnyTracingEnabled()
                && tc.isEntryEnabled())
                SibTr.exit(tc, "initializeNonPersistent", e2);

            throw e2;
        }

        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.exit(tc, "initializeNonPersistent");
    }
1083985
private static void onGlInitialization() {
        if (glUninitialized) {
            glGetError(); // reset any previous error
            int[] size = new int[] { -1 };
            glGetIntegerv(GL_MAX_TEXTURE_SIZE, size, 0);

            int errorCode = glGetError();
            if (errorCode != GL_NO_ERROR) {
                throw Exceptions.RuntimeAssertion(
                        "Error %d getting max texture size", errorCode);
            }

            int maxTextureSize = size[0];
            if (maxTextureSize <= 0) {
                throw Exceptions.RuntimeAssertion(
                        "Invalid max texture size %d", maxTextureSize);
            }

            glMaxTextureSize = maxTextureSize;
            Log.d(TAG, "Actual GL_MAX_TEXTURE_SIZE = %d", glMaxTextureSize);

            glUninitialized = false;
        }
    }
98128
protected void initializeHelper(DataType dataType){
        String backend = Nd4j.getExecutioner().getEnvironmentInformation().getProperty("backend");
        if("CUDA".equalsIgnoreCase(backend)) {
            try {
                helper = Class.forName("org.deeplearning4j.nn.layers.dropout.CudnnDropoutHelper")
                        .asSubclass(DropoutHelper.class).getConstructor(DataType.class).newInstance(dataType);
                log.debug("CudnnDropoutHelper successfully initialized");
                if (!helper.checkSupported()) {
                    helper = null;
                }
            } catch (Throwable t) {
                if (!(t instanceof ClassNotFoundException)) {
                    log.warn("Could not initialize CudnnDropoutHelper", t);
                }
                //Unlike other layers, don't warn here about CuDNN not found - if the user has any other layers that can
                // benefit from them cudnn, they will get a warning from those
            }
        }
        initializedHelper = true;
    }
422621
private void setupExceptionPropagator() {
    if (cache2kConfiguration.getExceptionPropagator() != null) {
      return;
    }
    cache2kConfiguration.setExceptionPropagator(
      new CustomizationReferenceSupplier<ExceptionPropagator<K>>(new ExceptionPropagator<K>() {
      @Override
      public RuntimeException propagateException(Object key, final ExceptionInformation exceptionInformation) {
        return new CacheLoaderException("propagate previous loader exception", exceptionInformation.getException());
      }
    }));
  }
554721
public static void crashLocalVoltDB(String errMsg, boolean stackTrace, Throwable thrown) {
        crashLocalVoltDB(errMsg, stackTrace, thrown, true);
    }
2938
@Synchronized
    @SneakyThrows(Exception.class)
    private void tryInit() {
        if (!zkInit) {
            // we are making remote calls under a lock but this is only done for initialization at 
            // the start of controller process.
            ZKUtils.createPathIfNotExists(zkClient, zkPath, HostContainerMap.EMPTY.toBytes());
            hostContainerMapNode.getListenable().addListener(this::updateMap);
            hostContainerMapNode.start(true);
            updateMap();
            zkInit = true;
        }
    }
1168898
@Override
  public final void onBeforeScopeDestruction (@Nonnull final IScope aScopeToBeDestroyed) throws Exception
  {
    if (LOGGER.isDebugEnabled ())
      LOGGER.debug ("onBeforeScopeDestruction for '" + toString () + "' in scope " + aScopeToBeDestroyed.toString ());

    // Check init state
    if (isInInstantiation ())
    {
      if (LOGGER.isWarnEnabled ())
        LOGGER.warn ("Object currently in instantiation is destroyed soon: " + toString ());
    }
    else
      if (!isInstantiated ())
      {
        if (LOGGER.isWarnEnabled ())
          LOGGER.warn ("Object not instantiated is destroyed soon: " + toString ());
      }

    // Check destruction state
    if (isInPreDestruction ())
    {
      if (LOGGER.isErrorEnabled ())
        LOGGER.error ("Object already in pre destruction is destroyed soon again: " + toString ());
    }
    else
      if (isInDestruction ())
      {
        if (LOGGER.isErrorEnabled ())
          LOGGER.error ("Object already in destruction is destroyed soon again: " + toString ());
      }
      else
        if (isDestroyed ())
        {
          if (LOGGER.isErrorEnabled ())
            LOGGER.error ("Object already destroyed is destroyed soon again: " + toString ());
        }

    setInPreDestruction (true);

    onBeforeDestroy (aScopeToBeDestroyed);

    // do not reset PreDestruction - happens in onScopeDestruction
  }
1222411
private void initStack() {
    if (log.isInfoEnabled()) {
      log.info("Initializing Stack...");
    }
    InputStream is = null;
    try {
      //Parse dictionary, it is used for user friendly info.
      dictionary.parseDictionary(this.getClass().getClassLoader().getResourceAsStream(dictionaryFile));
      log.info("AVP Dictionary successfully parsed.");

      this.stack = new StackImpl();
      //Parse stack configuration
      is = this.getClass().getClassLoader().getResourceAsStream(configFile);
      Configuration config = new XMLConfiguration(is);
      factory = stack.init(config);
      if (log.isInfoEnabled()) {
        log.info("Stack Configuration successfully loaded.");
      }
      //Print info about applicatio
      Set<org.jdiameter.api.ApplicationId> appIds = stack.getMetaData().getLocalPeer().getCommonApplications();

      log.info("Diameter Stack  :: Supporting " + appIds.size() + " applications.");
      for (org.jdiameter.api.ApplicationId x : appIds) {
        log.info("Diameter Stack  :: Common :: " + x);
      }
      is.close();
      //Register network req listener, even though we wont receive requests
      //this has to be done to inform stack that we support application
      Network network = stack.unwrap(Network.class);
      network.addNetworkReqListener(new NetworkReqListener() {

        @Override
        public Answer processRequest(Request request) {
          //this wontbe called.
          return null;
        }
      }, this.authAppId); //passing our example app id.

    } catch (Exception e) {
      e.printStackTrace();
      if (this.stack != null) {
        this.stack.destroy();
      }

      if (is != null) {
        try {
          is.close();
        } catch (IOException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
        }
      }
      return;
    }

    MetaData metaData = stack.getMetaData();
    //ignore for now.
    if (metaData.getStackType() != StackType.TYPE_SERVER || metaData.getMinorVersion() <= 0) {
      stack.destroy();
      if (log.isEnabledFor(org.apache.log4j.Level.ERROR)) {
        log.error("Incorrect driver");
      }
      return;
    }

    try {
      if (log.isInfoEnabled()) {
        log.info("Starting stack");
      }
      stack.start();
      if (log.isInfoEnabled()) {
        log.info("Stack is running.");
      }
    } catch (Exception e) {
      e.printStackTrace();
      stack.destroy();
      return;
    }
    if (log.isInfoEnabled()) {
      log.info("Stack initialization successfully completed.");
    }
  }
171177
private void defineUncaughtExceptionHandler() {
        MethodInfo mi = mClassFile.addMethod
            (Modifiers.PRIVATE.toStatic(true), UNCAUGHT_METHOD_NAME, null,
             new TypeDesc[] {TypeDesc.forClass(Throwable.class)});
        CodeBuilder b = new CodeBuilder(mi);

        // Thread t = Thread.currentThread();
        // t.getUncaughtExceptionHandler().uncaughtException(t, e);
        TypeDesc threadType = TypeDesc.forClass(Thread.class);
        b.invokeStatic(Thread.class.getName(), "currentThread", threadType, null);
        LocalVariable threadVar = b.createLocalVariable(null, threadType);
        b.storeLocal(threadVar);
        b.loadLocal(threadVar);
        TypeDesc handlerType = TypeDesc.forClass(Thread.UncaughtExceptionHandler.class);
        b.invokeVirtual(threadType, "getUncaughtExceptionHandler", handlerType, null);
        b.loadLocal(threadVar);
        b.loadLocal(b.getParameter(0));
        b.invokeInterface(handlerType, "uncaughtException", null,
                          new TypeDesc[] {threadType, TypeDesc.forClass(Throwable.class)});
        b.returnVoid();
    }
626851
public void initialize() {
		mIsForceStop = false;
		mTagStack.clear();
		mTagValueCache.clear();
		mTagAttrCache.clear();
		mCurrentTagKey = null;
	}
71857
private void checkFieldInitialization(ClassTree tree, VisitorState state) {
    FieldInitEntities entities = collectEntities(tree, state);
    Symbol.ClassSymbol classSymbol = ASTHelpers.getSymbol(tree);
    class2Entities.put(classSymbol, entities);
    // set of all non-null instance fields f such that *some* constructor does not initialize f
    Set<Symbol> notInitializedInConstructors;
    SetMultimap<MethodTree, Symbol> constructorInitInfo;
    if (entities.constructors().isEmpty()) {
      constructorInitInfo = null;
      notInitializedInConstructors = entities.nonnullInstanceFields();
    } else {
      constructorInitInfo = checkConstructorInitialization(entities, state);
      notInitializedInConstructors = ImmutableSet.copyOf(constructorInitInfo.values());
    }
    class2ConstructorUninit.putAll(classSymbol, notInitializedInConstructors);
    Set<Symbol> notInitializedAtAll =
        notAssignedInAnyInitializer(entities, notInitializedInConstructors, state);
    SetMultimap<Element, Element> errorFieldsForInitializer = LinkedHashMultimap.create();
    // non-null if we have a single initializer method
    Symbol.MethodSymbol singleInitializerMethod = null;
    if (entities.instanceInitializerMethods().size() == 1) {
      singleInitializerMethod =
          ASTHelpers.getSymbol(entities.instanceInitializerMethods().iterator().next());
    }
    for (Symbol uninitField : notInitializedAtAll) {
      if (singleInitializerMethod != null) {
        // report it on the initializer
        errorFieldsForInitializer.put(singleInitializerMethod, uninitField);
      } else if (constructorInitInfo == null) {
        // report it on the field, except in the case where the class is externalInit and
        // we have no initializer methods
        if (!(isExternalInit(classSymbol) && entities.instanceInitializerMethods().isEmpty())) {
          errorBuilder.reportInitErrorOnField(
              uninitField, state, buildDescription(getTreesInstance(state).getTree(uninitField)));
        }
      } else {
        // report it on each constructor that does not initialize it
        for (MethodTree methodTree : constructorInitInfo.keySet()) {
          Set<Symbol> uninitFieldsForConstructor = constructorInitInfo.get(methodTree);
          if (uninitFieldsForConstructor.contains(uninitField)) {
            errorFieldsForInitializer.put(ASTHelpers.getSymbol(methodTree), uninitField);
          }
        }
      }
    }
    for (Element constructorElement : errorFieldsForInitializer.keySet()) {
      errorBuilder.reportInitializerError(
          (Symbol.MethodSymbol) constructorElement,
          errMsgForInitializer(errorFieldsForInitializer.get(constructorElement)),
          state,
          buildDescription(getTreesInstance(state).getTree(constructorElement)));
    }
    // For static fields
    Set<Symbol> notInitializedStaticFields = notInitializedStatic(entities, state);
    for (Symbol uninitSField : notInitializedStaticFields) {
      // Always report it on the field for static fields (can't do @SuppressWarnings on a static
      // initialization block
      // anyways).
      errorBuilder.reportInitErrorOnField(
          uninitSField, state, buildDescription(getTreesInstance(state).getTree(uninitSField)));
    }
  }
694034
public void init(BaseField field, BaseListener listenerToDisable,  String strDisableOnMatch,  boolean bDisableIfMatch)
    {
        super.init(field);
        m_listenerToDisable = listenerToDisable;
        m_strDisableOnMatch = strDisableOnMatch;
        m_bDisableIfMatch = bDisableIfMatch;
    }
863380
private synchronized void checkInitialization() throws DevFailed {
        if (initImpl != null) {
            isInitializing = initImpl.isInitInProgress();
        } else {
            isInitializing = false;
        }
        if (isInitializing) {
            throw DevFailedUtils.newDevFailed("CONCURRENT_ERROR", name + " in Init command ");
        }
    }
622271
@Override
    public void init() throws InitializationException {
        if (null == embedded || "true".equalsIgnoreCase(embedded)) {
            Log.warn("Audit4j Database Handler runs on embedded mode. See " + ErrorGuide.ERROR_URL
              + "embeddeddb for further details.");
            server = HSQLEmbededDBServer.getInstance();
            db_driver = server.getDriver();
            db_url = server.getNetworkProtocol() + ":file:audit4jdb";
            if (db_user == null) {
                db_user = Utils.EMBEDED_DB_USER;
            }
            if (db_password == null) {
                db_password = Utils.EMBEDED_DB_PASSWORD;
            }
            server.setUname(db_user);
            server.setPassword(db_password);
            server.start();
        }

        factory = ConnectionFactory.getInstance();
        factory.setDataSource(dataSource);
        factory.setDriver(getDb_driver());
        factory.setUrl(getDb_url());
        factory.setUser(getDb_user());
        factory.setPassword(getDb_password());

        factory.setDataSourceClass(db_datasourceClass);
        factory.setAutoCommit(db_pool_autoCommit);
        if (db_pool_connectionTimeout != null) {
            factory.setConnectionTimeout(db_pool_connectionTimeout);
        }
        if (db_pool_idleTimeout != null) {
            factory.setIdleTimeout(db_pool_idleTimeout);
        }
        if (db_pool_maximumPoolSize != null) {
            factory.setMaximumPoolSize(db_pool_maximumPoolSize);
        }
        if (db_pool_maxLifetime != null) {
            factory.setMaxLifetime(db_pool_maxLifetime);
        }
        if (db_pool_minimumIdle != null) {
            factory.setMinimumIdle(db_pool_minimumIdle);
        }

        if (getDb_connection_type() != null && getDb_connection_type().equals(POOLED_CONNECTION)) {
            factory.setConnectionType(ConnectionType.POOLED);
        } else if (getDb_connection_type() != null && getDb_connection_type().equals(JNDI_CONNECTION)) {
            factory.setConnectionType(ConnectionType.JNDI);
            factory.setJndiDataSource(getDb_jndi_datasource());
        } else {
            factory.setConnectionType(ConnectionType.SINGLE);
        }

        factory.init();

        try {
            getDaoForTable(default_table_name);
        } catch (HandlerException e) {
            throw new InitializationException("Unable to create tables", e);
        }

    }
1202819
private void initializeVerifier() {
        ManifestEntryVerifier mev = null;

        // Verify "META-INF/" entries...
        try {
            String[] names = getMetaInfEntryNames();
            if (names != null) {
                for (int i = 0; i < names.length; i++) {
                    JarEntry e = getJarEntry(names[i]);
                    if (e == null) {
                        throw new JarException("corrupted jar file");
                    }
                    if (!e.isDirectory()) {
                        if (mev == null) {
                            mev = new ManifestEntryVerifier
                                (getManifestFromReference());
                        }
                        byte[] b = getBytes(e);
                        if (b != null && b.length > 0) {
                            jv.beginEntry(e, mev);
                            jv.update(b.length, b, 0, b.length, mev);
                            jv.update(-1, null, 0, 0, mev);
                        }
                    }
                }
            }
        } catch (IOException ex) {
            // if we had an error parsing any blocks, just
            // treat the jar file as being unsigned
            jv = null;
            verify = false;
            if (JarVerifier.debug != null) {
                JarVerifier.debug.println("jarfile parsing error!");
                ex.printStackTrace();
            }
        }

        // if after initializing the verifier we have nothing
        // signed, we null it out.

        if (jv != null) {

            jv.doneWithMeta();
            if (JarVerifier.debug != null) {
                JarVerifier.debug.println("done with meta!");
            }

            if (jv.nothingToVerify()) {
                if (JarVerifier.debug != null) {
                    JarVerifier.debug.println("nothing to verify!");
                }
                jv = null;
                verify = false;
            }
        }
    }
1008672
@Override
    public void postInitModule() throws ModuleInitializationException {
        ConnectionPoolManager mgr =
                (ConnectionPoolManager) getServer()
                        .getModule("org.fcrepo.server.storage.ConnectionPoolManager");
        if (mgr == null) {
            throw new ModuleInitializationException("ConnectionPoolManager module not loaded.",
                                                    getRole());
        }
        try {
            m_pidGenerator = new DBPIDGenerator(mgr.getPool(), m_oldPidGenDir);
        } catch (Exception e) {
            String msg = "Can't get default connection pool";
            logger.error(msg, e);
            throw new ModuleInitializationException(msg, getRole());
        }
    }