Allows to set cumulated stat to decorator bean.

@param decoratorBean {@link StatDecoratorBean}
@param allStatLines  list of {@link StatLineAO}, all stats present in producer
483944
private void populateCumulatedStats(final StatDecoratorBean decoratorBean, final List<StatLineAO> allStatLines) {
		if (allStatLines == null || allStatLines.isEmpty()) {
			LOGGER.warn("Producer's stats are empty");
			return;
		}

		final int cumulatedIndex = getCumulatedIndex(allStatLines);
		if (cumulatedIndex == -1)
			return;

		final StatLineAO cumulatedStatLineAO = allStatLines.get(cumulatedIndex);

		final StatBean cumulatedStat = new StatBean();
		cumulatedStat.setName(cumulatedStatLineAO.getStatName());
		cumulatedStat.setValues(cumulatedStatLineAO.getValues());

		decoratorBean.setCumulatedStat(cumulatedStat);
	}
377700
@SafeVarargs
    public final U setDecorators(
            Function<Service<HttpRequest, HttpResponse>,
                    ? extends Service<HttpRequest, HttpResponse>>... decorators) {
        return setDecorators(ImmutableList.copyOf(requireNonNull(decorators, "decorators")));
    }
194182
public void afterPropertiesSet() {

		ApplicationContext context = this.context;

		if (context == null) {
			throw new IllegalStateException("ApplicationContext not set!");
		}

		Class<?> type = this.type;

		if (type == null) {
			throw new IllegalStateException("No type configured!");
		}

		this.targetSource = new BeansOfTypeTargetSource(context, type, false, exclusions);
	}
826696
@Override
	public <T extends Query> T setStatsOptions(StatsOptions statsOptions) {
		return query.setStatsOptions(statsOptions);
	}
552974
protected void logVarstat(DoubleStatistic varstat, double[] varsum) {
    if(varstat != null) {
      double s = sum(varsum);
      getLogger().statistics(varstat.setDouble(s));
    }
  }
114395
@Override
    public void visitGETSTATIC(GETSTATIC obj) {
        if (getNumWordsProduced(obj) != 1) {
            super.visitGETSTATIC(obj);
            return;
        }

        if (checkForKnownValue(obj)) {
            return;
        }
        XField field = XFactory.createXField(obj, cpg);
        if (field.isFinal()) {
            Item summary = AnalysisContext.currentAnalysisContext().getFieldSummary().getSummary(field);
            if (summary.isNull()) {
                produce(IsNullValue.nullValue());
                return;
            }
        }
        if ("java.util.logging.Level".equals(field.getClassName()) && "SEVERE".equals(field.getName())
                || "org.apache.log4j.Level".equals(field.getClassName())
                && ("ERROR".equals(field.getName()) || "FATAL".equals(field.getName()))) {
            getFrame().toExceptionValues();
        }

        if (field.getName().startsWith("class$")) {
            produce(IsNullValue.nonNullValue());
            return;
        }
        NullnessAnnotation annotation = AnalysisContext.currentAnalysisContext().getNullnessAnnotationDatabase()
                .getResolvedAnnotation(field, false);
        if (annotation == NullnessAnnotation.NONNULL) {
            modelNormalInstruction(obj, getNumWordsConsumed(obj), 0);
            produce(IsNullValue.nonNullValue());
        } else if (annotation == NullnessAnnotation.CHECK_FOR_NULL) {
            modelNormalInstruction(obj, getNumWordsConsumed(obj), 0);
            produce(IsNullValue.nullOnSimplePathValue().markInformationAsComingFromFieldValue(field));
        } else {

            super.visitGETSTATIC(obj);
        }
    }
809639
public void setArguments(Method method) {

		Parameter[] parameters = method.getParameters();
		Class<?>[] parameterTypes = method.getParameterTypes();
		Annotation[][] annotations = method.getParameterAnnotations();

		async = isAsync(method.getReturnType());
		returnType = method.getReturnType();

		int index = 0;
		Map<String, MethodParameter> arguments = new HashMap<>();

		for (Annotation[] ann : annotations) {

			String name = null;
			ParameterType type = null;
			String defaultValue = null;
			boolean raw = false;
			Class<? extends ValueReader> valueReader = null;
			Class<? extends ContextProvider> contextValueProvider = null;

			for (Annotation annotation : ann) {

				if (annotation instanceof PathParam) {
					// find path param ... and set index ...
					name = ((PathParam) annotation).value();
					type = ParameterType.path;
				}

				if (annotation instanceof QueryParam) {
					// add param
					name = ((QueryParam) annotation).value();
					type = ParameterType.query;
				}

				if (annotation instanceof Raw) {
					raw = true;
				}

				if (annotation instanceof FormParam) {
					type = ParameterType.form;
					name = ((FormParam) annotation).value();
				}

				if (annotation instanceof CookieParam) {
					type = ParameterType.cookie;
					name = ((CookieParam) annotation).value();
				}

				if (annotation instanceof HeaderParam) {
					type = ParameterType.header;
					name = ((HeaderParam) annotation).value();
				}

				if (annotation instanceof MatrixParam) {
					type = ParameterType.matrix;
					name = ((MatrixParam) annotation).value();
				}

				if (annotation instanceof DefaultValue) {
					defaultValue = ((DefaultValue) annotation).value();
				}

				if (annotation instanceof RequestReader) {
					valueReader = ((RequestReader) annotation).value();
				}

				if (annotation instanceof ContextReader) {
					contextValueProvider = ((ContextReader) annotation).value();
				}

				if (annotation instanceof Context) {
					type = ParameterType.context;
					name = parameters[index].getName();
				}
			}

			// if no name provided than parameter is considered unknown (it might be request body, but we don't know)
			if (name == null) {

				// try to find out what parameter type it is ... POST, PUT have a body ...
				// regEx path might not have a name ...
				MethodParameter param = findParameter(index);
				if (param != null) {

					Assert.isNull(param.getDataType(), "Duplicate argument type given: " + parameters[index].getName());
					param.argument(parameterTypes[index], index); // set missing argument type and index
				} else {

					if (valueReader == null) {
						valueReader = reader; // take reader from method / class definition
					} else {
						reader = valueReader; // set body reader from field
					}

					name = parameters[index].getName();
					type = ParameterType.unknown;
				}
			}

			// collect only needed params for this method
			if (name != null) {

				// set context provider from method annotation if fitting
				if (contextValueProvider == null && contextProvider != null) {
					Type generic = ClassFactory.getGenericType(contextProvider);
				    if (ClassFactory.checkIfCompatibleTypes(parameterTypes[index], generic)) {
					    contextValueProvider = contextProvider;
				    }
				}

				MethodParameter parameter = provideArgument(name, type, defaultValue, raw, parameterTypes[index], valueReader, contextValueProvider, index);
				arguments.put(name, parameter);
			}

			index++;
		}

		setUsedArguments(arguments);
	}
1001589
public SearchResult withStats(java.util.Map<String, FieldStats> stats) {
        setStats(stats);
        return this;
    }
518549
public void setConfigurationRecordersStatus(java.util.Collection<ConfigurationRecorderStatus> configurationRecordersStatus) {
        if (configurationRecordersStatus == null) {
            this.configurationRecordersStatus = null;
            return;
        }

        this.configurationRecordersStatus = new com.amazonaws.internal.SdkInternalList<ConfigurationRecorderStatus>(configurationRecordersStatus);
    }
903008
public void setTableStatistics(java.util.Collection<TableStatistics> tableStatistics) {
        if (tableStatistics == null) {
            this.tableStatistics = null;
            return;
        }

        this.tableStatistics = new java.util.ArrayList<TableStatistics>(tableStatistics);
    }
1329238
@Override
  public final synchronized void set(final Class<?> pBeanClass,
    final IFactorySimple<?> pBean) throws Exception {
    this.factoriesMap.put(pBeanClass, pBean);
  }
905073
void annotation( AnnotatedDescrBuilder<?> adb ) {
        AnnotationDescrBuilder<?> annotation = null;

        try {
            if (speculateFullAnnotation()) {
                boolean buildState = exprParser.isBuildDescr();
                exprParser.setBuildDescr(true);
                exprParser.fullAnnotation(adb);
                exprParser.setBuildDescr(buildState);
            } else {

                // '@'
                Token at = match(input,
                        DRL6Lexer.AT,
                        null,
                        null,
                        DroolsEditorType.SYMBOL);
                if (state.failed)
                    return;

                // identifier
                String fqn = qualifiedIdentifier();
                if (state.failed)
                    return;

                if (state.backtracking == 0) {
                    annotation = adb.newAnnotation(fqn);
                    helper.setStart(annotation,
                            at);
                }

                try {
                    if (input.LA(1) == DRL6Lexer.LEFT_PAREN) {
                        String value = chunk(DRL6Lexer.LEFT_PAREN,
                                DRL6Lexer.RIGHT_PAREN,
                                -1).trim();
                        if (state.failed)
                            return;
                        if (state.backtracking == 0) {
                            annotation.value(value);
                        }
                    }
                } finally {
                    if (state.backtracking == 0) {
                        helper.setEnd(annotation);
                    }
                }
            }

        } catch (RecognitionException re) {
            reportError(re);
        }
    }
1259352
private void populateGraphData(final IDecorator decorator, final Map<String, GraphDataBean> graphData, final List<StatLineAO> allStatLines) {
		final int cumulatedIndex = getCumulatedIndex(allStatLines);

		for (int i = 0; i < allStatLines.size(); i++) {
			if (i == cumulatedIndex)
				continue;

			//TODO fix filterzero.
//			if (!filterZero || !s.isEmpty(intervalName)){

			final StatLineAO line = allStatLines.get(i);
			final List<StatValueAO> statValues = line.getValues();

			for (StatValueAO statValue : statValues) {
				final String graphKey = decorator.getName() + '_' + statValue.getName();
				final GraphDataValueBean value = new GraphDataValueBean(line.getStatName(), statValue.getRawValue());

				final GraphDataBean graphDataBean = graphData.get(graphKey);
				if (graphDataBean != null)
					graphDataBean.addValue(value);
			}
		}
	}
936715
@Override
    public <T> T onlyOne(Class<T> serviceClass) {
        Collection<T> all = all(serviceClass);
        if (all.size() == 1) {
            return all.iterator().next();
        }
        if (all.size() > 1) {
            throw new IllegalStateException(
                "Multiple service implementations found for " + serviceClass + ": " + toClassString(all));
        }
        return null;
    }
774709
private void _register(ObjectName userProvidedMBeanObjectName, boolean bCreateDefaultMBean) throws StatsFactoryException {
        MBeanStatDescriptor msd = StatsFactoryUtil.createMBean(this, _cInstanceName, userProvidedMBeanObjectName, bCreateDefaultMBean);
        if (msd == null) {
            _bHasMBean = false;
        } else {
            _bHasMBean = true;
        }

        StatsFactoryUtil.registerModule(this, msd);
        //Register ModuletoBundle Mapping
        String corrospondingClazz = super.statisticActionLsnr.getClass().getName();
        ProbeManagerImpl.moduleInstanceToBundleMap.put(this, corrospondingClazz);
    }
184762
public static Number calStats(String statsString,
            LongSummaryStatistics summaryStatistics) {
        return StatsField.valueOfAlias(statsString).calStats(summaryStatistics);
    }
876247
public void setRemediationExecutionStatuses(java.util.Collection<RemediationExecutionStatus> remediationExecutionStatuses) {
        if (remediationExecutionStatuses == null) {
            this.remediationExecutionStatuses = null;
            return;
        }

        this.remediationExecutionStatuses = new com.amazonaws.internal.SdkInternalList<RemediationExecutionStatus>(remediationExecutionStatuses);
    }