Implementation of abstract method processModelNode
423723
@Override
   void processModelNode(OperationContext context, ModelNode counter,
         CounterConfiguration.Builder builder) throws OperationFailedException {
      super.processModelNode(context, counter, builder);

      ModelNode upperBoundModel = counter.get(ModelKeys.UPPER_BOUND);
      ModelNode lowerBoundModel = counter.get(ModelKeys.LOWER_BOUND);
      if (lowerBoundModel.isDefined()) {
          Long lowerBound = StrongCounterResource.LOWER_BOUND.resolveModelAttribute(context, counter).asLong();
          builder.lowerBound(lowerBound);
      }
      if (upperBoundModel.isDefined()) {
          Long upperBound = StrongCounterResource.UPPER_BOUND.resolveModelAttribute(context, counter).asLong();
          builder.upperBound(upperBound);
      }
   }
395147
private void processRequireCall(NodeTraversal t, Node n, Node parent) {
    Node left = n.getFirstChild();
    Node arg = left.getNext();
    String method = left.getFirstChild().getNext().getString();
    if (verifyLastArgumentIsString(left, arg)) {
      String ns = arg.getString();
      ProvidedName provided = providedNames.get(ns);
      if (provided == null || !provided.isExplicitlyProvided()) {
        unrecognizedRequires.add(new UnrecognizedRequire(n, ns, method.equals("requireType")));
      } else {
        JSModule providedModule = provided.explicitModule;

        if (!provided.isFromExterns()) {
          checkNotNull(providedModule, n);

          JSModule module = t.getModule();
          // A cross-chunk goog.require must match a goog.provide in an earlier chunk. However, a
          // cross-chunk goog.requireType is allowed to match a goog.provide in a later chunk.
          if (module != providedModule
              && !moduleGraph.dependsOn(module, providedModule)
              && !method.equals("requireType")) {
            compiler.report(
                JSError.make(
                    n,
                    ProcessClosurePrimitives.XMODULE_REQUIRE_ERROR,
                    ns,
                    providedModule.getName(),
                    module.getName()));
          }
        }
      }

      maybeAddNameToSymbolTable(left);
      maybeAddStringToSymbolTable(arg);

      // Requires should be removed before further processing.
      // Some clients run closure pass multiple times, first with
      // the checks for broken requires turned off. In these cases, we
      // allow broken requires to be preserved by the first run to
      // let them be caught in the subsequent run.
      if (!preserveGoogProvidesAndRequires && (provided != null || requiresLevel.isOn())) {
        requiresToBeRemoved.add(parent);
      }
    }
  }
1313714
private void processDefineCall(NodeTraversal t, Node n, Node parent) {
    Node left = n.getFirstChild();
    Node args = left.getNext();
    if (verifyDefine(t, parent, left, args)) {
      Node nameNode = args;

      maybeAddNameToSymbolTable(left);
      maybeAddStringToSymbolTable(nameNode);

      this.defineCalls.add(n);
    }
  }
890996
function processNode(attrNode, context) {
    const isMainResource = context.attrPath.length === 0;

    // identify/handle options-contexts: resource/sub-resource, nested-attribute, attribute:
    if (attrNode.dataSources || attrNode.resource || isMainResource) {
        context.errorContext = getErrorContext(isMainResource ? 'resource' : 'sub-resource', context);
        context.subAttrPath = [];
        context.dataSourceAttributes = {};

        if (isMainResource) {
            parseNode(
                attrNode,
                {
                    dataSources: null,
                    subFilters: parseSubFilters,
                    resource: checkResourceName,
                    primaryKey: parsePrimaryKey,
                    depends: parseDepends,
                    deprecated: parseBoolean,
                    permission: null,
                    attributes: null,
                    defaultLimit: parseInteger,
                    maxLimit: parseInteger,
                    defaultOrder: requestParser.order
                },
                context
            );
        } else {
            parseNode(
                attrNode,
                {
                    dataSources: null,
                    subFilters: parseSubFilters,
                    resource: checkResourceName,
                    primaryKey: parsePrimaryKey,
                    parentKey: parseRelationKey,
                    childKey: parseRelationKey,
                    many: parseBoolean,
                    depends: parseDepends,
                    hidden: parseBoolean,
                    deprecated: parseBoolean,
                    permission: null,
                    joinVia: checkIdentifier,
                    attributes: null,
                    defaultLimit: parseInteger,
                    maxLimit: parseInteger,
                    defaultOrder: requestParser.order
                },
                context
            );
        }

        handleResourceContext(attrNode, context);
    } else if (attrNode.attributes) {
        context.errorContext = getErrorContext('nested-attribute', context);

        parseNode(
            attrNode,
            {
                depends: parseDepends,
                hidden: parseBoolean,
                deprecated: parseBoolean,
                permission: null,
                attributes: null
            },
            context
        );

        // no context-specific special-cases for nested-attributes
    } else {
        context.errorContext = getErrorContext('attribute', context);

        // prepare standard-mapping - except for fixed values and inherited attributes:
        if (!attrNode.map && !('value' in attrNode) && attrNode.inherit !== 'inherit') {
            attrNode.map = null; // "null" means "set standard-mapping in parseMap()"
        }

        parseNode(
            attrNode,
            {
                type: parseType,
                multiValued: parseBoolean,
                storedType: parseStoredType,
                delimiter: null,
                map: parseMap,
                filter: parseFilter,
                order: parseOrder,
                value: parseStaticValue,
                depends: parseDepends,
                hidden: parseBoolean,
                deprecated: parseBoolean,
                permission: null,
                inherit: parseInherit
            },
            context
        );

        handleAttributeContext(attrNode, context);
    }

    // recursion:
    if (attrNode.attributes) {
        Object.keys(attrNode.attributes).forEach(subAttrName => {
            const subAttrNode = attrNode.attributes[subAttrName];

            const subContext = Object.assign({}, context);
            subContext.attrPath = context.attrPath.concat([subAttrName]);
            subContext.subAttrPath = context.subAttrPath.concat([subAttrName]);

            processNode(subAttrNode, subContext);
        });
    }

    if (attrNode.dataSources) {
        if (attrNode.primaryKey) resolvePrimaryKey(attrNode, context);
        prepareDataSources(attrNode, context);
    }
}
1360525
function(process) {

      function processField(referencingObject,
                            referencingObjectFieldName,
                            referencingObjectFieldValue,
                            containingSnapshot) {
        if (!referencingObjectFieldValue)
          return;

        if (referencingObjectFieldValue instanceof
            tr.model.ObjectSnapshot)
          return null;
        if (referencingObjectFieldValue.id === undefined)
          return;

        var implicitSnapshot = referencingObjectFieldValue;

        var rawId = implicitSnapshot.id;
        var m = /(.+)\/(.+)/.exec(rawId);
        if (!m)
          throw new Error('Implicit snapshots must have names.');
        delete implicitSnapshot.id;
        var name = m[1];
        var id = m[2];
        var res;

        var cat;
        if (implicitSnapshot.cat !== undefined)
          cat = implicitSnapshot.cat;
        else
          cat = containingSnapshot.objectInstance.category;

        var baseTypename;
        if (implicitSnapshot.base_type)
          baseTypename = implicitSnapshot.base_type;
        else
          baseTypename = undefined;

        try {
          res = process.objects.addSnapshot(
              id, cat,
              name, containingSnapshot.ts,
              implicitSnapshot, baseTypename);
        } catch (e) {
          this.model_.importWarning({
            type: 'object_snapshot_parse_error',
            message: 'While processing implicit snapshot of ' +
                rawId + ' at ts=' + containingSnapshot.ts + ': ' + e
          });
          return;
        }
        res.objectInstance.hasImplicitSnapshots = true;
        res.containingSnapshot = containingSnapshot;
        res.snapshottedOnThread = containingSnapshot.snapshottedOnThread;
        referencingObject[referencingObjectFieldName] = res;
        if (!(res instanceof tr.model.ObjectSnapshot))
          throw new Error('Created object must be instanceof snapshot');
        return res.args;
      }

      /**
       * Iterates over the fields in the object, calling func for every
       * field/value found.
       *
       * @return {object} If the function does not want the field's value to be
       * iterated, return null. If iteration of the field value is desired, then
       * return either undefined (if the field value did not change) or the new
       * field value if it was changed.
       */
      function iterObject(object, func, containingSnapshot, thisArg) {
        if (!(object instanceof Object))
          return;

        if (object instanceof Array) {
          for (var i = 0; i < object.length; i++) {
            var res = func.call(thisArg, object, i, object[i],
                                containingSnapshot);
            if (res === null)
              continue;
            if (res)
              iterObject(res, func, containingSnapshot, thisArg);
            else
              iterObject(object[i], func, containingSnapshot, thisArg);
          }
          return;
        }

        for (var key in object) {
          var res = func.call(thisArg, object, key, object[key],
                              containingSnapshot);
          if (res === null)
            continue;
          if (res)
            iterObject(res, func, containingSnapshot, thisArg);
          else
            iterObject(object[key], func, containingSnapshot, thisArg);
        }
      }

      // TODO(nduca): We may need to iterate the instances in sorted order by
      // creationTs.
      process.objects.iterObjectInstances(function(instance) {
        instance.snapshots.forEach(function(snapshot) {
          if (snapshot.args.id !== undefined)
            throw new Error('args cannot have an id field inside it');
          iterObject(snapshot.args, processField, snapshot, this);
        }, this);
      }, this);
    }
1286697
private void analyzeModels() {
        try {
            do {
                ExecutorService pool = Executors.newFixedThreadPool(context.getSettings().getNbThread());

                while (context.workToDo()) {
                    pool.execute(new ModelExecutor(context));
                }

                pool.shutdown();
                while (!pool.isTerminated()) {
                    pool.awaitTermination(TIMEOUT, TimeUnit.MILLISECONDS);
                }

            } while (context.workToDo());
        } catch (InterruptedException e) {
            throw new RuntimeException("Interrupted " + e.getMessage());
        }
    }
1234454
public void processDI() {

    if (processDefinitions.isEmpty()) {
      return;
    }

    if (!bpmnModel.getLocationMap().isEmpty()) {

      // Verify if all referenced elements exist
      for (String bpmnReference : bpmnModel.getLocationMap().keySet()) {
        if (bpmnModel.getFlowElement(bpmnReference) == null) {
          // ACT-1625: don't warn when artifacts are referenced from DI
          if (bpmnModel.getArtifact(bpmnReference) == null) {
            // Check if it's a Pool or Lane, then DI is ok
            if (bpmnModel.getPool(bpmnReference) == null && bpmnModel.getLane(bpmnReference) == null) {
              LOGGER.warn("Invalid reference in diagram interchange definition: could not find " + bpmnReference);
            }
          }
        } else if (!(bpmnModel.getFlowElement(bpmnReference) instanceof FlowNode)) {
          LOGGER.warn("Invalid reference in diagram interchange definition: " + bpmnReference + " does not reference a flow node");
        }
      }
      
      for (String bpmnReference : bpmnModel.getFlowLocationMap().keySet()) {
        if (bpmnModel.getFlowElement(bpmnReference) == null) {
          // ACT-1625: don't warn when artifacts are referenced from DI
          if (bpmnModel.getArtifact(bpmnReference) == null) {
            LOGGER.warn("Invalid reference in diagram interchange definition: could not find " + bpmnReference);
          }
        } else if (!(bpmnModel.getFlowElement(bpmnReference) instanceof SequenceFlow)) {
          LOGGER.warn("Invalid reference in diagram interchange definition: " + bpmnReference + " does not reference a sequence flow");
        }
      }

      for (Process process : bpmnModel.getProcesses()) {
        if (!process.isExecutable()) {
          continue;
        }

        // Parse diagram interchange information
        ProcessDefinitionEntity processDefinition = getProcessDefinition(process.getId());
        if (processDefinition != null) {
          processDefinition.setGraphicalNotationDefined(true);
          
          for (String edgeId : bpmnModel.getFlowLocationMap().keySet()) {
            if (bpmnModel.getFlowElement(edgeId) != null) {
              createBPMNEdge(edgeId, bpmnModel.getFlowLocationGraphicInfo(edgeId));
            }
          }
        }
      }
    }
  }
602714
static function processNodeCombining( $useComments, $php, $tpl, &$node, &$resourceData, &$newNode )
    {
        $nodeType = $node[0];
        if ( $nodeType == eZTemplate::NODE_ROOT )
        {
            $children = $node[1];
            $newNode[0] = $nodeType;
            $newNode[1] = false;
            if ( $children )
            {
                eZTemplateCompiler::processNodeCombiningChildren( $useComments, $php, $tpl, $children, $resourceData, $newNode );
            }
        }
        else
            $tpl->error( 'processNodeCombining', "Unknown root type $nodeType, should be " . eZTemplate::NODE_ROOT );
    }
857344
public static void addDeclaredMethodsFromInterfaces(ClassNode cNode, Map<String, MethodNode> methodsMap) {
        // add in unimplemented abstract methods from the interfaces
        for (ClassNode iface : cNode.getInterfaces()) {
            Map<String, MethodNode> ifaceMethodsMap = iface.getDeclaredMethodsMap();
            for (Map.Entry<String, MethodNode> entry : ifaceMethodsMap.entrySet()) {
                String methSig = entry.getKey();
                if (!methodsMap.containsKey(methSig)) {
                    methodsMap.put(methSig, entry.getValue());
                }
            }
        }
    }
128521
public void execute() throws CFGBuilderException {
        JavaClass jclass = classContext.getJavaClass();
        Method[] methods = jclass.getMethods();

        LOG.debug("Class has {} methods", methods.length);

        // Add call graph nodes for all methods
        for (Method method : methods) {
            callGraph.addNode(method);
        }
        LOG.debug("Added {} nodes to graph", callGraph.getNumVertices());

        // Scan methods for self calls
        for (Method method : methods) {
            MethodGen mg = classContext.getMethodGen(method);
            if (mg == null) {
                continue;
            }

            scan(callGraph.getNodeForMethod(method));
        }

        LOG.debug("Found {} self calls", callGraph.getNumEdges());
    }
1073575
@Override
	public boolean process(Set<? extends TypeElement> elements,
			RoundEnvironment environment) {
		Messager messager = processingEnv.getMessager();
		
		for (TypeElement element : elements) {
			Set<? extends Element> elementsAnnotatedWith = environment.getElementsAnnotatedWith(element);
			
			for (Element elementAnnotatedWith : elementsAnnotatedWith) {
				TypeElement typeElement = (TypeElement) elementAnnotatedWith;
				EntityValidator validator = new EntityValidator(processingEnv.getTypeUtils());
				List<Problem> problems = validator.validate(typeElement);
				
//				for (Problem problem : problems) {
//					System.out.println(problem);
//				}
				
				boolean error = false;
				
				for (Problem problem : problems) {
					if (problem.kind() == Kind.ERROR) {
						error = true;
					}
					
					messager.printMessage(problem.kind(), problem.message(), problem.element());
				}
				
				if (!error) {
					MetamodelSource source = new MetamodelSource(typeElement, processingEnv);
					
					try {
						source.save();
					} catch (Exception e) {
						messager.printMessage(Kind.ERROR, "Metamodel ["
								+ source.toMetamodelName(typeElement.getQualifiedName().toString())
								+ "] cannot be saved due to [" + e + "]",
								typeElement);
						e.printStackTrace();
					}
				}
			}
		}
		
		return true;
	}
445337
private ModelNode resolveExpressionsRecursively(final ModelNode node) throws OperationFailedException {
        if (!node.isDefined()) {
            return node;
        }

        ModelType type = node.getType();
        ModelNode resolved;
        if (type == ModelType.EXPRESSION) {
            resolved = resolveExpressionStringRecursively(node.asExpression().getExpressionString(), lenient, true);
        } else if (type == ModelType.OBJECT) {
            resolved = node.clone();
            for (Property prop : resolved.asPropertyList()) {
                resolved.get(prop.getName()).set(resolveExpressionsRecursively(prop.getValue()));
            }
        } else if (type == ModelType.LIST) {
            resolved = node.clone();
            ModelNode list = new ModelNode();
            list.setEmptyList();
            for (ModelNode current : resolved.asList()) {
                list.add(resolveExpressionsRecursively(current));
            }
            resolved = list;
        } else if (type == ModelType.PROPERTY) {
            resolved = node.clone();
            resolved.set(resolved.asProperty().getName(), resolveExpressionsRecursively(resolved.asProperty().getValue()));
        } else {
            resolved = node;
        }

        return resolved;
    }
448451
function processClass (options, name, node) {
    processClassConstructor(options, name, node);
    processClassAppend(options, name, node);

    shuffleArray(options, node.children);

    for (let i = 0, max = node.children.length; i < max; i++) {
        let child = node.children[i];

        processClass(options, child, hierarchy[child]);
    }
}
208827
@Override
    protected final void performRuntime(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException {
        throw new UnsupportedOperationException();
    }
980554
void processAMDModules(Iterable<CompilerInput> inputs) {
    for (CompilerInput input : inputs) {
      input.setCompiler(this);
      Node root = checkNotNull(input.getAstRoot(this));
      new TransformAMDToCJSModule(this).process(null, root);
    }
  }
635755
private void processWatcher(MethodSpec.Builder createdMethodBuilder, ExecutableElement method) {
    Watch watch = method.getAnnotation(Watch.class);

    String exposedMethodName = exposeExistingJavaMethodToJs(method);
    String watcherTriggerMethodName = addNewMethodToProto();

    MethodSpec.Builder watcherMethodBuilder = MethodSpec
        .methodBuilder(watcherTriggerMethodName)
        .addModifiers(Modifier.PUBLIC)
        .addAnnotation(JsMethod.class)
        .returns(Object.class);

    String[] valueSplit = watch.value().split("\\.");

    String currentExpression = "";
    for (int i = 0; i < valueSplit.length - 1; i++) {
      currentExpression += valueSplit[i];
      watcherMethodBuilder.addStatement("if ($L == null) return null", currentExpression);
      currentExpression += ".";
    }

    watcherMethodBuilder.addStatement("return $L", watch.value());

    componentExposedTypeBuilder.addMethod(watcherMethodBuilder.build());

    createdMethodBuilder
        .addStatement("vue().$L(p.$L, p.$L, $T.of($L, $L))", "$watch",
            watcherTriggerMethodName, exposedMethodName, WatchOptions.class, watch.isDeep(),
            watch.isImmediate());
  }
88764
private void processModel(final Model readModel) {
        this.model = readModel;
        
        Parent parent = readModel.getParent();

        if (this.groupId == null) {
            this.groupId = readModel.getGroupId();
            if (this.groupId == null && parent != null) {
                this.groupId = parent.getGroupId();
            }
        }
        if (this.artifactId == null) {
            this.artifactId = readModel.getArtifactId();
        }
        if (this.version == null) {
            this.version = readModel.getVersion();
            if (this.version == null && parent != null) {
                this.version = parent.getVersion();
            }
        }
        if (this.packaging == null) {
            this.packaging = readModel.getPackaging();
        }
    }