Program: 66388
Project: 66388
Buggy source:
protected ClassDescriptor buildVariableOneToOneMappingDescriptor(){
  XMLDescriptor descriptor=new XMLDescriptor();
  descriptor.setJavaClass(VariableOneToOneMapping.class);
  descriptor.getInheritancePolicy().setParentClass(ObjectReferenceMapping.class);
  XMLDirectMapping relationshipPartnerAttributeNameMapping=new XMLDirectMapping();
  relationshipPartnerAttributeNameMapping.setAttributeName("String_Node_Str");
  relationshipPartnerAttributeNameMapping.setGetMethodName("String_Node_Str");
  relationshipPartnerAttributeNameMapping.setSetMethodName("String_Node_Str");
  relationshipPartnerAttributeNameMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.addMapping(relationshipPartnerAttributeNameMapping);
  XMLDirectMapping usesBatchReadingMapping=new XMLDirectMapping();
  usesBatchReadingMapping.setAttributeName("String_Node_Str");
  usesBatchReadingMapping.setGetMethodName("String_Node_Str");
  usesBatchReadingMapping.setSetMethodName("String_Node_Str");
  usesBatchReadingMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str");
  usesBatchReadingMapping.setNullValue(Boolean.FALSE);
  descriptor.addMapping(usesBatchReadingMapping);
  XMLCompositeObjectMapping indirectionPolicyMapping=new XMLCompositeObjectMapping();
  indirectionPolicyMapping.setReferenceClass(IndirectionPolicy.class);
  indirectionPolicyMapping.setAttributeAccessor(new AttributeAccessor(){
    public Object getAttributeValueFromObject(    Object object){
      IndirectionPolicy policy=((ForeignReferenceMapping)object).getIndirectionPolicy();
      if (policy instanceof NoIndirectionPolicy) {
        return null;
      }
      return policy;
    }
    public void setAttributeValueInObject(    Object object,    Object value){
      IndirectionPolicy policy=(IndirectionPolicy)value;
      if (value == null) {
        policy=new NoIndirectionPolicy();
      }
      ((ForeignReferenceMapping)object).setIndirectionPolicy(policy);
    }
  }
);
  indirectionPolicyMapping.setAttributeName("String_Node_Str");
  indirectionPolicyMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.addMapping(indirectionPolicyMapping);
  XMLCompositeObjectMapping selectionQueryMapping=new XMLCompositeObjectMapping();
  selectionQueryMapping.setAttributeName("String_Node_Str");
  selectionQueryMapping.setGetMethodName("String_Node_Str");
  selectionQueryMapping.setSetMethodName("String_Node_Str");
  selectionQueryMapping.setReferenceClass(ReadQuery.class);
  selectionQueryMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.addMapping(selectionQueryMapping);
  XMLCompositeObjectMapping typeFieldMapping=new XMLCompositeObjectMapping();
  typeFieldMapping.setAttributeName("String_Node_Str");
  typeFieldMapping.setGetMethodName("String_Node_Str");
  typeFieldMapping.setSetMethodName("String_Node_Str");
  typeFieldMapping.setReferenceClass(DatabaseField.class);
  typeFieldMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.addMapping(typeFieldMapping);
  XMLCompositeCollectionMapping foreignKeyFieldsMapping=new XMLCompositeCollectionMapping();
  foreignKeyFieldsMapping.useCollectionClass(NonSynchronizedVector.class);
  foreignKeyFieldsMapping.setAttributeName("String_Node_Str");
  foreignKeyFieldsMapping.setGetMethodName("String_Node_Str");
  foreignKeyFieldsMapping.setSetMethodName("String_Node_Str");
  foreignKeyFieldsMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str" + getPrimaryNamespaceXPath()+ "String_Node_Str");
  foreignKeyFieldsMapping.setReferenceClass(DatabaseField.class);
  descriptor.addMapping(foreignKeyFieldsMapping);
  XMLCompositeCollectionMapping sourceFieldToTargetQueryKeyMapping=new XMLCompositeCollectionMapping();
  sourceFieldToTargetQueryKeyMapping.setAttributeName("String_Node_Str");
  sourceFieldToTargetQueryKeyMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str" + getPrimaryNamespaceXPath()+ "String_Node_Str");
  sourceFieldToTargetQueryKeyMapping.setGetMethodName("String_Node_Str");
  sourceFieldToTargetQueryKeyMapping.setSetMethodName("String_Node_Str");
  sourceFieldToTargetQueryKeyMapping.setAttributeAccessor(new AttributeAccessor(){
    public Object getAttributeValueFromObject(    Object object){
      VariableOneToOneMapping mapping=(VariableOneToOneMapping)object;
      Vector associations=mapping.getSourceToTargetQueryKeyFieldAssociations();
      Vector queryKeyReferences=new Vector(associations.size());
      for (int index=0; index < associations.size(); index++) {
        Association association=(Association)associations.get(index);
        QueryKeyReference reference=new QueryKeyReference();
        reference.setKey(new DatabaseField((String)association.getKey()));
        reference.setValue(association.getValue());
        queryKeyReferences.add(reference);
      }
      return queryKeyReferences;
    }
    public void setAttributeValueInObject(    Object object,    Object value){
      VariableOneToOneMapping mapping=(VariableOneToOneMapping)object;
      Vector associations=(Vector)value;
      for (int index=0; index < associations.size(); index++) {
        Association association=(Association)associations.get(index);
        association.setKey(((DatabaseField)association.getKey()).getQualifiedName());
      }
      mapping.setSourceToTargetQueryKeyFieldAssociations(associations);
    }
  }
);
  sourceFieldToTargetQueryKeyMapping.setReferenceClass(QueryKeyReference.class);
  descriptor.addMapping(sourceFieldToTargetQueryKeyMapping);
  XMLCompositeCollectionMapping classIndicatorsMapping=new XMLCompositeCollectionMapping();
  classIndicatorsMapping.setAttributeName("String_Node_Str");
  classIndicatorsMapping.setGetMethodName("String_Node_Str");
  classIndicatorsMapping.setSetMethodName("String_Node_Str");
  classIndicatorsMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str" + getPrimaryNamespaceXPath()+ "String_Node_Str");
  classIndicatorsMapping.setReferenceClass(TypedAssociation.class);
  descriptor.addMapping(classIndicatorsMapping);
  return descriptor;
}

Fixed version (ground truth):
protected ClassDescriptor buildVariableOneToOneMappingDescriptor(){
  XMLDescriptor descriptor=new XMLDescriptor();
  descriptor.setJavaClass(VariableOneToOneMapping.class);
  descriptor.getInheritancePolicy().setParentClass(ObjectReferenceMapping.class);
  XMLDirectMapping relationshipPartnerAttributeNameMapping=new XMLDirectMapping();
  relationshipPartnerAttributeNameMapping.setAttributeName("String_Node_Str");
  relationshipPartnerAttributeNameMapping.setGetMethodName("String_Node_Str");
  relationshipPartnerAttributeNameMapping.setSetMethodName("String_Node_Str");
  relationshipPartnerAttributeNameMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.addMapping(relationshipPartnerAttributeNameMapping);
  XMLDirectMapping usesBatchReadingMapping=new XMLDirectMapping();
  usesBatchReadingMapping.setAttributeName("String_Node_Str");
  usesBatchReadingMapping.setGetMethodName("String_Node_Str");
  usesBatchReadingMapping.setSetMethodName("String_Node_Str");
  usesBatchReadingMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str");
  usesBatchReadingMapping.setNullValue(Boolean.FALSE);
  descriptor.addMapping(usesBatchReadingMapping);
  XMLCompositeObjectMapping indirectionPolicyMapping=new XMLCompositeObjectMapping();
  indirectionPolicyMapping.setReferenceClass(IndirectionPolicy.class);
  indirectionPolicyMapping.setAttributeAccessor(new AttributeAccessor(){
    public Object getAttributeValueFromObject(    Object object){
      IndirectionPolicy policy=((ForeignReferenceMapping)object).getIndirectionPolicy();
      if (policy instanceof NoIndirectionPolicy) {
        return null;
      }
      return policy;
    }
    public void setAttributeValueInObject(    Object object,    Object value){
      IndirectionPolicy policy=(IndirectionPolicy)value;
      if (value == null) {
        policy=new NoIndirectionPolicy();
      }
      ((ForeignReferenceMapping)object).setIndirectionPolicy(policy);
    }
  }
);
  indirectionPolicyMapping.setAttributeName("String_Node_Str");
  indirectionPolicyMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.addMapping(indirectionPolicyMapping);
  XMLCompositeObjectMapping selectionQueryMapping=new XMLCompositeObjectMapping();
  selectionQueryMapping.setAttributeName("String_Node_Str");
  selectionQueryMapping.setGetMethodName("String_Node_Str");
  selectionQueryMapping.setSetMethodName("String_Node_Str");
  selectionQueryMapping.setReferenceClass(ReadQuery.class);
  selectionQueryMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.addMapping(selectionQueryMapping);
  XMLCompositeObjectMapping typeFieldMapping=new XMLCompositeObjectMapping();
  typeFieldMapping.setAttributeName("String_Node_Str");
  typeFieldMapping.setGetMethodName("String_Node_Str");
  typeFieldMapping.setSetMethodName("String_Node_Str");
  typeFieldMapping.setReferenceClass(DatabaseField.class);
  typeFieldMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str");
  ((XMLField)typeFieldMapping.getField()).setLeafElementType(fieldQname);
  descriptor.addMapping(typeFieldMapping);
  XMLCompositeCollectionMapping foreignKeyFieldsMapping=new XMLCompositeCollectionMapping();
  foreignKeyFieldsMapping.useCollectionClass(NonSynchronizedVector.class);
  foreignKeyFieldsMapping.setAttributeName("String_Node_Str");
  foreignKeyFieldsMapping.setGetMethodName("String_Node_Str");
  foreignKeyFieldsMapping.setSetMethodName("String_Node_Str");
  foreignKeyFieldsMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str" + getPrimaryNamespaceXPath()+ "String_Node_Str");
  foreignKeyFieldsMapping.setReferenceClass(DatabaseField.class);
  ((XMLField)foreignKeyFieldsMapping.getField()).setLeafElementType(new QName(getSecondaryNamespace(),"String_Node_Str"));
  descriptor.addMapping(foreignKeyFieldsMapping);
  XMLCompositeCollectionMapping sourceFieldToTargetQueryKeyMapping=new XMLCompositeCollectionMapping();
  sourceFieldToTargetQueryKeyMapping.setAttributeName("String_Node_Str");
  sourceFieldToTargetQueryKeyMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str" + getPrimaryNamespaceXPath()+ "String_Node_Str");
  sourceFieldToTargetQueryKeyMapping.setGetMethodName("String_Node_Str");
  sourceFieldToTargetQueryKeyMapping.setSetMethodName("String_Node_Str");
  sourceFieldToTargetQueryKeyMapping.setAttributeAccessor(new AttributeAccessor(){
    public Object getAttributeValueFromObject(    Object object){
      VariableOneToOneMapping mapping=(VariableOneToOneMapping)object;
      Vector associations=mapping.getSourceToTargetQueryKeyFieldAssociations();
      Vector queryKeyReferences=new Vector(associations.size());
      for (int index=0; index < associations.size(); index++) {
        Association association=(Association)associations.get(index);
        QueryKeyReference reference=new QueryKeyReference();
        reference.setKey(new DatabaseField((String)association.getKey()));
        reference.setValue(association.getValue());
        queryKeyReferences.add(reference);
      }
      return queryKeyReferences;
    }
    public void setAttributeValueInObject(    Object object,    Object value){
      VariableOneToOneMapping mapping=(VariableOneToOneMapping)object;
      Vector associations=(Vector)value;
      for (int index=0; index < associations.size(); index++) {
        Association association=(Association)associations.get(index);
        association.setKey(((DatabaseField)association.getKey()).getQualifiedName());
      }
      mapping.setSourceToTargetQueryKeyFieldAssociations(associations);
    }
  }
);
  sourceFieldToTargetQueryKeyMapping.setReferenceClass(QueryKeyReference.class);
  descriptor.addMapping(sourceFieldToTargetQueryKeyMapping);
  XMLCompositeCollectionMapping classIndicatorsMapping=new XMLCompositeCollectionMapping();
  classIndicatorsMapping.setAttributeName("String_Node_Str");
  classIndicatorsMapping.setGetMethodName("String_Node_Str");
  classIndicatorsMapping.setSetMethodName("String_Node_Str");
  classIndicatorsMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str" + getPrimaryNamespaceXPath()+ "String_Node_Str");
  classIndicatorsMapping.setReferenceClass(TypedAssociation.class);
  descriptor.addMapping(classIndicatorsMapping);
  return descriptor;
}