docs: static void mergeResRefsAndBindings(ComponentNameSpaceConfiguration masterCompNSConfig,
                                          List<ComponentNameSpaceConfiguration> compNSConfigs,
                                          InjectionScope scope) throws InjectionException {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
          if (isTraceOn && tc.isEntryEnabled())
              Tr.entry(tc, "mergeResRefsAndBindings");
  
          Map<String, ResourceRefConfig[]> resRefMap = new LinkedHashMap<String, ResourceRefConfig[]>();
  
          Map<JNDIEnvironmentRefType, Map<String, ComponentNameSpaceConfiguration>> allBindingComps = new EnumMap<JNDIEnvironmentRefType, Map<String, ComponentNameSpaceConfiguration>>(JNDIEnvironmentRefType.class);
          for (JNDIEnvironmentRefType refType : JNDIEnvironmentRefType.VALUES) {
              if (refType.getBindingElementName() != null) {
                  masterCompNSConfig.setJNDIEnvironmentRefBindings(refType.getType(), new HashMap<String, String>());
                  allBindingComps.put(refType, new HashMap<String, ComponentNameSpaceConfiguration>());
              }
          }
  
          Map<String, String> envEntryValues = new HashMap<String, String>();
          Map<String, ComponentNameSpaceConfiguration> envEntryValueComps = new HashMap<String, ComponentNameSpaceConfiguration>();
          masterCompNSConfig.setEnvEntryValues(envEntryValues);
  
          boolean refMergeSuccess = true;
          for (int componentIndex = 0; componentIndex < compNSConfigs.size(); componentIndex++) {
              ComponentNameSpaceConfiguration compNSConfig = compNSConfigs.get(componentIndex);
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, "merging component " + componentIndex + ": " + compNSConfig.getJ2EEName());
  
              // d643480 - Build map of resource reference arrays for merging.
              ResourceRefConfigList resRefs = compNSConfig.getResourceRefConfigList();
              if (resRefs != null) {
                  for (int i = 0, size = resRefs.size(); i < size; i++) {
                      ResourceRefConfig resRef = resRefs.getResourceRefConfig(i);
                      String resRefName = resRef.getName();
  
                      if (scope == null ||
                          scope == InjectionScope.match(resRefName)) {
                          ResourceRefConfig[] resRefArray = resRefMap.get(resRefName);
                          if (resRefArray == null) {
                              resRefArray = new ResourceRefConfig[compNSConfigs.size()];
                              resRefMap.put(resRefName, resRefArray);
                          }
  
                          // Like in previous releases, we won't error if an individual
                          // component has conflicting ResRefs.  ResRefList.findByName
                          // has always returned the first ResRef in the list, so
                          // ignore subsequent ResRefs for this component.
                          if (resRefArray[componentIndex] == null) {
                              resRefArray[componentIndex] = resRef;
                          }
                      }
                  }
              }
  
              for (JNDIEnvironmentRefType refType : JNDIEnvironmentRefType.VALUES) {
                  if (refType.getBindingElementName() != null) {
                      refMergeSuccess &= mergeBindings(compNSConfig, scope,
                                                       refType.getBindingElementName(),
                                                       refType.getBindingAttributeName(),
                                                       compNSConfig.getJNDIEnvironmentRefBindings(refType.getType()),
                                                       masterCompNSConfig.getJNDIEnvironmentRefBindings(refType.getType()),
                                                       allBindingComps.get(refType));
                  }
              }
  
              refMergeSuccess &= mergeBindings(compNSConfig, scope,
                                               "env-entry", "value",
                                               compNSConfig.getEnvEntryValues(),
                                               envEntryValues, envEntryValueComps);
          }
  
          refMergeSuccess &= mergeResRefs(masterCompNSConfig, compNSConfigs, resRefMap); // d643480
  
          if (!refMergeSuccess) {
              throw new InjectionConfigurationException("There were conflicting references.  " +
                                                        "See CWNEN0061E messages in log for details.");
          }
  
          if (isTraceOn && tc.isEntryEnabled())
              Tr.exit(tc, "mergeResRefsAndBindings");
      }