Creates a new instance of {@link CondensedCallStackElement} by copying the specified
{@link CallStackElement}.
967959
public static CondensedCallStackElement of(CallStackElement callStackElement) {
    CondensedCallStackElement condensedCallStackElement =
        new CondensedCallStackElement(callStackElement);

    List<CallStackElement> children = Lists.newArrayList();
    for (CallStackElement child : callStackElement.getChildren()) {
      CondensedCallStackElement condensedChild = of(child);
      children.add(condensedChild);
      condensedChild.setParent(condensedCallStackElement);
    }
    condensedCallStackElement.setChildren(children);

    return condensedCallStackElement;
  }
433303
private static void createSuperForwarder(ClassNode targetNode, MethodNode forwarder, final Map<String,ClassNode> genericsSpec) {
        List<ClassNode> interfaces = new ArrayList<ClassNode>(Traits.collectAllInterfacesReverseOrder(targetNode, new LinkedHashSet<ClassNode>()));
        String name = forwarder.getName();
        Parameter[] forwarderParameters = forwarder.getParameters();
        LinkedHashSet<ClassNode> traits = new LinkedHashSet<ClassNode>();
        List<MethodNode> superForwarders = new LinkedList<MethodNode>();
        for (ClassNode node : interfaces) {
            if (Traits.isTrait(node)) {
                MethodNode method = node.getDeclaredMethod(name, forwarderParameters);
                if (method!=null) {
                    // a similar method exists, we need a super bridge
                    // trait$super$foo(Class currentTrait, ...)
                    traits.add(node);
                    superForwarders.add(method);
                }
            }
        }
        for (MethodNode superForwarder : superForwarders) {
            doCreateSuperForwarder(targetNode, superForwarder, traits.toArray(ClassNode.EMPTY_ARRAY), genericsSpec);
        }
    }
1068778
@SuppressWarnings("unchecked")
    @Override
    public T newInstance() throws DempsyException {
        return wrap(() -> (T) cloneMethod.invoke(prototype));
    }
502214
@ReplacedBy("com.google.common.util.concurrent.Callables#returning()")
    public static <V> Callable<V> asCallable (final V value)
    {
        return new Callable<V>() {
            public V call () {
                return value;
            }
        };
    }
549208
public static Bridge create(final Call call1, final Call call2)
    	    throws Exception {
        assert (call1 != null);
    	final String callId1 = call1.getId();
    	final String callId2 = call2.getId();
    	return Bridge.create(callId1, callId2);
    }
1237426
private static CallSite createPojoSite(CallSite callSite, Object receiver, Object[] args) {
        final Class klazz = receiver.getClass();
        MetaClass metaClass = InvokerHelper.getMetaClass(receiver);
        if (!GroovyCategorySupport.hasCategoryInCurrentThread() && metaClass instanceof MetaClassImpl) {
            final MetaClassImpl mci = (MetaClassImpl) metaClass;
            final ClassInfo info = mci.getTheCachedClass().classInfo;
            if (info.hasPerInstanceMetaClasses()) {
                return new PerInstancePojoMetaClassSite(callSite, info);
            } else {
                return mci.createPojoCallSite(callSite, receiver, args);
            }
        }

        ClassInfo info = ClassInfo.getClassInfo(klazz);
        if (info.hasPerInstanceMetaClasses())
          return new PerInstancePojoMetaClassSite(callSite, info);
        else
          return new PojoMetaClassSite(callSite, metaClass);
    }
186689
public InternalCallContext createInternalCallContext(final UUID objectId, final ObjectType objectType, final String userName,
                                                         final CallOrigin callOrigin, final UserType userType, @Nullable final UUID userToken, final Long tenantRecordId) {
        final Long accountRecordId = getAccountRecordIdSafe(objectId, objectType, tenantRecordId);
        return createInternalCallContext(tenantRecordId, accountRecordId, userName, callOrigin, userType, userToken, null, null, null, null);
    }
1066535
private void buildCallHierarchy() {
                
        final ExecutionNodeUsage rootUsage = new ExecutionNodeUsage(this.rootNode);
        
        callerHierarchy.put(rootUsage, null); // nothing calls this
        
        for (final FeatureNode feature : this.rootNode.getChildren()){
            
            addToCallHierarchy(feature);
            
            for (final ScenarioNode scenario : feature.getChildren()){

                addToCallHierarchy(scenario);

                processChildrenForCallHierarchy(scenario.getChildren());
            }
        }
    }
791466
public static ServiceDependencyBuilder copyOf(final ServiceDependency prototype) {
        return new ServiceDependencyBuilder()
                .withName(prototype.getName())
                .withDescription(prototype.getDescription())
                .withUrl(prototype.getUrl())
                .withType(prototype.getType())
                .withSubtype(prototype.getSubtype())
                .withMethods(prototype.getMethods())
                .withMediaTypes(prototype.getMediaTypes())
                .withAuthentication(prototype.getAuthentication())
                .withCriticality(prototype.getCriticality())
                .withExpectations(prototype.getExpectations());
    }
915874
function create(context) {
    function check(node, method) {
        if (isRequireMemberCall(node.callee, method)) {
            context.report(node, message(method));
        }
    }

    return {
        CallExpression(node) {
            check(node, "toUrl");
            check(node, "nameToUrl");
        }
    };
}
1254228
function makeCallback(entryCaller, entryStack, shadow = false) {
  /**
   * This callback should be called when an asynchronous error occurred.
   * @param {(string|Error)} messageOrError A message string or an _Error_ object at the point of actual error.
   * @returns {Error} An error with the updated stack which includes the callee.
   */
  function cb(messageOrError) {
    const caller = getCallerFromArguments(arguments)
    const { stack: errorStack } = new Error()
    const calleeStackLine = getCalleeStackLine(errorStack)
    const isError = messageOrError instanceof Error
    const message = isError ? messageOrError.message : messageOrError

    const stackHeading = getStackHeading(message)
    const entryHasCallee = caller !== null && entryCaller === caller
    const stackMessage = [
      stackHeading,
      ...(entryHasCallee || shadow ? [entryStack] : [
        calleeStackLine,
        entryStack,
      ]),
    ].join('\n')

    const stack = cleanStack(stackMessage)
    const properties = { message, stack }
    const e = isError ? messageOrError : new Error()

    return /** @type {Error} */ (Object.assign(/** @type {!Object} */ (e), properties))
  }

  return cb
}
188379
private ProxyInvocationHandler createProxyInvocationHandler(final ProxyCreatedCallback<T> callback) {
        if (buildCalled) {
            throw new JoynrIllegalStateException("Proxy builder was already used to build a proxy. Please create a new proxy builder for each proxy.");
        }
        buildCalled = true;

        StatelessAsyncCallback statelessAsyncCallback = null;
        if (statelessAsyncCallbackUseCase != null) {
            statelessAsyncCallback = statelessAsyncCallbackDirectory.get(statelessAsyncCallbackUseCase);
            if (statelessAsyncCallback == null) {
                throw new JoynrIllegalStateException("No stateless async callback found registered for use case "
                        + statelessAsyncCallbackUseCase);
            }
        }

        final ProxyInvocationHandler proxyInvocationHandler = proxyInvocationHandlerFactory.create(domains,
                                                                                                   interfaceName,
                                                                                                   proxyParticipantId,
                                                                                                   discoveryQos,
                                                                                                   messagingQos,
                                                                                                   shutdownNotifier,
                                                                                                   statelessAsyncCallback);

        // This order is necessary because the Arbitrator might return early
        // But if the listener is set after the ProxyInvocationHandler the
        // Arbitrator cannot return early
        arbitrator.setArbitrationListener(new ArbitrationCallback() {
            @Override
            public void onSuccess(ArbitrationResult arbitrationResult) {
                logger.debug("DISCOVERY proxy created for:{}", arbitrationResult.getDiscoveryEntries());
                proxyInvocationHandler.createConnector(arbitrationResult);
                callback.onProxyCreationFinished(proxy);
            }

            @Override
            public void onError(Throwable throwable) {
                JoynrRuntimeException reason;
                if (throwable instanceof JoynrRuntimeException) {
                    reason = (JoynrRuntimeException) throwable;
                } else {
                    reason = new JoynrRuntimeException(throwable);
                }
                proxyInvocationHandler.abort(reason);
                callback.onProxyCreationError(reason);
            }
        });

        return proxyInvocationHandler;
    }
1191064
Node createConstructorCall(@Nullable JSType classType, Node callee, Node... args) {
    Node result = NodeUtil.newCallNode(callee, args);
    if (isAddingTypes()) {
      checkNotNull(classType);
      FunctionType constructorType = checkNotNull(classType.toMaybeFunctionType());
      ObjectType instanceType = checkNotNull(constructorType.getInstanceType());
      result.setJSType(instanceType);
    }
    return result;
  }
770441
public void createConversation(final List<String> members, final String name, final Map<String, Object> attributes,
                                 final boolean isTransient, final AVIMConversationCreatedCallback callback) {
    this.createConversation(members, name, attributes, isTransient, !isTransient, callback);
  }
1162466
protected WebSocketAdapter createWebSocketAdapter(@NonNull final WeakReference<SocketStateListener> stateListenerWeakReference) {

        return new WebSocketAdapter() {

            @Override
            public void onConnected(WebSocket websocket, Map<String, List<String>> headers) throws Exception {
                super.onConnected(websocket, headers);
                final SocketStateListener stateListener = stateListenerWeakReference.get();
                if (stateListener != null) {
                    stateListener.onConnected();
                }
            }

            @Override
            public void onConnectError(WebSocket websocket, WebSocketException exception) throws Exception {
                super.onConnectError(websocket, exception);
                final SocketStateListener stateListener = stateListenerWeakReference.get();
                if (stateListener != null) {
                    stateListener.onError(uri.getRawPath(), proxyAddress, exception);
                }
            }

            @Override
            public void onDisconnected(WebSocket websocket, WebSocketFrame serverCloseFrame, WebSocketFrame clientCloseFrame, boolean closedByServer) throws Exception {
                super.onDisconnected(websocket, serverCloseFrame, clientCloseFrame, closedByServer);
                final SocketStateListener stateListener = stateListenerWeakReference.get();
                if (stateListener != null) {
                    stateListener.onDisconnected();
                }
            }

            @Override
            public void onTextMessage(WebSocket websocket, String text) throws Exception {
                super.onTextMessage(websocket, text);
                log.d("Socket message received = " + text);
                messageListener.onMessage(text);
            }

            @Override
            public void onBinaryMessage(WebSocket websocket, byte[] binary) throws Exception {
                super.onBinaryMessage(websocket, binary);
                log.d("Socket binary message received.");
            }
        };
    }
98555
function create(context) {
    let defineCalls = 0;

    return {
        CallExpression: function (node) {
            if (isDefineCall(node) && ++defineCalls > 1) {
                context.report(node, message);
            }
        }
    };
}
850554
public GV3CompressedFunction<T> build() throws IOException {
			if (built) throw new IllegalStateException("This builder has been already used");
			if (codec == null) codec = new Codec.Huffman();
			built = true;
			if (transform == null) {
				if (chunkedHashStore != null) transform = chunkedHashStore.transform();
				else throw new IllegalArgumentException("You must specify a TransformationStrategy, either explicitly or via a given ChunkedHashStore");
			}
			return new GV3CompressedFunction<>(keys, transform, values, indirect, tempDir, chunkedHashStore, codec);
		}