Program: 64296
Project: 64296
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public T unmarshal(Object object) throws Exception {
  if (object == null) {
    return null;
  }
  PersistenceWeavedRest persistenceWeavedRest=null;
  Link link=null;
  if (object instanceof PersistenceWeavedRest) {
    persistenceWeavedRest=(PersistenceWeavedRest)object;
    link=persistenceWeavedRest._persistence_getHref();
  }
 else   if (object instanceof Link) {
    link=(Link)object;
  }
 else {
    return null;
  }
  if ((null == link) || ((link != null) && (link.getHref() == null))) {
    ClassDescriptor descriptor=context.getJAXBDescriptorForClass(persistenceWeavedRest.getClass());
    if (persistenceWeavedRest instanceof FetchGroupTracker && JpaHelper.getDatabaseSession(context.getEmf()).doesObjectExist(persistenceWeavedRest)) {
      if (context.doesExist(null,persistenceWeavedRest)) {
        FetchGroup fetchGroup=new FetchGroup();
        for (        DatabaseMapping mapping : descriptor.getMappings()) {
          if (!(mapping instanceof XMLInverseReferenceMapping)) {
            fetchGroup.addAttribute(mapping.getAttributeName());
          }
        }
        (new FetchGroupManager()).setObjectFetchGroup(persistenceWeavedRest,fetchGroup,null);
      }
    }
    return (T)persistenceWeavedRest;
  }
  String uri=link.getHref().replace("String_Node_Str","String_Node_Str");
  String entityType=uri.substring(uri.indexOf("String_Node_Str"),uri.lastIndexOf('/'));
  entityType=entityType.substring(entityType.lastIndexOf("String_Node_Str") + 1);
  String entityId=uri.substring(uri.lastIndexOf("String_Node_Str") + 1);
  ClassDescriptor descriptor=context.getDescriptor(entityType);
  Object id=IdHelper.buildId(context,descriptor.getAlias(),entityId);
  T foundEntity=(T)getObjectById(entityType,id);
  return foundEntity;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public T unmarshal(Object object) throws Exception {
  if (object == null) {
    return null;
  }
  PersistenceWeavedRest persistenceWeavedRest=null;
  Link link=null;
  if (object instanceof PersistenceWeavedRest) {
    persistenceWeavedRest=(PersistenceWeavedRest)object;
    link=persistenceWeavedRest._persistence_getHref();
  }
 else   if (object instanceof Link) {
    link=(Link)object;
  }
 else {
    return null;
  }
  if ((null == link) || ((link != null) && (link.getHref() == null))) {
    if (persistenceWeavedRest != null) {
      ClassDescriptor descriptor=context.getJAXBDescriptorForClass(persistenceWeavedRest.getClass());
      if (persistenceWeavedRest instanceof FetchGroupTracker && JpaHelper.getDatabaseSession(context.getEmf()).doesObjectExist(persistenceWeavedRest)) {
        if (context.doesExist(null,persistenceWeavedRest)) {
          FetchGroup fetchGroup=new FetchGroup();
          for (          DatabaseMapping mapping : descriptor.getMappings()) {
            if (!(mapping instanceof XMLInverseReferenceMapping)) {
              fetchGroup.addAttribute(mapping.getAttributeName());
            }
          }
          (new FetchGroupManager()).setObjectFetchGroup(persistenceWeavedRest,fetchGroup,null);
        }
      }
      return (T)persistenceWeavedRest;
    }
  }
  if ((link != null) && (link.getHref() != null)) {
    String uri=link.getHref().replace("String_Node_Str","String_Node_Str");
    String entityType=uri.substring(uri.indexOf("String_Node_Str"),uri.lastIndexOf('/'));
    entityType=entityType.substring(entityType.lastIndexOf("String_Node_Str") + 1);
    String entityId=uri.substring(uri.lastIndexOf("String_Node_Str") + 1);
    ClassDescriptor descriptor=context.getDescriptor(entityType);
    Object id=IdHelper.buildId(context,descriptor.getAlias(),entityId);
    T foundEntity=(T)getObjectById(entityType,id);
    return foundEntity;
  }
  return null;
}