TODO Always validate changes against Tomcat AbsCadiValve and Jaspi CadiSAM Init functions
182610
public void init(FilterConfig filterConfig) throws ServletException {
		// need the Context for Logging, instantiating ClassLoader, etc
		ServletContextAccess sca=new ServletContextAccess(filterConfig); 
		if(access==null) {
			access = sca;
		}
		
		// Set Protected getter with base Access, for internal class instantiations
		init(new FCGet(access, sca.context(), filterConfig));
	}
858482
private void init() {
        setTitle("Validation Framework Test");
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

        // Create content pane
        JPanel contentPane = new JPanel(new MigLayout("fill, wrap 2", "[]related[grow]",
                "[]related[]related[]related[]unrelated[]"));
//		contentPane.setBorder(new EmptyBorder(50, 50, 50, 50));
//		setContentPane(new JScrollPane(contentPane));
        setContentPane(contentPane);

        // Input fields
        contentPane.add(new JLabel("Tooltip:"));
        JTextField textField1 = new JTextField();
        contentPane.add(textField1, "growx");
        contentPane.add(new JLabel("Color:"));
        JTextField textField2 = new JTextField();
        contentPane.add(textField2, "growx");
        contentPane.add(new JLabel("Icon:"));
        JTextField textField3 = new JTextField();
        contentPane.add(textField3, "growx");
        contentPane.add(new JLabel("Icon with tooltip:"));

        NumberFormat courseFormat = NumberFormat.getIntegerInstance();
        courseFormat.setMinimumIntegerDigits(3);
        courseFormat.setMaximumIntegerDigits(4);
        courseFormat.setMaximumFractionDigits(0);
        NumberFormatter courseFormatter = new NumberFormatter(courseFormat);
        courseFormatter.setMinimum(0.0);
        courseFormatter.setMaximum(359.0);
        JFormattedTextField formattedTextField4 = new JFormattedTextField(courseFormatter);
        contentPane.add(formattedTextField4, "growx");

        contentPane.add(new JLabel("Icon with tooltip:"));

        courseFormat = NumberFormat.getIntegerInstance();
        courseFormat.setMinimumIntegerDigits(3);
        courseFormat.setMaximumIntegerDigits(4);
        courseFormat.setMaximumFractionDigits(0);
        courseFormatter = new NumberFormatter(courseFormat);
        courseFormatter.setMinimum(0.0);
        courseFormatter.setMaximum(359.0);
        JFormattedTextField formattedTextField5 = new JFormattedTextField(courseFormatter);
        contentPane.add(formattedTextField5, "growx");

        // Apply button
        JButton applyButton = new JButton("Apply");
        contentPane.add(applyButton, "growx, span");

        // Set size
        pack();
        Dimension size = getSize();
        size.width += 100;
        setMinimumSize(size);

        // Set location
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setLocation((screenSize.width - size.width) / 2, (screenSize.height - size.height) / 3);

        // Create validators
        ResultCollector<InputFieldResult, Boolean> resultCollector1 = new ResultCollector<InputFieldResult,
                Boolean>(new InputFieldResultToBooleanTransformer());
        ResultCollector<InputFieldResult, Boolean> resultCollector2 = new ResultCollector<InputFieldResult,
                Boolean>(new InputFieldResultToBooleanTransformer());
        ResultCollector<InputFieldResult, Boolean> resultCollector3 = new ResultCollector<InputFieldResult,
                Boolean>(new InputFieldResultToBooleanTransformer());
        ResultCollector<Boolean, Boolean> resultCollector4 = new ResultCollector<Boolean, Boolean>();
        ResultCollector<Boolean, Boolean> resultCollector5 = new ResultCollector<Boolean, Boolean>();
        createValidator1(textField1, resultCollector1);
        createValidator2(textField2, resultCollector2);
        createValidator3(textField3, resultCollector3);
        createValidator4(formattedTextField4, resultCollector4);
        createValidator4(formattedTextField5, resultCollector5);

        // Create global validator
        collect(resultCollector1) //
                .collect(resultCollector2) //
                .collect(resultCollector3) //
                .collect(resultCollector4) //
                .collect(resultCollector5) //
                .check(new AndBooleanRule()) //
                .handleWith(new ComponentEnablingBooleanResultHandler(applyButton));
    }
938754
function init(domainManager) {
    if (!domainManager.hasDomain("extensionManager")) {
        domainManager.registerDomain("extensionManager", {major: 0, minor: 1});
    }
    domainManager.registerCommand(
        "extensionManager",
        "validate",
        validate,
        true,
        "Verifies that the contents of the given ZIP file are a valid Brackets extension package",
        [{
            name: "path",
            type: "string",
            description: "absolute filesystem path of the extension package"
        }, {
            name: "options",
            type: "{requirePackageJSON: ?boolean}",
            description: "options to control the behavior of the validator"
        }],
        [{
            name: "errors",
            type: "string|Array.<string>",
            description: "download error, if any; first string is error code (one of Errors.*); subsequent strings are additional info"
        }, {
            name: "metadata",
            type: "{name: string, version: string}",
            description: "all package.json metadata (null if there's no package.json)"
        }]
    );
    domainManager.registerCommand(
        "extensionManager",
        "install",
        _cmdInstall,
        true,
        "Installs the given Brackets extension if it is valid (runs validation command automatically)",
        [{
            name: "path",
            type: "string",
            description: "absolute filesystem path of the extension package"
        }, {
            name: "destinationDirectory",
            type: "string",
            description: "absolute filesystem path where this extension should be installed"
        }, {
            name: "options",
            type: "{disabledDirectory: !string, apiVersion: !string, nameHint: ?string, systemExtensionDirectory: !string, proxy: ?string}",
            description: "installation options: disabledDirectory should be set so that extensions can be installed disabled."
        }],
        [{
            name: "errors",
            type: "string|Array.<string>",
            description: "download error, if any; first string is error code (one of Errors.*); subsequent strings are additional info"
        }, {
            name: "metadata",
            type: "{name: string, version: string}",
            description: "all package.json metadata (null if there's no package.json)"
        }, {
            name: "disabledReason",
            type: "string",
            description: "reason this extension was installed disabled (one of Errors.*), none if it was enabled"
        }, {
            name: "installationStatus",
            type: "string",
            description: "Current status of the installation (an extension can be valid but not installed because it's an update"
        }, {
            name: "installedTo",
            type: "string",
            description: "absolute path where the extension was installed to"
        }, {
            name: "commonPrefix",
            type: "string",
            description: "top level directory in the package zip which contains all of the files"
        }]
    );
    domainManager.registerCommand(
        "extensionManager",
        "update",
        _cmdUpdate,
        true,
        "Updates the given Brackets extension (for which install was generally previously attemped). Brackets must be quit after this.",
        [{
            name: "path",
            type: "string",
            description: "absolute filesystem path of the extension package"
        }, {
            name: "destinationDirectory",
            type: "string",
            description: "absolute filesystem path where this extension should be installed"
        }, {
            name: "options",
            type: "{disabledDirectory: !string, apiVersion: !string, nameHint: ?string, systemExtensionDirectory: !string}",
            description: "installation options: disabledDirectory should be set so that extensions can be installed disabled."
        }],
        [{
            name: "errors",
            type: "string|Array.<string>",
            description: "download error, if any; first string is error code (one of Errors.*); subsequent strings are additional info"
        }, {
            name: "metadata",
            type: "{name: string, version: string}",
            description: "all package.json metadata (null if there's no package.json)"
        }, {
            name: "disabledReason",
            type: "string",
            description: "reason this extension was installed disabled (one of Errors.*), none if it was enabled"
        }, {
            name: "installationStatus",
            type: "string",
            description: "Current status of the installation (an extension can be valid but not installed because it's an update"
        }, {
            name: "installedTo",
            type: "string",
            description: "absolute path where the extension was installed to"
        }, {
            name: "commonPrefix",
            type: "string",
            description: "top level directory in the package zip which contains all of the files"
        }]
    );
    domainManager.registerCommand(
        "extensionManager",
        "remove",
        _cmdRemove,
        true,
        "Removes the Brackets extension at the given path.",
        [{
            name: "path",
            type: "string",
            description: "absolute filesystem path of the installed extension folder"
        }],
        {}
    );
    domainManager.registerCommand(
        "extensionManager",
        "downloadFile",
        _cmdDownloadFile,
        true,
        "Downloads the file at the given URL, saving it to a temp location. Callback receives path to the downloaded file.",
        [{
            name: "downloadId",
            type: "string",
            description: "Unique identifier for this download 'session'"
        }, {
            name: "url",
            type: "string",
            description: "URL to download from"
        }, {
            name: "proxy",
            type: "string",
            description: "optional proxy URL"
        }],
        {
            type: "string",
            description: "Local path to the downloaded file"
        }
    );
    domainManager.registerCommand(
        "extensionManager",
        "abortDownload",
        _cmdAbortDownload,
        false,
        "Aborts any pending download with the given id. Ignored if no download pending (may be already complete).",
        [{
            name: "downloadId",
            type: "string",
            description: "Unique identifier for this download 'session', previously pased to downloadFile"
        }],
        {
            type: "boolean",
            description: "True if the download was pending and able to be canceled; false otherwise"
        }
    );
}
1185049
private static void validateProviderDef(final ProviderDef pluginDef) throws PluginException {

        if (null == pluginDef.getPluginType() || "".equals(pluginDef.getPluginType())) {
            throw new PluginException("Script plugin missing plugin-type");
        }
        if ("script".equals(pluginDef.getPluginType())) {
            validateScriptProviderDef(pluginDef);
        } else if ("ui".equals(pluginDef.getPluginType())) {
            validateUIProviderDef(pluginDef);
        } else {
            throw new PluginException("Script plugin has invalid plugin-type: " + pluginDef.getPluginType());
        }
    }
381653
async function register(server, options) {
    const validation = validateOptions(options);

    if (validation.error) {
        throw validation.error;
    }

    const {
        components,
        handlebars,
        helpersPath,
        path,
        uriContext,
        routes,
        rootDir
    } = validation.value;


    server.log(['info', 'windshield'], "application directory identified as: " + rootDir);

    server.views({
        engines: {html: handlebars},
        relativeTo: rootDir,
        path,
        helpersPath
    });

    const componentMap = ComponentMap(components);

    const hapiHandler = handlerComposer(componentMap);
    const hapiRoutes = processRoutes(hapiHandler, uriContext, routes);
    server.route(hapiRoutes);
    templateInit(handlebars);

    return componentMap.init(handlebars);
}
480932
private void validateBeforeStart() {
        LibraryUtils.checkArgumentNotNull(config, "Configuration is null.");
        config.validate();

        LibraryUtils.checkArgumentNotNull(sourceFilter, "sourceFilter is null.");
        LibraryUtils.checkArgumentNotNull(eventFilter, "eventFilter is null.");
        LibraryUtils.checkArgumentNotNull(eventsProcessor, "eventsProcessor is null.");
        LibraryUtils.checkArgumentNotNull(progressReporter, "progressReporter is null.");
        LibraryUtils.checkArgumentNotNull(exceptionHandler, "exceptionHandler is null.");

        LibraryUtils.checkArgumentNotNull(scheduledThreadPool, "scheduledThreadPool is null.");
        LibraryUtils.checkArgumentNotNull(mainThreadPool, "mainThreadPool is null.");
        LibraryUtils.checkArgumentNotNull(readerFactory, "readerFactory is null.");
    }
674786
private static void checkValidObject(Path path, AbstractConfigObject reference,
            AbstractConfigObject value,
            List<ConfigException.ValidationProblem> accumulator) {
        for (Map.Entry<String, ConfigValue> entry : reference.entrySet()) {
            String key = entry.getKey();

            Path childPath;
            if (path != null)
                childPath = Path.newKey(key).prepend(path);
            else
                childPath = Path.newKey(key);

            AbstractConfigValue v = value.get(key);
            if (v == null) {
                addMissing(accumulator, entry.getValue(), childPath, value.origin());
            } else {
                checkValid(childPath, entry.getValue(), v, accumulator);
            }
        }
    }
1046634
public static List<ModelError> validateComponentRecipes( File applicationFilesDirectory, Component component ) {

		List<ModelError> result;
		if( "puppet".equalsIgnoreCase( component.getInstallerName()))
			result = validatePuppetComponent( applicationFilesDirectory, component );
		else if( "script".equalsIgnoreCase( component.getInstallerName()))
			result = validateScriptComponent( applicationFilesDirectory, component );
		else
			result = Collections.emptyList();

		return result;
	}
15997
public void doTag()
            throws JspException, IOException
    {
        if (hasErrors()) {
            reportErrors();
            return;
        }

        // See if there is a TreeRoot already defined.
        _expr = new ExpressionHandling(this);
        TreeElement root = null;
        try {
            root = getTreeRoot(_expr);
        }
        catch (IllegalExpressionException iee) {
            String s = Bundle.getString("TreeRootError", new Object[]{_dataSource, iee.getMessage()});
            registerTagError(s, null);
            return;
        }
        if (hasErrors()) {
            reportErrors();
            return;
        }

        // If we don't have a root element, then we need to create it by processing the body which contains
        // /*<TreeItems>*/ tags that define the tree.
        if (root == null) {
            getBufferBody(false);

            // check to see if we should exit due to an error occuring
            // write out any error text and return.
            if (_errorText != null) {
                write(_errorText.toString());
                if (hasErrors())
                    reportErrors();
            }
        }

        // Set the image Root if it is not set.
        PageContext pageContext = getPageContext();
        if (_iState.getImageRoot() == null)
            _iState.setImageRoot(((HttpServletRequest) pageContext.getRequest()).getContextPath() + "/" +
                    TagConfig.getTreeImageLocation());

        //  errors should have been caught above
        TreeElement treeRoot = getTreeRoot(_expr);

        // if the tree root hasn't been defined, then we need to update the object that is
        // pointed at by the dataSource expression.
        if (treeRoot == null) {
            if (_rootNode != null) {
                try {
                    String datasource = "{" + _dataSource + "}";
                    _expr.updateExpression(datasource, _rootNode, pageContext);
                }
                catch (ExpressionUpdateException e) {
                    String s = Bundle.getString("Tags_UnableToWriteTree", new Object[]{_dataSource, e.getMessage()});
                    registerTagError(s, null);
                    reportErrors();
                    return;
                }
                treeRoot = _rootNode;
            }

            // indicate an update error and return
            if (treeRoot == null) {
                String s = Bundle.getString("Tags_TreeNoAttribute", _dataSource);
                registerTagError(s, null);
                reportErrors();
                return;
            }

        }

        // set the root image
        if (treeRoot instanceof ITreeRootElement) {
            ITreeRootElement tre = (ITreeRootElement) treeRoot;
            if (tre.getRootNodeExpandedImage() == null) {
                tre.setRootNodeExpandedImage((_rootNodeExpandedImage != null) ?
                        _rootNodeExpandedImage : InheritableState.IMAGE_ROOT_EXPANDED);
            }
            if (tre.getRootNodeCollapsedImage() == null) {
                tre.setRootNodeCollapsedImage((_rootNodeCollapsedImage != null) ?
                        _rootNodeCollapsedImage : InheritableState.IMAGE_ROOT_COLLAPSED);
            }
        }

        // if we are running the tree at the client, then
        // we need to register the tree with the NameService
        if (_trs.runAtClient) {
            // it's currently not legal to have a runAtClient but not be an instance of INameable which is
            // implemented by the ITreeRootElement.
            if (!(treeRoot instanceof INameable)) {
                String s = Bundle.getString("Tags_TreeRunAtClientRoot", null);
                registerTagError(s, null);
                reportErrors();
                return;
            }

            // name the tree if it hasn't been named already
            // or if no longer stored in the NameService, add it.
            INameable in = (INameable) treeRoot;
            String o = in.getObjectName();
            NameService ns = NameService.instance(pageContext.getSession());
            if (o == null) {
                ns.nameObject("Tree", in);
                ns.put(in);
            }
            else if (ns.get(o) == null) {
                ns.put(in);
            }
        }


        // prepare to render the tree
        HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
        HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
        InternalStringBuilder sb = new InternalStringBuilder(1024);
        StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb);

        // this is the treeId from the request.  If there was an tree expansion this will be
        // non-null and it identifies what tree had the expansion request.
        // we need to qualify the tree based upon the tagId
        assert(_trs.tagId != null);
        _trs.tagId = getIdForTagId(_trs.tagId);

        String treeId = request.getParameter(TreeElement.TREE_ID);
        if (treeId != null && _trs.tagId.equals(treeId)) {
            TreeHelpers.processTreeRequest(treeId, treeRoot, request, response);
        }

        // check for the nodes that are expanded...
        // Add the script support for the tree.
        if (_trs.runAtClient) {
            IScriptReporter sr = getScriptReporter();
            if (sr == null) {
                String s = Bundle.getString("Tags_TreeRunAtClientSC", null);
                registerTagError(s, null);
                reportErrors();
                return;
            }

            ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request);
            if (!srs.isFeatureWritten(CoreScriptFeature.DYNAMIC_INIT)) {
                String s = Bundle.getString("Tags_TreeHtmlRunAtClient", null);
                registerTagError(s, null);
                reportErrors();
                return;
            }

            assert(treeRoot instanceof ITreeRootElement);
            ITreeRootElement tre = (ITreeRootElement) treeRoot;

            Object[] args = new Object[8];
            args[0] = _iState.getImageRoot() + "/";
            args[1] = tre.getObjectName();
            args[2] = _iState.getNodeCollapsedImage();
            args[3] = _iState.getNodeExpandedImage();
            args[4] = _iState.getLastNodeCollapsedImage();
            args[5] = _iState.getLastNodeExpandedImage();
            args[6] = Bundle.getString("Tags_TreeAltTextExpand", null);
            args[7] = Bundle.getString("Tags_TreeAltTextCollapse", null);
            srs.writeFeature(sr, writer, CoreScriptFeature.TREE_INIT, false, false, args);

            AjaxUrlInfo ajaxInfo = URLRewriterService.getAjaxUrl(pageContext.getServletContext(),request,treeRoot);
            if (ajaxInfo.getCommandPrefix() != null) {
                args = new Object[2];
                args[0] = tre.getObjectName();
                args[1] = ajaxInfo.getCommandPrefix();
                srs.writeFeature(sr,writer, CoreScriptFeature.AJAX_PREFIX, false,false,args);
            }
            if (ajaxInfo.getAjaxParameter() != null) {
                args = new Object[2];
                args[0] = tre.getObjectName();
                args[1] = ajaxInfo.getAjaxParameter();
                srs.writeFeature(sr,writer, CoreScriptFeature.AJAX_PARAM, false,false,args);
            }

            tre.setTreeRenderState(_trs);
            tre.setInheritableState(_iState);
        }

        // create a containing tree level <div> and place the tree level styles on it.
        _divState.styleClass = _treeStyleClass;
        _divState.style = _treeStyle;
        String divId = null;
        if (_renderTagIdLookup) {
            _divState.id = _trs.tagId;
            divId = _divState.id;
        }

        // if we are running on the client then we need to output the tree name into the top level tree <div> tag
        if (_trs.runAtClient) {
            _divState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, "netui:treeName",
                    ((INameable) treeRoot).getObjectName());
        }

        TagRenderingBase divRenderer = TagRenderingBase.Factory.getRendering(TagRenderingBase.DIV_TAG, request);
        divRenderer.doStartTag(writer, _divState);
        sb.append("\n");

        // Render the tree.
        AttributeRenderer extraAttrs = new AttributeRenderer();
        String treeRendererClassName = TagConfig.getTreeRendererClassName();
        TreeRenderer tr = TreeRendererFactory.getInstance(treeRendererClassName);
        if (tr == null) {
            tr = new TreeRenderer();
        }
        tr.init(_trs, request, response, pageContext.getServletContext());
        tr.setTreeRenderSupport(new TagTreeRenderSupport(this));
        tr.render(writer, treeRoot, 0, extraAttrs, _iState);
        if (hasErrors()) {
            reportErrors();
            return;
        }

        // finish the tree representation and write it
        divRenderer.doEndTag(writer);
        sb.append("\n");
        write(sb.toString());

        if (!(treeRoot instanceof ITreeRootElement)) {
            boolean error = false;
            if (_rootNodeExpandedImage != null) {
                String s = Bundle.getString("Tags_TreeRootImageError", null);
                registerTagError(s, null);
                error = true;
            }
            if (_rootNodeCollapsedImage != null) {
                String s = Bundle.getString("Tags_TreeRootImageError", null);
                registerTagError(s, null);
                error = true;
            }
            if (error) {
                reportErrors();
            }            
        }

        // check to see if we are writing out the java.
        if (_renderTagIdLookup) {
            String jsOut = renderDefaultJavaScript(request, divId);
            if (jsOut != null)
                write(jsOut);
        }
    }
1361279
@SuppressWarnings("unchecked")
	public void contextInitialized(ServletContextEvent sce) {
		synchronized (Jaguar.class) {
			if (!running()) {
				bootstrap();
			}
		}
		
		assemble(this);
		WebContext<ServletContext> context = (WebContext<ServletContext>) container.component(container.contexts().get(Application.class));
		context.associate(sce.getServletContext());
		Class<?> deployment = deployment(sce.getServletContext());
		
		if (deployment != null) {
			Jaguar.deployment(deployment);
		}
		
		install(components(sce.getServletContext()));
	}
198197
function inits() {
  log( "init", "step="+step+" ajaxOngoing="+ajaxOngoing );
  if ( getParam( 'nc' ) == 'true' ) {
    noCache = "?nc="+ Math.random();
  }

  if ( ajaxOngoing == 0 ) { 
    if ( step == "load-lang" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load module list...');
      loadLang();
      step = "loadmodulemap";
    } else if ( step == "loadmodulemap" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load module list...');
      loadModuleList();
      step = "loaddecor";
    } else if ( step == "loaddecor" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load decor config...');
      loadDecorList();
      step = "loadstructure";
    } else  if ( step == "loadstructure" ) {
      ajaxOngoing++;
      log( 'init', 'Load Structure File ...');
      loadStructure();
      step = "loadincludes";
    } else if ( step == "loadincludes" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load include JS modules ...');
      checkModules( );
      loadIncludes();
      step = "loadmodules";
    } else if ( step == "loadmodules" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load JS modules ...');
      loadModules();
      if ( layout.theme != null ) {
        loadCSSrelPath( 'css-custom/'+layout.theme+'.css' );
        //jQuery('head').append('<link rel="stylesheet" rel="nofollow" href="css-custom/'+layout.theme+'.css" type="text/css" />');        
      }
      loadCSSrelPath( "css-custom/custom.css" );
      if ( pageInfo["layoutMode"] == 'tablet' ) {
        loadCSSrelPath( "css-custom/custom-t.css" );
        //jQuery('head').append('<link rel="stylesheet" rel="nofollow" href="css-custom/custom-t.css" type="text/css" />');        
      } else if ( pageInfo["layoutMode"] == 'mobile' ) {
        loadCSSrelPath( "css-custom/custom-m.css" );
        //jQuery('head').append('<link rel="st<ylesheet" rel="nofollow" href="css-custom/custom-m.css" type="text/css" />');
      } 
      step = "initmodules";
    } else  if ( step == "initmodules" ) {
      ajaxOngoing++;
      log( 'init', 'Load Structure File ...');
      initModules( layout );
      step = "buildstructure";
    } else  if ( step == "buildstructure" ) {
      ajaxOngoing++;
      log( 'init', 'Start to build HTML ...');
      buildStructure( layout );
      step = "loadres-ht";
    } else  if ( step == "loadres-ht" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load resources HTML ...');
      loadResourcesHT();
      step = "call-hooks";
    } else  if ( step == "call-hooks" ) {
      log( 'init', 'Call module hooks ...');
      callHooks();
      step = "loadres-js";
    } else  if ( step == "loadres-js" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load resources JS ...');
      loadResourcesJS();
      step = "callbacks";
    } else  if ( step == "callbacks" ) {
      log( 'init', 'Start callback methods for resources...');
      resourceCallbacks();
      step = "dialogs";
    } else  if ( step == "dialogs" ) {
      log( 'init', 'Start load dialogs for resources...');
      resourceDialogs();
      step = "afterInit";
    } else  if ( step == "afterInit" ) {
      log( 'init', 'Start load dialogs for resources...');
      startModulesAfterPageLoad( layout );
      clearInterval( initTimerId );
      step = "done";
    }
  }  
}
238586
@Override
    public boolean isActive() {
        try {
            validateInitialization();
        } catch (InvalidStateException ex) {
            return false;
        }
        return informerWatchDog.isActive() && serverWatchDog.isActive();
    }
1141806
@Override
    public void contextInitialized(ServletContextEvent event) {
        try {
            initEurekaEnvironment();
            initEurekaServerContext();

            ServletContext sc = event.getServletContext();
            sc.setAttribute(EurekaServerContext.class.getName(), serverContext);
        } catch (Throwable e) {
            logger.error("Cannot bootstrap eureka server :", e);
            throw new RuntimeException("Cannot bootstrap eureka server :", e);
        }
    }
1335701
function initializeState(requester, updateParams) {
        var currentRequester = requester || "";
        _updateParams = updateParams;
        installerPath = path.resolve(updateDir, updateParams.installerName);
        postMessageToBrackets(MessageIds.NOTIFY_INITIALIZATION_COMPLETE, currentRequester);
    }
690739
function main() {

    var database = fs.createWriteStream('./lib/database-min.js', { flags: 'w', encoding: 'utf8' });
    var testFile;

    fs.mkdir('./data', 493, function (error) {  // 493 == 0755 (no octal in strict mode.)
        // ignore errors.
    });
    
    database.write("// Do not edit this file, your changes will be lost.\n");
    database.write("module.exports = { \n");
    getJSON('http://alscan.info/agent_groups/groups.json', function (groups) {
        var s = JSON.stringify(groups);
        database.write("groups:" + s + ",\n");
        testFile = fs.createWriteStream('./data/groups.json', { flags: 'w', encoding: 'utf8' });
        testFile.write(s+"\n");
        testFile.end();
        getJSON('http://alscan.info/agent_sources/sources.json', function (sources) {
            var s = JSON.stringify(sources);
            database.write("sources:" + s + ",\n");
            testFile = fs.createWriteStream('./data/sources.json', { flags: 'w', encoding: 'utf8' });
            testFile.write(s+"\n");
            testFile.end();
            getJSON('http://alscan.info/patterns/patterns.json', function (patterns) {
                database.write("patterns:[\n");
                patterns.forEach(function (pattern) {
                    database.write("{p: new RegExp('" + pattern.pattern + "'), x:" + 
                            agentdb.getX(pattern.groupId, pattern.sourceId) + "},");
                });
                database.write("],\n");
                testFile = fs.createWriteStream('./data/patterns.json', { flags: 'w', encoding: 'utf8' });
                testFile.write(JSON.stringify(patterns)+"\n");
                testFile.end();
                getJSON('http://alscan.info/agents/agents.json', function (agents) {
                    var hash = new HashTable(HASH_TABLE_SIZE, HASH_TABLE_SEED, HASH_TABLE_MULTIPLIER);
                    agents.forEach(function (agent) {
                        if (agent.status < 2) {
                            var obj = { a: agent.agent, x: agentdb.getX(agent.groupId, agent.sourceId) };
                            hash.add('a', obj);
                        }
                    });
                    database.write("table:" + JSON.stringify(hash.table) + ",\n");
                    database.write("HASH_TABLE_SIZE:" + HASH_TABLE_SIZE + ",\n");
                    database.write("HASH_TABLE_SEED:" + HASH_TABLE_SEED + ",\n");
                    database.write("HASH_TABLE_MULTIPLIER:" + HASH_TABLE_MULTIPLIER + ",\n");
                    database.write("hash: undefined\n}\n");
                    testFile = fs.createWriteStream('./data/agents.json', { flags: 'w', encoding: 'utf8' });
                    testFile.write(JSON.stringify(agents)+"\n");
                    testFile.end();
                    if (debug) {
                        var history = hash.getHistory();
                        console.log("Hash table history");
                        for (var n=0; n < history.length; n++) {
                            console.log("  Depth=" + n + ", count=" + history[n] + ", percent=" + (history[n] / HASH_TABLE_SIZE));
                        }
                    }
                });
            });
        });
    });
}
334770
function isAccessedVarChanged(cacheData) {
  for (let key in cacheData.env) {
    if (cacheData.env[key] !== process.env[key]) {
      return true;
    }
  }

  return false;
}
94091
function init(domainManager) {
        if (!domainManager.hasDomain("AutoUpdate")) {
            domainManager.registerDomain("AutoUpdate", {
                major: 0,
                minor: 1
            });
        }
        _domainManager = domainManager;

        domainManager.registerCommand(
            "AutoUpdate",
            "initNode",
            initNode,
            true,
            "Initializes node for the auto update",
            [
                {
                    name: "initObj",
                    type: "object",
                    description: "json object containing init information"
                }
            ],
            []
        );

        domainManager.registerCommand(
            "AutoUpdate",
            "data",
            receiveMessageFromBrackets,
            true,
            "Receives messages from brackets",
            [
                {
                    name: "msgObj",
                    type: "object",
                    description: "json object containing message info"
                }
            ],
            []
        );

        domainManager.registerEvent(
            "AutoUpdate",
            "data",
            [
                {
                    name: "msgObj",
                    type: "object",
                    description: "json object containing message info to pass to brackets"
                }
            ]
        );
    }