docs: @Override
      public void merge(Resource annotation, Class<?> instanceClass, Member member) throws InjectionException
      {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
          if (isTraceOn && tc.isEntryEnabled())
              Tr.entry(tc, "merge : " + ivMergeCompleted);
  
          //  XML / Annotation merge rules from EJB 3.0 Core Contracts Spec section 16.2.3:
          //
          //  The following rules apply to how a deployment descriptor entry may override a Resource annotation:
          //
          //  - The relevant deployment descriptor entry is located based on the JNDI name used with the
          //    annotation (either defaulted or provided explicitly).
          //
          //  - The type specified in the deployment descriptor must be assignable to the type of the field or
          //    property or the type specified in the Resource annotation.
          //
          //  - The description, if specified, overrides the description element of the annotation.
          //
          //  - The injection target, if specified, must name exactly the annotated field or property method.
          //
          //  - The res-sharing-scope element, if specified, overrides the shareable element of the
          //    annotation. In general, the Application Assembler or Deployer should never change the value
          //    of this element, as doing so is likely to break the application.
          //
          //  - The res-auth element, if specified, overrides the authenticationType element of the
          //     annotation. In general, the Application Assembler or Deployer should
  
          // Load the XML metadata settings (ie. set during ctor time)
          Resource currentAnnotation = this.getAnnotation();
  
          // If this object was constructed with metadata from xml, then we are being asked to
          // merge xml and annotations, following the EJB spec rules for xml overrides of annotations.
          // However, if one merge has already been completed, we simply need to check the new annotation
          // metadata passed in to assure it matches the previous merge result.
          if ((currentAnnotation instanceof ResourceImpl) && (!ivMergeCompleted) && !isComplete())
          {
              // If Type was set from XML, and it is either the same class or a subclass of the annotation type field, then
              // it overrides the annotation.  If the types mismatch between xml and an annotation throw an error. Otherwise,
              // if there was no data from XML just use the class from the annotation.
              if (((ResourceImpl) currentAnnotation).ivIsSetType)
              {
                  // check that value from xml is a subclasss, if not throw an error
                  if (InjectionBinding.isClassesCompatible(annotation.type(), currentAnnotation.type())) {
                      // do nothing - xml data overrides the annotation
                  }
                  else
                  {
                      // Error - conflicting annotation type classes detected
                      Tr.error(tc, "CONFLICTING_XML_ANNOTATION_VALUES_CWNEN0053E",
                               ivComponent,
                               ivModule,
                               ivApplication,
                               ivXMLType.type_element(),
                               "type",
                               ivXMLType,
                               "@Resource",
                               ivXMLType.name_element(),
                               "name",
                               getJndiName(),
                               currentAnnotation.type().getName(),
                               annotation.type().getName()); // d479669
                      String exMsg = "The " + ivComponent + " bean in the " +
                                     ivModule + " module of the " + ivApplication +
                                     " application has conflicting configuration data between" +
                                     " the XML deployment descriptor and source code annotations." +
                                     " Conflicting " + ivXMLType.type_element() + " element values or " +
                                     "type" + " attribute values exist for multiple " + ivXMLType +
                                     " elements or " + "@Resource" + " annotations with the same " +
                                     ivXMLType.name_element() + " element value or " + "name" +
                                     " attribute value : " + getJndiName() + ". The conflicting " +
                                     ivXMLType.type_element() + " element values or " + "type" +
                                     " attribute values are " + currentAnnotation.type().getName() +
                                     " and " + annotation.type().getName() + "."; // d479669
                      throw new InjectionConfigurationException(exMsg);
                  }
              }
              else
              {
                  // replace current type value, using the annotation data
                  ((ResourceImpl) currentAnnotation).ivType = annotation.type();
                  setInjectionClassType(annotation.type()); // d729308
              }
  
              // If Authentication value was set from XML then it overrides the  annotation.  Otherwise, use value from annotation.
              if (((ResourceImpl) currentAnnotation).ivIsSetAuthenticationType)
              {
                  // do nothing - XML overrides the annotation
              }
              else
              {
                  ((ResourceImpl) currentAnnotation).ivAuthenticationType = annotation.authenticationType();
              }
  
              // If shareable value was set from XML then it overrides the annotation.   Otherwise, use value from annotation.
              if (((ResourceImpl) currentAnnotation).ivIsSetShareable)
              {
                  // do nothing - XML overrides the annotation
              }
              else
              {
                  ((ResourceImpl) currentAnnotation).ivShareable = annotation.shareable();
              }
  
              // If Mapped Name value was set from XML then it overrides the annotation.  Otherwise, use value from annotation.
              if (((ResourceImpl) currentAnnotation).ivIsSetMappedName)
              {
                  // do nothing - XML overrides the annotation
              }
              else
              {
                  ((ResourceImpl) currentAnnotation).ivMappedName = annotation.mappedName();
              }
  
              // If Description value was set from XML then it overrides the annotation.  Otherwise, use value from annotation.
              if (((ResourceImpl) currentAnnotation).ivIsSetDescription)
              {
                  // do nothing - XML overrides the annotation
              }
              else
              {
                  ((ResourceImpl) currentAnnotation).ivDescription = annotation.description();
              }
  
              ivMergeCompleted = true;
          }
          else
          {
              // Otherwise, we need to validate that that two metdata sources have the exact same metadata.
              // We may have one source that is from a previous merge with xml (ie. currentAnnotation is a ResourceImpl object),
              // and the other source is from an annotation (ie. annotation is a simple Resource object).   Or, we may have a
              // case where both the currentAnnotation and annotation objects are from annotations (ie. neither was xml).   In either
              // case if the metadata does not match we log and throw a configuration error.
  
              if (currentAnnotation instanceof ResourceImpl)
              {
                  // Here we are checking a previous merge result (ie. one source was xml) against metadata from another annotation.
                  // Therefore, we only need to check for matches on fields where the xml has not already overridden the annotation value.
                  if ((!((ResourceImpl) currentAnnotation).ivIsSetType) &&
                      (!(currentAnnotation.type().equals(annotation.type()))))
                  {
                      // Error - conflicting resource type specified
                      Tr.error(tc, "CONFLICTING_XML_ANNOTATION_VALUES_CWNEN0053E",
                               ivComponent,
                               ivModule,
                               ivApplication,
                               ivXMLType.type_element(),
                               "type",
                               ivXMLType,
                               "@Resource",
                               ivXMLType.name_element(),
                               "name",
                               getJndiName(),
                               currentAnnotation.type().getName(),
                               annotation.type().getName()); // d479669
                      String exMsg = "The " + ivComponent + " bean in the " +
                                     ivModule + " module of the " + ivApplication +
                                     " application has conflicting configuration data between" +
                                     " the XML deployment descriptor and source code annotations." +
                                     " Conflicting " + ivXMLType.type_element() + " element values or " +
                                     "type" + " attribute values exist for multiple " + ivXMLType +
                                     " elements or " + "@Resource" + " annotations with the same " +
                                     ivXMLType.name_element() + " element value or " + "name" +
                                     " attribute value : " + getJndiName() + ". The conflicting " +
                                     ivXMLType.type_element() + " element values or " + "type" +
                                     " attribute values are " + currentAnnotation.type().getName() +
                                     " and " + annotation.type().getName() + "."; // d479669
                      throw new InjectionConfigurationException(exMsg);
                  }
  
                  if ((!((ResourceImpl) currentAnnotation).ivIsSetAuthenticationType) &&
                      (!(currentAnnotation.authenticationType().equals(annotation.authenticationType()))))
                  {
                      // Error - conflicting Authentication Type specified
                      Tr.error(tc, "CONFLICTING_XML_ANNOTATION_VALUES_CWNEN0053E",
                               ivComponent,
                               ivModule,
                               ivApplication,
                               "res-auth",
                               "authenticationType",
                               ivXMLType,
                               "@Resource",
                               ivXMLType.name_element(),
                               "name",
                               getJndiName(),
                               currentAnnotation.authenticationType(),
                               annotation.authenticationType()); // d479669
                      String exMsg = "The " + ivComponent + " bean in the " +
                                     ivModule + " module of the " + ivApplication +
                                     " application has conflicting configuration data between" +
                                     " the XML deployment descriptor and source code annotations." +
                                     " Conflicting " + "res-auth" + " element values or " +
                                     "authenticationType" + " attribute values exist for multiple " +
                                     ivXMLType + " elements or " + "@Resource" +
                                     " annotations with the same " + ivXMLType.name_element() +
                                     " element value or " + "name" + " attribute value : " +
                                     getJndiName() + ". The conflicting " + "res-auth" +
                                     " element values or " + "authenticationType" +
                                     " attribute values are " + currentAnnotation.authenticationType() +
                                     " and " + annotation.authenticationType() + "."; // d479669
                      throw new InjectionConfigurationException(exMsg);
                  }
  
                  if ((!((ResourceImpl) currentAnnotation).ivIsSetShareable) &&
                      (currentAnnotation.shareable() != annotation.shareable()))
                  {
                      // Error - conflicting shareable resource specified
                      Tr.error(tc, "CONFLICTING_XML_ANNOTATION_VALUES_CWNEN0053E",
                               ivComponent,
                               ivModule,
                               ivApplication,
                               "res-sharing-scope",
                               "shareable",
                               ivXMLType,
                               "@Resource",
                               ivXMLType.name_element(),
                               "name",
                               getJndiName(),
                               currentAnnotation.shareable(),
                               annotation.shareable()); // d479669
                      String exMsg = "The " + ivComponent + " bean in the " +
                                     ivModule + " module of the " + ivApplication +
                                     " application has conflicting configuration data between" +
                                     " the XML deployment descriptor and source code annotations." +
                                     " Conflicting " + "res-sharing-scope" + " element values or " +
                                     "shareable" + " attribute values exist for multiple " +
                                     ivXMLType + " elements or " + "@Resource" +
                                     " annotations with the same " + ivXMLType.name_element() +
                                     " element value or " + "name" + " attribute value : " +
                                     getJndiName() + ". The conflicting " + "res-sharing-scope" +
                                     " element values or " + "shareable" +
                                     " attribute values are " + currentAnnotation.shareable() +
                                     " and " + annotation.shareable() + "."; // d479669
                      throw new InjectionConfigurationException(exMsg);
                  }
  
                  if ((!((ResourceImpl) currentAnnotation).ivIsSetMappedName) &&
                      (!(currentAnnotation.mappedName().equals(annotation.mappedName()))))
                  {
                      // Error - conflicting mapped name specified
                      Tr.error(tc, "CONFLICTING_XML_ANNOTATION_VALUES_CWNEN0053E",
                               ivComponent,
                               ivModule,
                               ivApplication,
                               "mapped-name",
                               "mappedName",
                               ivXMLType,
                               "@Resource",
                               ivXMLType.name_element(),
                               "name",
                               getJndiName(),
                               currentAnnotation.mappedName(),
                               annotation.mappedName()); // d479669
                      String exMsg = "The " + ivComponent + " bean in the " +
                                     ivModule + " module of the " + ivApplication +
                                     " application has conflicting configuration data between" +
                                     " the XML deployment descriptor and source code annotations." +
                                     " Conflicting " + "mapped-name" + " element values or " +
                                     "mappedName" + " attribute values exist for multiple " +
                                     ivXMLType + " elements or " + "@Resource" +
                                     " annotations with the same " + ivXMLType.name_element() +
                                     " element value or " + "name" + " attribute value : " +
                                     getJndiName() + ". The conflicting " + "mapped-name" +
                                     " element values or " + "mappedName" +
                                     " attribute values are " + currentAnnotation.mappedName() +
                                     " and " + annotation.mappedName() + "."; // d479669
                      throw new InjectionConfigurationException(exMsg);
                  }
              }
              else
              {
                  // In this case both metadata sources are from annotations and there was not a previous merge of xml with an annotation.
                  // Therefore, we simply need to compare the two annotation sources to make sure they do not conflict.
                  if (!(currentAnnotation.type().equals(annotation.type())))
                  {
                      // Error - conflicting resource type specified
                      Tr.error(tc, "CONFLICTING_ANNOTATION_VALUES_CWNEN0054E",
                               ivComponent,
                               ivModule,
                               ivApplication,
                               "type",
                               "@Resource",
                               "name",
                               getJndiName(),
                               currentAnnotation.type().getName(),
                               annotation.type().getName()); // d479669
                      String exMsg = "The " + ivComponent + " bean in the " +
                                     ivModule + " module of the " + ivApplication +
                                     " application has conflicting configuration data" +
                                     " in source code annotations. Conflicting " +
                                     "type" + " attribute values exist for multiple " +
                                     "@Resource" + " annotations with the same " +
                                     "name" + " attribute value : " + getJndiName() +
                                     ". The conflicting " + "type" +
                                     " attribute values are " + currentAnnotation.type().getName() +
                                     " and " + annotation.type().getName() + "."; // d479669
                      throw new InjectionConfigurationException(exMsg);
                  }
  
                  if (!(currentAnnotation.authenticationType().equals(annotation.authenticationType())))
                  {
                      // Error - conflicting authentication type specified
                      Tr.error(tc, "CONFLICTING_ANNOTATION_VALUES_CWNEN0054E",
                               ivComponent,
                               ivModule,
                               ivApplication,
                               "authenticationType",
                               "@Resource",
                               "name",
                               getJndiName(),
                               currentAnnotation.authenticationType(),
                               annotation.authenticationType()); // d479669
                      String exMsg = "The " + ivComponent + " bean in the " +
                                     ivModule + " module of the " + ivApplication +
                                     " application has conflicting configuration data" +
                                     " in source code annotations. Conflicting " +
                                     "authenticationType" + " attribute values exist for multiple " +
                                     "@Resource" + " annotations with the same " +
                                     "name" + " attribute value : " + getJndiName() +
                                     ". The conflicting " + "authenticationType" +
                                     " attribute values are " + currentAnnotation.authenticationType() +
                                     " and " + annotation.authenticationType() + "."; // d479669
                      throw new InjectionConfigurationException(exMsg);
                  }
  
                  if (currentAnnotation.shareable() != annotation.shareable())
                  {
                      // Error - conflicting shareable resource specified
                      Tr.error(tc, "CONFLICTING_ANNOTATION_VALUES_CWNEN0054E",
                               ivComponent,
                               ivModule,
                               ivApplication,
                               "shareable",
                               "@Resource",
                               "name",
                               getJndiName(),
                               currentAnnotation.shareable(),
                               annotation.shareable()); // d479669
                      String exMsg = "The " + ivComponent + " bean in the " +
                                     ivModule + " module of the " + ivApplication +
                                     " application has conflicting configuration data" +
                                     " in source code annotations. Conflicting " +
                                     "shareable" + " attribute values exist for multiple " +
                                     "@Resource" + " annotations with the same " +
                                     "name" + " attribute value : " + getJndiName() +
                                     ". The conflicting " + "shareable" +
                                     " attribute values are " + currentAnnotation.shareable() +
                                     " and " + annotation.shareable() + "."; // d479669
                      throw new InjectionConfigurationException(exMsg);
                  }
  
                  if (!(currentAnnotation.mappedName().equals(annotation.mappedName())))
                  {
                      // Error - conflicting mapped name specified
                      Tr.error(tc, "CONFLICTING_ANNOTATION_VALUES_CWNEN0054E",
                               ivComponent,
                               ivModule,
                               ivApplication,
                               "mappedName",
                               "@Resource",
                               "name",
                               getJndiName(),
                               currentAnnotation.mappedName(),
                               annotation.mappedName()); // d479669
                      String exMsg = "The " + ivComponent + " bean in the " +
                                     ivModule + " module of the " + ivApplication +
                                     " application has conflicting configuration data" +
                                     " in source code annotations. Conflicting " +
                                     "mappedName" + " attribute values exist for multiple " +
                                     "@Resource" + " annotations with the same " +
                                     "name" + " attribute value : " + getJndiName() +
                                     ". The conflicting " + "mappedName" +
                                     " attribute values are " + currentAnnotation.mappedName() +
                                     " and " + annotation.mappedName() + "."; // d479669
                      throw new InjectionConfigurationException(exMsg);
                  }
              }
          }
  
          // If "lookup" has not been defined in XML, then use the value from
          // annotations.  However, if there are multiple annotations with the
          // same name, then the values must match.                     F743-21028.4
          // However, ignore lookup from the annotation if an env-entry-value
          // has been specified in XML.                                 F743-22218.3
          if (!ivLookupInXml && ivEnvValue == null)
          {
              String lookup = getResourceLookup(annotation); // F743-16274.1
  
              // An empty string is the default and not considered a specified value.
              if (lookup != null && !(lookup.equals("")))
              {
                  if (!isComplete() && (ivLookup == null || ivLookup.equals("")))
                  {
                      ivLookup = lookup;
                  }
                  else
                  {
                      if (!(lookup.equals(ivLookup)))
                      {
                          // Error - conflicting lookup values between annotations
                          Tr.error(tc, "CONFLICTING_ANNOTATION_VALUES_CWNEN0054E",
                                   ivComponent,
                                   ivModule,
                                   ivApplication,
                                   "lookup",
                                   "@Resource",
                                   "name",
                                   getJndiName(),
                                   ivLookup,
                                   lookup);
                          String exMsg = "The " + ivComponent + " bean in the " +
                                         ivModule + " module of the " + ivApplication +
                                         " application has conflicting configuration data" +
                                         " in source code annotations. Conflicting " +
                                         "lookup" + " attribute values exist for multiple " +
                                         "@Resource" + " annotations with the same " +
                                         "name" + " attribute value : " + getJndiName() +
                                         ". The conflicting " + "lookup" +
                                         " attribute values are " + ivLookup +
                                         " and " + lookup + ".";
                          throw new InjectionConfigurationException(exMsg);
                      }
                  }
              }
          }
  
          // On exit trace the merged configuration data that is contained in this object
          if (isTraceOn && tc.isEntryEnabled())
              Tr.exit(tc, "merge", this);
      }