This will fail if there are duplicate beans in the Spring context. Beans
that are configured in the bootstrap context will not be considered
duplicate beans.
929
public void assertUniqueBeans(Set<String> ignoredDuplicateBeanNames) {
		for (BeanohBeanFactoryMethodInterceptor callback : callbacks) {
			Map<String, List<BeanDefinition>> beanDefinitionMap = callback
					.getBeanDefinitionMap();
			for (String key : beanDefinitionMap.keySet()) {
				if (!ignoredDuplicateBeanNames.contains(key)) {
					List<BeanDefinition> definitions = beanDefinitionMap
							.get(key);
					List<String> resourceDescriptions = new ArrayList<String>();
					for (BeanDefinition definition : definitions) {
						String resourceDescription = definition
								.getResourceDescription();
						if (resourceDescription == null) {
							resourceDescriptions.add(definition.getBeanClassName());
						}else if (!resourceDescription
								.endsWith("-BeanohContext.xml]")) {
							if(!resourceDescriptions.contains(resourceDescription)){
								resourceDescriptions.add(resourceDescription);
							}
						}
					}
					if (resourceDescriptions.size() > 1) {
						throw new DuplicateBeanDefinitionException("Bean '"
								+ key + "' was defined "
								+ resourceDescriptions.size() + " times.\n"
								+ "Either remove duplicate bean definitions or ignore them with the 'ignoredDuplicateBeanNames' method.\n"
								+ "Configuration locations:"
								+ messageUtil.list(resourceDescriptions));
					}
				}
			}
		}
	}
209531
public void dup() {
        ClassNode type = getTopOperand();
        stack.add(type);
        MethodVisitor mv = controller.getMethodVisitor();
        if (type == ClassHelper.double_TYPE || type == ClassHelper.long_TYPE) {
            mv.visitInsn(DUP2);
        } else {
            mv.visitInsn(DUP);
        }
    }
883316
private static boolean shouldHasUniqueValues(List<Field> dataFields) {
        Set<String> dataValues = new HashSet<>();
        for (Field field : dataFields) {
            String value = field.getAnnotation(Plugin.Data.class).value();
            if (dataValues.contains(value)) {
                return false;
            }
            dataValues.add(value);
        }
        return true;
    }
513312
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
    public static boolean hasInputMethodsFeature(Context context) {
        return hasInputMethodsFeature(context.getPackageManager());
    }
1352030
protected void beanDefinitionCheck() {
        for (int i = 0; i < beanDefinitions.size(); i++) {
            for (int j = i + 1; j < beanDefinitions.size(); j++) {
                BeanDefinition b1 = beanDefinitions.get(i);
                BeanDefinition b2 = beanDefinitions.get(j);

                // Two components' id are equal
                if (VerifyUtils.isNotEmpty(b1.getId())
                        && VerifyUtils.isNotEmpty(b2.getId())
                        && b1.getId().equals(b2.getId())) {
                    error("Duplicated bean ID of " + b1.getClassName() + " and " + b2.getClassName());
                }

                if (b1.getClassName().equals(b2.getClassName())) {
                    // Two components' class name are equal, but one of them does not set id.
                    if (VerifyUtils.isEmpty(b1.getId()) || VerifyUtils.isEmpty(b2.getId())) {
                        error("Duplicated class definition. Please set a ID for " + b1.getClassName());
                    } else {
                        // Their id are different, save them to memo.
                        // When the component is injecting by type, throw an exception.
                        errorMemo.add(b1.getClassName());
                    }
                }

                for (String iname1 : b1.getInterfaceNames()) {
                    for (String iname2 : b2.getInterfaceNames()) {
                        if (iname1.equals(iname2)) {
                            // Two components' interface name are equal, but one of them does not set id.
                            if (VerifyUtils.isEmpty(b1.getId()) || VerifyUtils.isEmpty(b2.getId())) {
                                error("Duplicated class definition. Please set a ID for " + b1.getClassName());
                            } else {
                                // Their id are different, save them to memo.
                                // When the component is injecting by type, throw an exception.
                                errorMemo.add(iname1);
                            }
                        }
                    }
                }

            }
        }
    }
1023160
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    if (pvalue == null) {
      return true;
    }
    try {
      final Object field1Value = BeanPropertyReaderUtil.getNullSaveProperty(pvalue, field1Name);
      final Object field2Value = BeanPropertyReaderUtil.getNullSaveProperty(pvalue, field2Name);
      if (!smaller(field1Value, field2Value)) {
        switchContext(pcontext);
        return false;
      }
      return true;
    } catch (final Exception ignore) {
      switchContext(pcontext);
      return false;
    }
  }
1330725
function () {
            this.$DropDownTextInput._checkCfgConsistency.call(this);
            var opt = this._cfg.options;
            var values = [];
            var dupValues = [];
            var map = {};

            for (var count = 0; count < opt.length; count++) {
                if (map[opt[count].value]) {
                    dupValues.push(opt[count].value);
                } else {
                    map[opt[count].value] = true;
                    values.push(opt[count]);
                }
            }
            if (dupValues.length > 0) {
                this.controller.setListOptions(values);
                this.$logError(this.DUPLICATE_VALUE, [dupValues]);
            }

        }
867172
private void createStartupBeans() throws RuntimeWarning {
        boolean isTraceOn = TraceComponent.isAnyTracingEnabled();

        // d684950
        if (EJSPlatformHelper.isZOSCRA()) {
            if (isTraceOn && tc.isDebugEnabled())
                Tr.debug(tc, "createStartupBeans: skipped in adjunct process");
            return;
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "createStartupBeans");

        for (int i = 0, size = ivStartupSingletonList.size(); i < size; i++) {
            J2EEName startupName = ivStartupSingletonList.get(i);

            try { // F743-1753CodRev
                EJSHome home = (EJSHome) EJSContainer.homeOfHomes.getHome(startupName);

                if (home == null) {
                    // The home won't exist if singleton beans aren't enabled
                    // in the runtime.
                    if (isTraceOn && tc.isDebugEnabled())
                        Tr.debug(tc, "Ignoring Singleton Startup bean: " + startupName);
                } else {
                    if (isTraceOn && tc.isDebugEnabled())
                        Tr.debug(tc, "Creating instance for Singleton Startup bean: " + startupName.toString());

                    home.createSingletonBeanO();
                }
            } catch (Throwable t) {
                // A failure has occurred processing the Startup Singletons.
                // Post an FFDC, log the failure, and throw a RuntimWarning to
                // cause this application start to abort.
                FFDCFilter.processException(t, CLASS_NAME + ".createStartupBeans", "6921", this);

                Tr.error(tc, "STARTUP_SINGLETON_SESSION_BEAN_INITIALIZATION_FAILED_CNTR0190E", new Object[] { startupName.getComponent(),
                        startupName.getModule(), t });
                throw new RuntimeWarning("CNTR0201E: The " + startupName.getComponent() + " startup singleton session bean in the "
                        + startupName.getModule() + " module failed initialization.", t);
            }
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "createStartupBeans");
    }
278175
public void processClassBeanAttributes() {
        preInitializeBeans(getEnvironment().getClassBeans());
        preInitializeBeans(getEnvironment().getDecorators());
        preInitializeBeans(getEnvironment().getInterceptors());

        processBeans(getEnvironment().getClassBeans());
        processBeans(getEnvironment().getDecorators());
        processBeans(getEnvironment().getInterceptors());

        // now that we know that the bean won't be vetoed, it's the right time to register @New injection points
        searchForNewBeanDeclarations(getEnvironment().getClassBeans());
        searchForNewBeanDeclarations(getEnvironment().getDecorators());
        searchForNewBeanDeclarations(getEnvironment().getInterceptors());
    }
591911
@Override
    public HttpResponseMessage duplicate() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Duplicating the response message: " + this);
        }

        HttpResponseMessageImpl msg = null;
        HttpObjectFactory factory = getObjectFactory();
        if (null == factory) {
            msg = new HttpResponseMessageImpl();
        } else {
            msg = factory.getResponse();
        }
        msg.setIncoming(isIncoming());
        // set the response specifics
        msg.setStatusCode(this.myStatusCode);
        msg.setReasonPhrase(this.myReasonBytes);

        // set the common object values
        super.duplicate(msg);
        return msg;
    }
856782
@SuppressWarnings("unchecked")
    private void bindUniqueSubConfigurations() {
        for (ConfigPath item : tree.getUniqueTypePaths()) {
            // bind only with annotation to avoid clashes with direct bindings
            toValue(
                    bind(Key.get(item.getDeclaredTypeWithGenerics(), Config.class)),
                    item.getValue());
        }
    }
1322167
public static TreeSet<Integer> validateDuplicatedColumnNumber(final Class<?> beanType, final List<ColumnMapping> list) {
        
        final TreeSet<Integer> checkedNumber = new TreeSet<>();
        final TreeSet<Integer> duplicatedNumbers = new TreeSet<>();
        for(ColumnMapping columnMapping : list) {
            
            if(checkedNumber.contains(columnMapping.getNumber())) {
                duplicatedNumbers.add(columnMapping.getNumber());
            }
            checkedNumber.add(columnMapping.getNumber());
            
        }
        
        if(!duplicatedNumbers.isEmpty()) {
            // 重複している 属性 numberが存在する場合
            throw new SuperCsvInvalidAnnotationException(MessageBuilder.create("anno.attr.duplicated")
                    .var("property", beanType.getName())
                    .varWithAnno("anno", CsvColumn.class)
                    .var("attrName", "number")
                    .var("attrValues", duplicatedNumbers)
                    .format());
        }
        
        // カラム番号が1以上かチェックする
        final int minColumnNumber = checkedNumber.first();
        if(minColumnNumber <= 0) {
            throw new SuperCsvInvalidAnnotationException(MessageBuilder.create("anno.attr.min")
                    .var("property", beanType.getName())
                    .varWithAnno("anno", CsvColumn.class)
                    .var("attrName", "number")
                    .var("attrValue", minColumnNumber)
                    .var("min", 1)
                    .format());
            
        }
        
        return checkedNumber;
    }
835446
@Override
    @SuppressWarnings("unchecked")
    public <T> T get(Contextual<T> contextual) {
        Bean bean = (Bean) contextual;
        // you can store the bean somewhere
        if (somewhere.containsKey(bean.getName())) {
            return (T) somewhere.get(bean.getName());
        } else {
            return null;
        }
    }
280574
@Override
    public void create(Collection<Bean> beans) throws AbortRuntimeException {
        init();
        Set<HBeanRow> beanRows = new HashSet<>();
        Map<HBeanRow, HBeanRow> refRows = new HashMap<>();
        Map<BeanId, Bean> beansMap = BeanUtils.uniqueIndex(beans);
        try {
            for (Bean bean : beans) {
                beanRows.add(new HBeanRow(bean, uids));
                for (BeanId ref : bean.getReferences()) {
                    Bean refBean = beansMap.get(ref);
                    HBeanRow row;
                    if (refBean == null) {
                        row = new HBeanRow(ref, uids);
                    } else {
                        row = new HBeanRow(refBean, uids);
                    }
                    refRows.put(row, row);
                }
            }
            table.getLazy(beanRows);
            throw Events.CFG303_BEAN_ALREADY_EXIST(beans.iterator().next().getId());
        } catch (HBeanNotFoundException e) {
            // ensure beans to be create does not exist
        }

        // ensure references exist either in memory or storage
        try {
            refRows = table.getLazyAsMap(refRows);
        } catch (HBeanNotFoundException e) {
            // only throw exception if the bean was not provided
            // as an argument to the create method.
            if (!idsFoundIn(beans, e)) {
                throw Events.CFG301_MISSING_RUNTIME_REF(e.getNotFound().iterator().next());
            }
            // make sure that references found in storage override the refRows
            for (HBeanRow row : e.getFound().keySet()) {
                refRows.put(row, row);
            }

        }
        // select the rows to update predecessors
        for (HBeanRow beanRow : beanRows) {
            for (HBeanRow refRow : beanRow.getReferenceRows()) {
                refRow = refRows.get(refRow);
                refRow.addPredecessor(beanRow);
            }
        }

        table.put(beanRows);
        table.put(Sets.newHashSet(refRows.values()));
    }
1182061
protected Bean<?> getUniqueBeanByBeanName(BeanManager bm, String batchId) {
        Bean<?> match = null;

        // Get all beans with the given EL name (id).  EL names are applied via @Named.
        // If the bean is not annotated with @Named, then it does not have an EL name
        // and therefore can't be looked up that way.  
        Set<Bean<?>> beans = bm.getBeans(batchId);

        try {
            match = bm.resolve(beans);
        } catch (AmbiguousResolutionException e) {
            return null;
        }
        return match;
    }
720709
function (data, merge) {
            this.json.inject(data, this._data, merge);
            if (this._dataBeanName) {
                if (!ariaCoreJsonValidator.normalize({
                    json : this._data,
                    beanName : this._dataBeanName
                })) {
                    this.$logError(this.DATA_CONTENT_INVALID, [this._dataBeanName, this.$classpath]);
                }
            }
        }
311797
private function checkDuplicates(iterable $adapterFactories): void
    {
        $dupes = [];
        foreach ($adapterFactories as $adapter) {
            $type = strtolower($adapter->getType());
            if (array_key_exists($type, $dupes)) {
                throw new DuplicateFilesystemFactoryException($type);
            }

            $dupes[$type] = 1;
        }
    }