/* ********************************************************************** *
*
Private and package private methods                                    *
*
**********************************************************************
327500
private void updateSingle(
            ReadOnlyStyledDocument<PS, SEG, S> newValue,
            RichTextChange<PS, SEG, S> change,
            MaterializedListModification<Paragraph<PS, SEG, S>> parChange) {
        updateMulti(newValue, Collections.singletonList(change), Collections.singletonList(parChange));
    }
340686
function &_buildFrame(&$package)
    {
        ob_start();

        echo '<body id="frame">', "\n\n";

        echo '<h1><a href="package-summary.html" target="main">', $package->name(), "</a></h1>\n\n";

        $classes =& $package->ordinaryClasses();
        if ($classes && is_array($classes)) {
            ksort($classes);
            echo "<h2>Classes</h2>\n";
            echo "<ul>\n";
            foreach ($classes as $name => $class) {
                echo '<li><a href="', str_repeat('../', $package->depth() + 1), $classes[$name]->asPath(), '" target="main">', $classes[$name]->name(), "</a></li>\n";
            }
            echo "</ul>\n\n";
        }

        $interfaces =& $package->interfaces();
        if ($interfaces && is_array($interfaces)) {
            ksort($interfaces);
            echo "<h2>Interfaces</h2>\n";
            echo "<ul>\n";
            foreach ($interfaces as $name => $interface) {
                echo '<li><a href="', str_repeat('../', $package->depth() + 1), $interfaces[$name]->asPath(), '" target="main">', $interfaces[$name]->name(), "</a></li>\n";
            }
            echo "</ul>\n\n";
        }

        $traits =& $package->traits();
        if ($traits && is_array($traits)) {
            ksort($traits);
            echo "<h2>Traits</h2>\n";
            echo "<ul>\n";
            foreach ($traits as $name => $trait) {
                echo '<li><a href="', str_repeat('../', $package->depth() + 1), $traits[$name]->asPath(), '" target="main">', $traits[$name]->name(), "</a></li>\n";
            }
            echo "</ul>\n\n";
        }

        $exceptions =& $package->exceptions();
        if ($exceptions && is_array($exceptions)) {
            ksort($exceptions);
            echo "<h2>Exceptions</h2>\n";
            echo "<ul>\n";
            foreach ($exceptions as $name => $exception) {
                echo '<li><a href="', str_repeat('../', $package->depth() + 1), $exceptions[$name]->asPath(), '" target="main">', $exceptions[$name]->name(), "</a></li>\n";
            }
            echo "</ul>\n\n";
        }

        $functions =& $package->functions();
        if ($functions && is_array($functions)) {
            ksort($functions);
            echo "<h2>Functions</h2>\n";
            echo "<ul>\n";
            foreach ($functions as $name => $function) {
                echo '<li><a href="', str_repeat('../', $package->depth() + 1), $functions[$name]->asPath(), '" target="main">', $functions[$name]->name(), "</a></li>\n";
            }
            echo "</ul>\n\n";
        }

        $globals =& $package->globals();
        if ($globals && is_array($globals)) {
            ksort($globals);
            echo "<h2>Globals</h2>\n";
            echo "<ul>\n";
            foreach ($globals as $name => $global) {
                echo '<li><a href="', str_repeat('../', $package->depth() + 1), $globals[$name]->asPath(), '" target="main">', $globals[$name]->name(), "</a></li>\n";
            }
            echo "</ul>\n\n";
        }

        echo '</body>', "\n\n";

        $output = ob_get_contents();
        ob_end_clean();

        return $output;
    }
271650
public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes
		unknsfEClass.getESuperTypes().add(this.getSF());
		sfGrouperEClass.getESuperTypes().add(this.getSF());

		// Initialize classes and features; add operations and parameters
		initEClass(afpEClass, org.afplib.base.AFP.class, "AFP", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getAFP_StructuredFields(), this.getSF(), null, "structuredFields", null, 0, -1, org.afplib.base.AFP.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(sfEClass, org.afplib.base.SF.class, "SF", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getSF_Number(), ecorePackage.getELong(), "number", null, 0, 1, org.afplib.base.SF.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getSF_Offset(), ecorePackage.getELong(), "offset", null, 0, 1, org.afplib.base.SF.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getSF_Id(), ecorePackage.getEInt(), "id", null, 0, 1, org.afplib.base.SF.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getSF_Length(), ecorePackage.getEInt(), "length", null, 0, 1, org.afplib.base.SF.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getSF_Children(), this.getSF(), null, "children", null, 0, -1, org.afplib.base.SF.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getSF_RawData(), ecorePackage.getEByteArray(), "rawData", null, 0, 1, org.afplib.base.SF.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getSF_Charset(), this.getCharset(), "charset", null, 0, 1, org.afplib.base.SF.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		addEOperation(sfEClass, ecorePackage.getEBoolean(), "isBegin", 0, 1, IS_UNIQUE, IS_ORDERED);

		addEOperation(sfEClass, ecorePackage.getEBoolean(), "isEnd", 0, 1, IS_UNIQUE, IS_ORDERED);

		EOperation op = addEOperation(sfEClass, ecorePackage.getEBoolean(), "isDefault", 0, 1, IS_UNIQUE, IS_ORDERED);
		addEParameter(op, ecorePackage.getEString(), "value", 0, 1, IS_UNIQUE, IS_ORDERED);

		initEClass(unknsfEClass, org.afplib.base.UNKNSF.class, "UNKNSF", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(sfGrouperEClass, SFGrouper.class, "SFGrouper", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(tripletEClass, Triplet.class, "Triplet", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getTriplet_Label(), ecorePackage.getEString(), "label", null, 0, 1, Triplet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getTriplet_Charset(), this.getCharset(), "charset", null, 0, 1, Triplet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getTriplet_FileOffset(), ecorePackage.getELong(), "fileOffset", null, 0, 1, Triplet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getTriplet_TripletLength(), ecorePackage.getEInt(), "tripletLength", null, 0, 1, Triplet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getTriplet_TripletId(), ecorePackage.getEInt(), "tripletId", null, 0, 1, Triplet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getTriplet_TripletNumber(), ecorePackage.getEInt(), "tripletNumber", null, 0, 1, Triplet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		// Initialize data types
		initEDataType(modcaStringEDataType, String.class, "ModcaString", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
		initEDataType(modcaString4EDataType, String.class, "ModcaString4", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
		initEDataType(modcaString8EDataType, String.class, "ModcaString8", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
		initEDataType(modcaString32EDataType, String.class, "ModcaString32", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
		initEDataType(charsetEDataType, Charset.class, "Charset", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);

		// Create resource
		createResource(eNS_URI);

		// Create annotations
		// http:///org/eclipse/emf/ecore/util/ExtendedMetaData
		createExtendedMetaDataAnnotations();
	}
914572
function basePackageJson (opts) {
  opts = opts || {}
  const _name = opts.name || '<name>'
  const _version = opts.version || '1.0.0'
  const _private = opts.private || false

  var called = false

  return from({ objectMode: true }, function (size, next) {
    if (called) return next(null, null)

    const res = { name: _name, version: _version }
    if (_private) res.private = true
    res.scripts = {}
    res.dependencies = {}
    res.devDependencies = {}

    called = true
    next(null, res)
  })
}
863157
static function processElementTransformationList( $tpl, &$node, $elements, &$privateData )
    {
        $useComments = $privateData['use-comments'];
        $php =& $privateData['php-creator'];
        $resourceData =& $privateData['resource-data'];
        $elementTree = $elements;
        $newElements = eZTemplateCompiler::processElementTransformationChild( $useComments, $php, $tpl, $node,
                                                                              $elementTree, $elements, $resourceData );
        if ( $newElements )
            return $newElements;
        return $elements;
    }
1149786
@Nullable
  CompiledTemplate.Factory selectDelTemplate(
      String delTemplateName, String variant, Predicate<String> activeDelPackageSelector) {
    TemplateData selectedTemplate =
        selector.selectTemplate(delTemplateName, variant, activeDelPackageSelector);
    if (selectedTemplate == null) {
      return null;
    }
    if (selectedTemplate.factory == null) {
      throw new IllegalArgumentException(
          "cannot get a factory for the private template: " + selectedTemplate.soyTemplateName());
    }
    return selectedTemplate.factory;
  }
1331753
function(){
		if(initialised)
			return isnode;
		if(package && package.name && package.version)
			console.log("\n" + package.name + " v" + package.version + "\n");

		if(config && config.loader && config.loader.startupModules && config.loader.startupModules.length > 0) {
			for (var i = 0; i < config.loader.startupModules.length; i++) {
				var startMod = "isnode-mod-"+config.loader.startupModules[i];
				loadModule(startMod);
			}
		} else {
			isnode.shutdown();
			return;
		}
		if(!modules.logger || !modules.logger.log){
			if(!modules.logger)
				modules.logger = {};
			modules.logger.log = function(level, message, data){
				var currentDate = new Date();
				currentDate = currentDate.toISOString();
				console.log(currentDate + " (" + level + ") " + message);
			}
			modules.logger.log("warning", "Logger module not loaded. Using stub method.");
		}
		isnode.on("listenForExit", function(){
			var stdin = process.openStdin();
			stdin.setRawMode(true); 
			stdin.setEncoding('utf8');
			stdin.on('data', function(chunk) {
					if(chunk == "e")
						isnode.shutdown();
			});
		});
		var started = false;
		var loadListener = function(){
			isnode.removeListener("loadDependencies", loadListener);
			loadDependencies(); 
			started = true;
		}
		isnode.on("loadDependencies", loadListener); 
		var counter = 0;
		if(config.loader.timeouts.loadDependencies)
			var timeout = config.loader.timeouts.loadDependencies;
		else
			var timeout = 5000;
		var interval = setInterval(function(){
			if(started == true){
				clearInterval(interval);
			}
			if(counter >= timeout) {
				modules.logger.log("startup","ISNode System > Timed out initiating startup. Terminating application server.");
				clearInterval(interval);
				isnode.shutdown();
			}
			counter += 500;
		}, 500);
		initialised = true;
		return isnode;
	}
1328199
function compilePackage(p) {
      compileForType(p);
      p.path = getPackagePath(p);
      p.compiledBody = compact([
        STRICT,
        getRequires(p),
        getDirectRequires(p),
        getAssigns(p),
        p.body,
        getPostAssigns(p),
        getExports(p)
      ]).join('\n\n');
    }
568974
private Map<String, String> readPrivateConfig(final File privateConfigFile) {
    try {
      return readConfig(privateConfigFile);
    } catch (final Exception ex) {
      return new HashMap<>();
    }
  }
1285239
function templateNodeTransformation( $functionName, &$node,
                                         $tpl, &$parameters, $privateData )
    {
        // {while <condition> [sequence <sequence_array> as $<sequence_var>]}

        $tpl->WhileCounter++;
        $newNodes      = array();
        $nodePlacement = eZTemplateNodeTool::extractFunctionNodePlacement( $node );
        $uniqid        =  md5( $nodePlacement[2] ) . "_" . $tpl->WhileCounter;

        $loop = new eZTemplateCompiledLoop( eZTemplateWhileFunction::FUNCTION_NAME,
                                            $newNodes, $parameters, $nodePlacement, $uniqid,
                                            $node, $tpl, $privateData );


        $loop->initVars();

        // loop header
        $newNodes[] = eZTemplateNodeTool::createCodePieceNode( "while ( 1 ) // while\n{" );
        $newNodes[] = eZTemplateNodeTool::createSpacingIncreaseNode();
        $newNodes[] = eZTemplateNodeTool::createVariableNode( false, $parameters['condition'], $nodePlacement, array( 'treat-value-as-non-object' => true ),
                                                              "while_cond" );
        $newNodes[] = eZTemplateNodeTool::createCodePieceNode( "if ( ! \$while_cond ) break;\n" );

        $loop->processBody();

        // loop footer
        $newNodes[] = eZTemplateNodeTool::createSpacingDecreaseNode();
        $newNodes[] = eZTemplateNodeTool::createCodePieceNode( "} // end of while\n" );
        $newNodes[] = eZTemplateNodeTool::createVariableUnsetNode( 'while_cond' );
        $loop->cleanup();

        return $newNodes;
    }
873159
@Override
    public void visitClassContext(ClassContext classContext) {
        try {
            stack = new OpcodeStack();
            toStringRegisters = new HashMap<>();
            packageName = classContext.getJavaClass().getPackageName();
            super.visitClassContext(classContext);
        } finally {
            stack = null;
            toStringRegisters = null;
        }
    }
1072192
public function writeRoutineFunctionWithLob(): void
  {
    $wrapper_args = $this->getWrapperArgs();
    $routine_args = $this->getRoutineArgs();
    $method_name  = $this->nameMangler->getMethodName($this->routine['routine_name']);

    $bindings = '';
    $nulls    = '';
    foreach ($this->routine['parameters'] as $parameter_info)
    {
      $binding = DataTypeHelper::getBindVariableType($parameter_info, $this->lobAsStringFlag);
      if ($binding=='b')
      {
        $bindings .= 'b';
        if ($nulls!=='') $nulls .= ', ';
        $nulls .= '$null';
      }
    }

    $this->codeStore->appendSeparator();
    $this->generatePhpDoc();
    $this->codeStore->append('public static function '.$method_name.'('.$wrapper_args.')');
    $this->codeStore->append('{');
    $this->codeStore->append('$query = \'call '.$this->routine['routine_name'].'('.$routine_args.')\';');
    $this->codeStore->append('$stmt  = self::$mysqli->prepare($query);');
    $this->codeStore->append('if (!$stmt) self::mySqlError(\'mysqli::prepare\');');
    $this->codeStore->append('');
    $this->codeStore->append('$null = null;');
    $this->codeStore->append('$b = $stmt->bind_param(\''.$bindings.'\', '.$nulls.');');
    $this->codeStore->append('if (!$b) self::mySqlError(\'mysqli_stmt::bind_param\');');
    $this->codeStore->append('');
    $this->codeStore->append('self::getMaxAllowedPacket();');
    $this->codeStore->append('');

    $blobArgumentIndex = 0;
    foreach ($this->routine['parameters'] as $parameter_info)
    {
      if (DataTypeHelper::getBindVariableType($parameter_info, $this->lobAsStringFlag)=='b')
      {
        $mangledName = $this->nameMangler->getParameterName($parameter_info['parameter_name']);

        $this->codeStore->append('self::sendLongData($stmt, '.$blobArgumentIndex.', $'.$mangledName.');');

        $blobArgumentIndex++;
      }
    }

    if ($blobArgumentIndex>0)
    {
      $this->codeStore->append('');
    }

    $this->codeStore->append('if (self::$logQueries)');
    $this->codeStore->append('{');
    $this->codeStore->append('$time0 = microtime(true);');
    $this->codeStore->append('');
    $this->codeStore->append('$b = $stmt->execute();');
    $this->codeStore->append('if (!$b) self::mySqlError(\'mysqli_stmt::execute\');');
    $this->codeStore->append('');
    $this->codeStore->append('self::$queryLog[] = [\'query\' => $query,');
    $this->codeStore->append('                     \'time\'  => microtime(true) - $time0];', false);
    $this->codeStore->append('}');
    $this->codeStore->append('else');
    $this->codeStore->append('{');
    $this->codeStore->append('$b = $stmt->execute();');
    $this->codeStore->append('if (!$b) self::mySqlError(\'mysqli_stmt::execute\');');
    $this->codeStore->append('}');
    $this->codeStore->append('');
    $this->writeRoutineFunctionLobFetchData();
    $this->codeStore->append('$stmt->close();');
    $this->codeStore->append('if (self::$mysqli->more_results()) self::$mysqli->next_result();');
    $this->codeStore->append('');
    $this->writeRoutineFunctionLobReturnData();
    $this->codeStore->append('}');
    $this->codeStore->append('');
  }
851310
function commitStep( $package, $http, $step, &$persistentData, $tpl )
    {
        $methodMap = $this->commitStepMethodMap();
        if ( count( $methodMap ) > 0 )
        {
            if ( isset( $methodMap[$step['id']] ) )
            {
                $method = $methodMap[$step['id']];
                return $this->$method( $package, $http, $step, $persistentData, $tpl );
            }
        }
    }
136200
private void addModifier(ProgramElementDoc member, Content code) {
        if (member.isProtected()) {
            code.addContent("protected ");
        } else if (member.isPrivate()) {
            code.addContent("private ");
        } else if (!member.isPublic()) { // Package private
            code.addContent(configuration.getText("doclet.Package_private"));
            code.addContent(" ");
        }
        if (member.isMethod()) {
            if (!(member.containingClass().isInterface()) &&
                    ((MethodDoc)member).isAbstract()) {
                code.addContent("abstract ");
            }
            // This check for isDefault() and the default modifier needs to be
            // added for it to appear on the "Modifier and Type" column in the
            // method summary section. Once the default modifier is added
            // to the Modifier list on DocEnv and once it is updated to use the
            // javax.lang.model.element.Modifier, we will need to remove this.
            if (((MethodDoc)member).isDefault()) {
                code.addContent("default ");
            }
        }
        if (member.isStatic()) {
            code.addContent("static ");
        }
    }
434133
private void addApiDocRoots(String packageListUrl) {
	BufferedReader br = null;
	packageListUrl = fixApiDocRoot(packageListUrl);
	try {
	    URL url = new URL(packageListUrl + "/package-list");
	    br = new BufferedReader(new InputStreamReader(url.openStream()));
	    String line;
	    while((line = br.readLine()) != null) {
		line = line + ".";
		Pattern pattern = Pattern.compile(line.replace(".", "\\.") + "[^\\.]*");
		apiDocMap.put(pattern, packageListUrl);
	    }
	} catch(IOException e) {
	    System.err.println("Errors happened while accessing the package-list file at "
		    + packageListUrl);
	} finally {
	    if(br != null)
		try {
		    br.close();
		} catch (IOException e) {}
	}
	
    }
657823
private void definePackageIfNecessary(String className) {
		int lastDot = className.lastIndexOf('.');
		if (lastDot >= 0) {
			String packageName = className.substring(0, lastDot);
			if (getPackage(packageName) == null) {
				try {
					definePackage(className, packageName);
				}
				catch (IllegalArgumentException ex) {
					// Tolerate race condition due to being parallel capable
					if (getPackage(packageName) == null) {
						// This should never happen as the IllegalArgumentException
						// indicates that the package has already been defined and,
						// therefore, getPackage(name) should not have returned null.
						throw new AssertionError(
								"Package " + packageName + " has already been defined "
										+ "but it could not be found");
					}
				}
			}
		}
	}
1100463
function entrifyFromPkg(dir, options) {

  // Find package.json files.
  const pkgPaths = glob.sync('**/package.json', { cwd: dir, nodir: true, absolute: true })

  pkgPaths.forEach((pkgPath) => {
    console.log('[entrify]', 'Found:', pkgPath)
    const pkg = require(pkgPath)

    // A package.json file should have a main entry.
    if (!pkg.main) {
      console.warn('[entrify]', pkgPath, 'does not have a main entry.')
      return
    }

    // The main entry should not point to an index.js file.
    if (pkg.main === 'index.js' || pkg.main === './index.js') {
      console.warn('[entrify]', pkgPath, 'main entry is index.js.')
      return
    }

    // Ensure the index.js file to create doesn't already exist.
    const pkgDir = path.dirname(pkgPath)
    const indexPath = `${pkgDir}/index.js`

    if (fs.existsSync(indexPath)) {
      console.warn('[entrify]', indexPath, 'already exists.')
      return
    }

    // Create an index.js file alongside the package.json.
    const name = camelize(path.basename(pkgDir))
    const main = pkg.main.startsWith('./') ? pkg.main : `./${pkg.main}`

    fs.writeFileSync(indexPath, indexTemplate(options.format, { name, main }))
    console.log('[entrify]', indexPath, 'created!')

    // Delete the package.json file.
    fs.unlinkSync(pkgPath)
    console.log('[entrify]', pkgPath, 'deleted!')
  })
}