Program: 64740
Project: 64740
Buggy source:
@SuppressWarnings({"String_Node_Str"}) public void preLogin(SessionEvent event){
  Project project=event.getSession().getProject();
  for (  Object descriptorAlias : project.getAliasDescriptors().keySet()) {
    ClassDescriptor descriptor=(ClassDescriptor)project.getAliasDescriptors().get(descriptorAlias);
    Class<?> descriptorClass=descriptor.getJavaClass();
    if (PersistenceWeavedRest.class.isAssignableFrom(descriptorClass)) {
      XMLCompositeCollectionMapping relationshipMapping=new XMLCompositeCollectionMapping();
      relationshipMapping.setAttributeName("String_Node_Str");
      relationshipMapping.setGetMethodName("String_Node_Str");
      relationshipMapping.setSetMethodName("String_Node_Str");
      relationshipMapping.setDescriptor(descriptor);
      CollectionContainerPolicy containerPolicy=new CollectionContainerPolicy(ArrayList.class);
      relationshipMapping.setContainerPolicy(containerPolicy);
      relationshipMapping.setField(new XMLField("String_Node_Str"));
      relationshipMapping.setReferenceClass(Link.class);
      XMLJavaTypeConverter converter=new XMLJavaTypeConverter(RelationshipLinkAdapter.class);
      converter.initialize(relationshipMapping,event.getSession());
      relationshipMapping.setConverter(converter);
      descriptor.addMapping(relationshipMapping);
      XMLCompositeObjectMapping hrefMapping=new XMLCompositeObjectMapping();
      hrefMapping.setAttributeName("String_Node_Str");
      hrefMapping.setGetMethodName("String_Node_Str");
      hrefMapping.setSetMethodName("String_Node_Str");
      hrefMapping.setDescriptor(descriptor);
      hrefMapping.setField(new XMLField("String_Node_Str"));
      hrefMapping.setReferenceClass(Link.class);
      hrefMapping.setXPath("String_Node_Str");
      descriptor.addMapping(hrefMapping);
    }
    ClassDescriptor jpaDescriptor=jpaSession.getDescriptorForAlias(descriptor.getAlias());
    Vector<DatabaseMapping> descriptorMappings=(Vector<DatabaseMapping>)descriptor.getMappings().clone();
    for (    DatabaseMapping mapping : descriptorMappings) {
      if (mapping.isXMLMapping()) {
        if (mapping.isAbstractCompositeObjectMapping() || mapping.isAbstractCompositeCollectionMapping()) {
          if (mapping.isAbstractCompositeCollectionMapping()) {
            XMLInverseReferenceMapping inverseMapping=((XMLCompositeCollectionMapping)mapping).getInverseReferenceMapping();
            if (inverseMapping != null) {
              break;
            }
          }
 else           if (mapping.isAbstractCompositeObjectMapping()) {
            XMLInverseReferenceMapping inverseMapping=((XMLCompositeObjectMapping)mapping).getInverseReferenceMapping();
            if (inverseMapping != null) {
              break;
            }
          }
          if (jpaDescriptor != null) {
            ForeignReferenceMapping jpaMapping=(ForeignReferenceMapping)jpaDescriptor.getMappingForAttributeName(mapping.getAttributeName());
            if (jpaMapping != null) {
              if (jpaMapping.getMappedBy() != null) {
                ClassDescriptor inverseDescriptor=project.getDescriptorForAlias(jpaMapping.getReferenceDescriptor().getAlias());
                DatabaseMapping inverseMapping=inverseDescriptor.getMappingForAttributeName(jpaMapping.getMappedBy());
                convertMappingToXMLInverseReferenceMapping(inverseDescriptor,inverseMapping,jpaMapping.getAttributeName());
              }
            }
          }
        }
      }
    }
    ClassLoader cl=jpaSession.getPlatform().getConversionManager().getLoader();
    descriptorMappings=(Vector<DatabaseMapping>)descriptor.getMappings().clone();
    for (    DatabaseMapping mapping : descriptorMappings) {
      if (jpaDescriptor != null && mapping.isXMLMapping()) {
        if (mapping.isAbstractCompositeObjectMapping() || mapping.isAbstractCompositeCollectionMapping()) {
          ForeignReferenceMapping jpaMapping=(ForeignReferenceMapping)jpaDescriptor.getMappingForAttributeName(mapping.getAttributeName());
          if (jpaMapping != null) {
            convertMappingToXMLChoiceMapping(descriptor,jpaMapping,cl);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) public void preLogin(SessionEvent event){
  Project project=event.getSession().getProject();
  for (  Object descriptorAlias : project.getAliasDescriptors().keySet()) {
    ClassDescriptor descriptor=(ClassDescriptor)project.getAliasDescriptors().get(descriptorAlias);
    Class<?> descriptorClass=descriptor.getJavaClass();
    if (PersistenceWeavedRest.class.isAssignableFrom(descriptorClass)) {
      XMLCompositeCollectionMapping relationshipMapping=new XMLCompositeCollectionMapping();
      relationshipMapping.setAttributeName("String_Node_Str");
      relationshipMapping.setGetMethodName("String_Node_Str");
      relationshipMapping.setSetMethodName("String_Node_Str");
      relationshipMapping.setDescriptor(descriptor);
      CollectionContainerPolicy containerPolicy=new CollectionContainerPolicy(ArrayList.class);
      relationshipMapping.setContainerPolicy(containerPolicy);
      relationshipMapping.setField(new XMLField("String_Node_Str"));
      relationshipMapping.setReferenceClass(Link.class);
      XMLJavaTypeConverter converter=new XMLJavaTypeConverter(RelationshipLinkAdapter.class);
      converter.initialize(relationshipMapping,event.getSession());
      relationshipMapping.setConverter(converter);
      descriptor.addMapping(relationshipMapping);
      XMLCompositeObjectMapping hrefMapping=new XMLCompositeObjectMapping();
      hrefMapping.setAttributeName("String_Node_Str");
      hrefMapping.setGetMethodName("String_Node_Str");
      hrefMapping.setSetMethodName("String_Node_Str");
      hrefMapping.setDescriptor(descriptor);
      hrefMapping.setField(new XMLField("String_Node_Str"));
      hrefMapping.setReferenceClass(Link.class);
      hrefMapping.setXPath("String_Node_Str");
      descriptor.addMapping(hrefMapping);
    }
    ClassDescriptor jpaDescriptor=jpaSession.getDescriptorForAlias(descriptor.getAlias());
    Vector<DatabaseMapping> descriptorMappings=(Vector<DatabaseMapping>)descriptor.getMappings().clone();
    for (    DatabaseMapping mapping : descriptorMappings) {
      if (mapping.isXMLMapping()) {
        if (mapping.isAbstractCompositeObjectMapping() || mapping.isAbstractCompositeCollectionMapping()) {
          if (mapping.isAbstractCompositeCollectionMapping()) {
            XMLInverseReferenceMapping inverseMapping=((XMLCompositeCollectionMapping)mapping).getInverseReferenceMapping();
            if (inverseMapping != null) {
              break;
            }
          }
 else           if (mapping.isAbstractCompositeObjectMapping()) {
            XMLInverseReferenceMapping inverseMapping=((XMLCompositeObjectMapping)mapping).getInverseReferenceMapping();
            if (inverseMapping != null) {
              break;
            }
          }
          if (jpaDescriptor != null) {
            DatabaseMapping dbMapping=jpaDescriptor.getMappingForAttributeName(mapping.getAttributeName());
            if ((dbMapping != null) && (dbMapping instanceof ForeignReferenceMapping)) {
              ForeignReferenceMapping jpaMapping=(ForeignReferenceMapping)dbMapping;
              if (jpaMapping != null) {
                if (jpaMapping.getMappedBy() != null) {
                  ClassDescriptor inverseDescriptor=project.getDescriptorForAlias(jpaMapping.getReferenceDescriptor().getAlias());
                  DatabaseMapping inverseMapping=inverseDescriptor.getMappingForAttributeName(jpaMapping.getMappedBy());
                  convertMappingToXMLInverseReferenceMapping(inverseDescriptor,inverseMapping,jpaMapping.getAttributeName());
                }
              }
            }
          }
        }
      }
    }
    ClassLoader cl=jpaSession.getPlatform().getConversionManager().getLoader();
    descriptorMappings=(Vector<DatabaseMapping>)descriptor.getMappings().clone();
    for (    DatabaseMapping mapping : descriptorMappings) {
      if (jpaDescriptor != null && mapping.isXMLMapping()) {
        if (mapping.isAbstractCompositeObjectMapping() || mapping.isAbstractCompositeCollectionMapping()) {
          DatabaseMapping dbMapping=jpaDescriptor.getMappingForAttributeName(mapping.getAttributeName());
          if ((dbMapping != null) && (dbMapping instanceof ForeignReferenceMapping)) {
            ForeignReferenceMapping jpaMapping=(ForeignReferenceMapping)dbMapping;
            if (jpaMapping != null) {
              convertMappingToXMLChoiceMapping(descriptor,jpaMapping,cl);
            }
          }
        }
      }
    }
  }
}