docs: public void merge(EJBRef ejbRef)
                      throws InjectionException
      {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
          if (isTraceOn && tc.isEntryEnabled())
              Tr.entry(tc, "merge : " + ejbRef);
  
          EJBImpl curAnnotation = (EJBImpl) this.getAnnotation();
          String jndiName = ejbRef.getName();
          String curJndiName = curAnnotation.name();
          int beanType = ejbRef.getTypeValue();
          int curBeanType = this.ivBeanType;
          String homeInterfaceName = ejbRef.getHome();
          String beanInterfaceName = ejbRef.getInterface();
          String beanName = ejbRef.getLink();
          String curBeanName = ivBeanName; // 649980
          String lookup = ejbRef.getLookupName(); // F743-21028.4
          if (lookup != null) {
              lookup = lookup.trim();
          }
          String mappedName = (ejbRef.getMappedName() == null) ? "" : ejbRef.getMappedName();
          String curMappedName = curAnnotation.mappedName();
          int kind = ejbRef.getKindValue();
          boolean ejbLocalRef = kind == EJBRef.KIND_LOCAL;
  
          if (isTraceOn && tc.isDebugEnabled())
              Tr.debug(tc, "new=" + jndiName + ":" + beanType + ":" + homeInterfaceName + "/" + beanInterfaceName + ":" + beanName + ":" + mappedName + ":" + lookup);
  
          if (isTraceOn && tc.isDebugEnabled())
              Tr.debug(tc, "cur=" + curJndiName + ":" + curBeanType + ":" + getInjectionClassTypeName() + "," + ivHomeInterface + ":" + curBeanName + ":" + curMappedName + ":"
                           + ivLookup);
  
          // If there are 2 EJB Refs, but one is local, and the other remote,
          // then this is an incompatibility... and thus an error.           d479669
          if ((ivEjbRef && ejbLocalRef) ||
              (ivEjbLocalRef && kind == EJBRef.KIND_REMOTE))
          {
              Tr.error(tc, "CONFLICTING_XML_TYPES_CWNEN0051E", new Object[]
              { ivNameSpaceConfig.getDisplayName(),
               ivNameSpaceConfig.getModuleName(),
               ivNameSpaceConfig.getApplicationName(),
               "ejb-ref-name",
               jndiName,
               "ejb-ref",
               "ejb-local-ref" });
              String exMsg = "The " + ivNameSpaceConfig.getDisplayName() +
                             " bean in the " + ivNameSpaceConfig.getModuleName() +
                             " module of the " + ivNameSpaceConfig.getApplicationName() +
                             " application has conflicting configuration data in the XML" +
                             " deployment descriptor. Conflicting element types exist with the same " +
                             "ejb-ref-name" + " element value : " + jndiName +
                             ". The conflicting element types are " + "ejb-ref" + " and " +
                             "ejb-local-ref" + ".";
              throw new InjectionConfigurationException(exMsg);
          }
  
          //The type parameter is "optional"
          if (beanType != EJBRef.TYPE_UNSPECIFIED &&
              curBeanType != EJBRef.TYPE_UNSPECIFIED)
          {
              // check that value from xml is a subclasss, if not throw an error
              if (beanType != curBeanType)
              {
                  String elementType = ejbLocalRef ? "ejb-local-ref" : "ejb-ref";
                  String curBeanTypeName = curBeanType == EJBRef.TYPE_SESSION ? "Session" : "Entity";
                  String beanTypeName = beanType == EJBRef.TYPE_SESSION ? "Session" : "Entity";
                  Tr.error(tc, "CONFLICTING_XML_VALUES_CWNEN0052E", new Object[]
                  { ivNameSpaceConfig.getDisplayName(),
                   ivNameSpaceConfig.getModuleName(),
                   ivNameSpaceConfig.getApplicationName(),
                   "ejb-ref-type",
                   elementType,
                   "ejb-ref-name",
                   jndiName,
                   curBeanTypeName,
                   beanTypeName }); // d479669
                  String exMsg = "The " + ivNameSpaceConfig.getDisplayName() +
                                 " bean in the " + ivNameSpaceConfig.getModuleName() +
                                 " module of the " + ivNameSpaceConfig.getApplicationName() +
                                 " application has conflicting configuration data in the XML" +
                                 " deployment descriptor. Conflicting " + "ejb-ref-type" +
                                 " element values exist for multiple " + elementType +
                                 " elements with the same " + "ejb-ref-name" + " element value : " +
                                 jndiName + ". The conflicting " + "ejb-ref-type" +
                                 " element values are " + curBeanTypeName + " and " +
                                 beanTypeName + ".";
                  throw new InjectionConfigurationException(exMsg);
              }
          }
          else if (beanType != EJBRef.TYPE_UNSPECIFIED &&
                   curBeanType == EJBRef.TYPE_UNSPECIFIED)
          {
              this.ivBeanType = beanType;
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, "ivBeanType = " + this.ivBeanType);
          }
  
          //The homeInterface parameter is "optional"
          if (homeInterfaceName != null && homeInterfaceName.length() != 0) // d668376
          {
              if (ivClassLoader == null) // F743-32443
              {
                  setInjectionClassTypeName(homeInterfaceName);
                  ivHomeInterface = true;
              }
              else
              {
                  Class<?> homeInterface = loadClass(homeInterfaceName, false);
                  if (ivHomeInterface)
                  {
                      Class<?> curHomeInterface = getInjectionClassType();
                      Class<?> mostSpecific = mostSpecificClass(homeInterface, curHomeInterface);
                      if (mostSpecific == null)
                      {
                          String elementType = ejbLocalRef ? "ejb-local-ref" : "ejb-ref";
                          String elementAttr = ejbLocalRef ? "local-home" : "home";
                          Tr.error(tc, "CONFLICTING_XML_VALUES_CWNEN0052E", new Object[]
                          { ivNameSpaceConfig.getDisplayName(),
                           ivNameSpaceConfig.getModuleName(),
                           ivNameSpaceConfig.getApplicationName(),
                           elementAttr,
                           elementType,
                           "ejb-ref-name",
                           jndiName,
                           curHomeInterface.getName(),
                           homeInterface.getName() }); // d479669
                          String exMsg = "The " + ivNameSpaceConfig.getDisplayName() +
                                         " bean in the " + ivNameSpaceConfig.getModuleName() +
                                         " module of the " + ivNameSpaceConfig.getApplicationName() +
                                         " application has conflicting configuration data in the XML" +
                                         " deployment descriptor. Conflicting " + elementAttr +
                                         " element values exist for multiple " + elementType +
                                         " elements with the same " + "ejb-ref-name" + " element value : " +
                                         jndiName + ". The conflicting " + elementAttr +
                                         " element values are " + curHomeInterface.getName() + " and " +
                                         homeInterface.getName() + ".";
                          throw new InjectionConfigurationException(exMsg);
                      }
  
                      setInjectionClassType(mostSpecific);
                      if (isTraceOn && tc.isDebugEnabled())
                          Tr.debug(tc, "ivHomeInterface = " + this.ivHomeInterface);
                  }
                  else
                  {
                      setInjectionClassType(homeInterface);
                      ivHomeInterface = true;
                      if (isTraceOn && tc.isDebugEnabled())
                          Tr.debug(tc, "ivHomeInterface = " + this.ivHomeInterface);
                  }
              }
          }
          //The beanInterface parameter is "optional"
          else if (beanInterfaceName != null && beanInterfaceName.length() != 0) // d668376
          {
              ivBeanInterface = true;
              if (ivClassLoader == null) // F743-32443
              {
                  setInjectionClassTypeName(beanInterfaceName);
              }
              else if (!ivHomeInterface)
              {
                  Class<?> beanInterface = loadClass(beanInterfaceName, false);
                  Class<?> curBeanInterface = getInjectionClassType();
                  Class<?> mostSpecific = mostSpecificClass(beanInterface, curBeanInterface);
                  if (mostSpecific == null)
                  {
                      String elementType = ejbLocalRef ? "ejb-local-ref" : "ejb-ref";
                      String elementAttr = ejbLocalRef ? "local" : "remote";
                      Tr.error(tc, "CONFLICTING_XML_VALUES_CWNEN0052E", new Object[]
                      { ivNameSpaceConfig.getDisplayName(),
                       ivNameSpaceConfig.getModuleName(),
                       ivNameSpaceConfig.getApplicationName(),
                       elementAttr,
                       elementType,
                       "ejb-ref-name",
                       jndiName,
                       curBeanInterface.getName(),
                       beanInterface.getName() }); // d479669
                      String exMsg = "The " + ivNameSpaceConfig.getDisplayName() +
                                     " bean in the " + ivNameSpaceConfig.getModuleName() +
                                     " module of the " + ivNameSpaceConfig.getApplicationName() +
                                     " application has conflicting configuration data in the XML" +
                                     " deployment descriptor. Conflicting " + elementAttr +
                                     " element values exist for multiple " + elementType +
                                     " elements with the same " + "ejb-ref-name" + " element value : " +
                                     jndiName + ". The conflicting " + elementAttr +
                                     " element values are " + curBeanInterface.getName() + " and " +
                                     beanInterface.getName() + ".";
                      throw new InjectionConfigurationException(exMsg);
                  }
  
                  setInjectionClassType(beanInterface);
                  if (isTraceOn && tc.isDebugEnabled())
                      Tr.debug(tc, "ivBeanInterface = " + beanInterface);
              }
          }
  
          //The mappedName parameter is "optional"
          if (curAnnotation.ivIsSetMappedName && mappedName != null)
          {
              if (!curMappedName.equals(mappedName))
              {
                  String elementType = ejbLocalRef ? "ejb-local-ref" : "ejb-ref";
                  Tr.error(tc, "CONFLICTING_XML_VALUES_CWNEN0052E", new Object[]
                  { ivNameSpaceConfig.getDisplayName(),
                   ivNameSpaceConfig.getModuleName(),
                   ivNameSpaceConfig.getApplicationName(),
                   "mapped-name",
                   elementType,
                   "ejb-ref-name",
                   jndiName,
                   curMappedName,
                   mappedName }); // d479669
                  String exMsg = "The " + ivNameSpaceConfig.getDisplayName() +
                                 " bean in the " + ivNameSpaceConfig.getModuleName() +
                                 " module of the " + ivNameSpaceConfig.getApplicationName() +
                                 " application has conflicting configuration data in the XML" +
                                 " deployment descriptor. Conflicting " + "mapped-name" +
                                 " element values exist for multiple " + elementType +
                                 " elements with the same " + "ejb-ref-name" + " element value : " +
                                 jndiName + ". The conflicting " + "mapped-name" +
                                 " element values are " + curMappedName + " and " +
                                 mappedName + ".";
                  throw new InjectionConfigurationException(exMsg);
              }
          }
          else if (mappedName != null && !curAnnotation.ivIsSetMappedName)
          {
              curAnnotation.ivMappedName = mappedName;
              curAnnotation.ivIsSetMappedName = true;
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, "ivMappedName = " + mappedName);
          }
  
          //The beanName parameter is "optional"
          if (beanName != null && curAnnotation.ivIsSetBeanName)
          {
              if (!curBeanName.equals(beanName))
              {
                  String elementType = ejbLocalRef ? "ejb-local-ref" : "ejb-ref";
                  Tr.error(tc, "CONFLICTING_XML_VALUES_CWNEN0052E", new Object[]
                  { ivNameSpaceConfig.getDisplayName(),
                   ivNameSpaceConfig.getModuleName(),
                   ivNameSpaceConfig.getApplicationName(),
                   "ejb-link",
                   elementType,
                   "ejb-ref-name",
                   jndiName,
                   curBeanName,
                   beanName }); // d479669
                  String exMsg = "The " + ivNameSpaceConfig.getDisplayName() +
                                 " bean in the " + ivNameSpaceConfig.getModuleName() +
                                 " module of the " + ivNameSpaceConfig.getApplicationName() +
                                 " application has conflicting configuration data in the XML" +
                                 " deployment descriptor. Conflicting " + "ejb-link" +
                                 " element values exist for multiple " + elementType +
                                 " elements with the same " + "ejb-ref-name" + " element value : " +
                                 jndiName + ". The conflicting " + "ejb-link" +
                                 " element values are " + curBeanName + " and " +
                                 beanName + ".";
                  throw new InjectionConfigurationException(exMsg);
              }
          }
          else if (beanName != null && curBeanName == null)
          {
              curAnnotation.ivBeanName = beanName;
              curAnnotation.ivIsSetBeanName = true;
              ivBeanName = beanName;
              ivBeanNameOrLookupInXml = true; // F743-21028.4
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, "ivBeanName = " + this.ivBeanName);
          }
  
          // -----------------------------------------------------------------------
          // Merge : lookup - "optional parameter                       F743-21028.4
          //
          // If present in XML, even if the empty string (""), it will override
          // any setting via annotations. An empty string would effectively turn
          // off this setting, so auto-link would be used instead.
          //
          // When an ejb-ref appears multiple times in XML, an empty string is
          // considered to be a conflict with a non-empty string, since both
          // were explicitly specified.
          // -----------------------------------------------------------------------
          if (lookup != null)
          {
              if (ivLookup != null)
              {
                  if (!lookup.equals(ivLookup))
                  {
                      String component = ivNameSpaceConfig.getDisplayName();
                      String elementType = ejbLocalRef ? "ejb-local-ref" : "ejb-ref";
                      Tr.error(tc, "CONFLICTING_XML_VALUES_CWNEN0052E", new Object[]
                      { component,
                       ivModule,
                       ivApplication,
                       "lookup-name",
                       elementType,
                       "ejb-ref-name",
                       jndiName,
                       ivLookup,
                       lookup });
                      String exMsg = "The " + component + " bean in the " +
                                     ivModule + " module of the " + ivApplication +
                                     " application has conflicting configuration data in the XML" +
                                     " deployment descriptor. Conflicting " + "lookup-name" +
                                     " element values exist for multiple " + elementType +
                                     " elements with the same " + "ejb-ref-name" +
                                     " element value : " + jndiName + ". The conflicting " +
                                     "lookup-name" + " element values are \"" + ivLookup +
                                     "\" and \"" + lookup + "\".";
                      throw new InjectionConfigurationException(exMsg);
                  }
              }
              else
              {
                  ivLookup = lookup;
                  ivBeanNameOrLookupInXml = true;
                  curAnnotation.ivLookup = lookup;
                  if (isTraceOn && tc.isDebugEnabled())
                      Tr.debug(tc, "ivLookup = " + ivLookup);
              }
          }
  
          // It is an error to specify both 'ejb-link' and 'lookup-name'. F743-21028.4
          if (ivBeanName != null && ivLookup != null)
          {
              // Error - conflicting ejb-link/lookup-name values
              String component = ivNameSpaceConfig.getDisplayName();
              String elementType = ejbLocalRef ? "ejb-local-ref" : "ejb-ref";
              Tr.error(tc, "CONFLICTING_XML_VALUES_CWNEN0052E",
                       new Object[] { component,
                                     ivModule,
                                     ivApplication,
                                     "ejb-link/lookup-name",
                                     elementType,
                                     "ejb-ref-name",
                                     getJndiName(),
                                     ivBeanName,
                                     ivLookup });
              String exMsg = "The " + component + " bean in the " + ivModule +
                             " module of the " + ivApplication + " application" +
                             " has conflicting configuration data in the XML" +
                             " deployment descriptor. Conflicting " +
                             "ejb-link/lookup-name" + " element values exist for" +
                             " multiple " + elementType + " elements with the same " +
                             "ejb-ref-name" + " element value : " + getJndiName() +
                             ". The conflicting " + "ejb-link/lookup-name" +
                             " element values are \"" + ivBeanName + "\" and \"" +
                             ivLookup + "\".";
              throw new InjectionConfigurationException(exMsg);
          }
  
          //Loop through the InjectionTargets and call addInjectionTarget.... which
          //already accounts for duplicates (in case they duplicated some between the two ref definitions.
          List<InjectionTarget> targets = ejbRef.getInjectionTargets();
  
          if (!targets.isEmpty())
          {
              for (InjectionTarget target : targets)
              {
                  Class<?> injectionType = this.getInjectionClassType();
                  String injectionName = target.getInjectionTargetName();
                  String injectionClassName = target.getInjectionTargetClassName();
                  this.addInjectionTarget(injectionType, // d446474
                                          injectionName,
                                          injectionClassName);
              }
          }
  
          if (isTraceOn && tc.isEntryEnabled())
              Tr.exit(tc, "merge", this);
      }