nus-yam/ex-repair huggingface dataset:
Program: 64082
Project: 64082
Buggy source:
/** 
 * INTERNAL: Select all rows from a abstract table descriptor. This is accomplished by selecting for all of the concrete classes and then merging the rows. This does not optimize using type select, as the type information is not known.
 * @return vector containing database rows.
 * @exception DatabaseException - an error has occurred on the database.
 */
protected Vector selectAllRowUsingCustomMultipleTableSubclassRead(ReadAllQuery query) throws DatabaseException {
  Vector rows=new Vector();
  if ((getOnlyInstancesExpression() != null) || (!shouldReadSubclasses())) {
    ReadAllQuery concreteQuery=(ReadAllQuery)query.clone();
    concreteQuery.setReferenceClass(getDescriptor().getJavaClass());
    concreteQuery.setDescriptor(getDescriptor());
    Vector concreteRows=((ExpressionQueryMechanism)concreteQuery.getQueryMechanism()).selectAllRowsFromConcreteTable();
    rows=Helper.concatenateVectors(rows,concreteRows);
  }
  if (hasMultipleTableChild() || !shouldReadSubclasses()) {
    for (    ClassDescriptor concreteDescriptor : getChildDescriptors()) {
      Vector concreteRows=concreteDescriptor.getInheritancePolicy().selectAllRowUsingCustomMultipleTableSubclassRead(query);
      rows=Helper.concatenateVectors(rows,concreteRows);
    }
  }
  return rows;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Select all rows from a abstract table descriptor. This is accomplished by selecting for all of the concrete classes and then merging the rows. This does not optimize using type select, as the type information is not known.
 * @return vector containing database rows.
 * @exception DatabaseException - an error has occurred on the database.
 */
protected Vector selectAllRowUsingCustomMultipleTableSubclassRead(ObjectLevelReadQuery query) throws DatabaseException {
  Vector rows=new Vector();
  if ((getOnlyInstancesExpression() != null) || (!shouldReadSubclasses())) {
    ObjectLevelReadQuery concreteQuery=(ObjectLevelReadQuery)query.clone();
    concreteQuery.setReferenceClass(getDescriptor().getJavaClass());
    concreteQuery.setDescriptor(getDescriptor());
    Vector concreteRows=((ExpressionQueryMechanism)concreteQuery.getQueryMechanism()).selectAllRowsFromConcreteTable();
    rows=Helper.concatenateVectors(rows,concreteRows);
  }
  if (hasMultipleTableChild() || !shouldReadSubclasses()) {
    for (    ClassDescriptor concreteDescriptor : getChildDescriptors()) {
      Vector concreteRows=concreteDescriptor.getInheritancePolicy().selectAllRowUsingCustomMultipleTableSubclassRead(query);
      rows=Helper.concatenateVectors(rows,concreteRows);
    }
  }
  return rows;
}
Program: 64084
Project: 64084
Buggy source:
/** 
 * INTERNAL: Select all rows from a abstract table descriptor. This is accomplished by selecting for all of the concrete classes and then merging the rows.
 * @return vector containing database rows.
 * @exception DatabaseException - an error has occurred on the database.
 */
public Vector selectAllRowUsingMultipleTableSubclassRead(ReadAllQuery query) throws DatabaseException {
  if (hasClassExtractor()) {
    return selectAllRowUsingCustomMultipleTableSubclassRead(query);
  }
 else {
    return selectAllRowUsingDefaultMultipleTableSubclassRead(query);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Select all rows from a abstract table descriptor. This is accomplished by selecting for all of the concrete classes and then merging the rows.
 * @return vector containing database rows.
 * @exception DatabaseException - an error has occurred on the database.
 */
public Vector selectAllRowUsingMultipleTableSubclassRead(ObjectLevelReadQuery query) throws DatabaseException {
  if (hasClassExtractor()) {
    return selectAllRowUsingCustomMultipleTableSubclassRead(query);
  }
 else {
    return selectAllRowUsingDefaultMultipleTableSubclassRead(query);
  }
}
Program: 64085
Project: 64085
Buggy source:
/** 
 * Read all rows from the database.
 * @return Vector containing the database rows.
 * @exception DatabaseException - an error has occurred on the database.
 */
public Vector selectAllRows() throws DatabaseException {
  if (!((ObjectLevelReadQuery)this.query).shouldOuterJoinSubclasses()) {
    ClassDescriptor descriptor=getDescriptor();
    if (descriptor.hasInheritance() && descriptor.getInheritancePolicy().requiresMultipleTableSubclassRead() && (!descriptor.getInheritancePolicy().hasView())) {
      return descriptor.getInheritancePolicy().selectAllRowUsingMultipleTableSubclassRead((ReadAllQuery)this.query);
    }
  }
  return selectAllRowsFromTable();
}

Fixed version (ground truth):
/** 
 * Read all rows from the database.
 * @return Vector containing the database rows.
 * @exception DatabaseException - an error has occurred on the database.
 */
public Vector selectAllRows() throws DatabaseException {
  if (!((ObjectLevelReadQuery)this.query).shouldOuterJoinSubclasses()) {
    ClassDescriptor descriptor=getDescriptor();
    if (descriptor.hasInheritance() && descriptor.getInheritancePolicy().requiresMultipleTableSubclassRead() && (!descriptor.getInheritancePolicy().hasView())) {
      return descriptor.getInheritancePolicy().selectAllRowUsingMultipleTableSubclassRead((ObjectLevelReadQuery)this.query);
    }
  }
  return selectAllRowsFromTable();
}
Program: 64087
Project: 64087
Buggy source:
/** 
 * PUBLIC: Factory method to create session. This returns an implementor of the CoreSession interface, which can be used to login and add descriptors from other projects.  The CoreSession interface however should be used for reading and writing once connected for complete portability.
 */
public abstract SESSION createDatabaseSession();

Fixed version (ground truth):
/** 
 * INTERNAL: Factory method to create session. This returns an implementor of the CoreSession interface, which can be used to login and add descriptors from other projects.  The CoreSession interface however should be used for reading and writing once connected for complete portability.
 */
public abstract SESSION createDatabaseSession();
Program: 64088
Project: 64088
Buggy source:
protected void addMapping(Descriptor descriptor,DatabaseMapping mapping){
  String target=null;
  if (mapping.isCollectionMapping()) {
    CollectionMapping collectionMapping=(CollectionMapping)mapping;
    String collectionType=collectionMapping.getContainerPolicy().getContainerClassName();
    if (collectionMapping.getContainerPolicy().isMapPolicy()) {
      String mapKeyType=((MapContainerPolicy)collectionMapping.getContainerPolicy()).getKeyType().toString();
      target=collectionType + "String_Node_Str" + mapKeyType+ "String_Node_Str"+ collectionMapping.getReferenceClassName()+ "String_Node_Str";
    }
 else {
      target=collectionType + "String_Node_Str" + collectionMapping.getReferenceClassName()+ "String_Node_Str";
    }
  }
 else   if (mapping.isForeignReferenceMapping()) {
    target=((ForeignReferenceMapping)mapping).getReferenceClass().getName();
  }
 else {
    target=mapping.getAttributeClassification().getName();
  }
  descriptor.getAttributes().add(new Attribute(mapping.getAttributeName(),target));
}

Fixed version (ground truth):
protected void addMapping(Descriptor descriptor,DatabaseMapping mapping){
  String target=null;
  if (mapping.isCollectionMapping()) {
    if (mapping.isEISMapping()) {
      EISCompositeCollectionMapping collectionMapping=(EISCompositeCollectionMapping)mapping;
      String collectionType=mapping.getContainerPolicy().getContainerClass().getSimpleName();
      if (collectionMapping.getContainerPolicy().isMapPolicy()) {
        String mapKeyType=((MapContainerPolicy)collectionMapping.getContainerPolicy()).getKeyType().toString();
        target=collectionType + "String_Node_Str" + mapKeyType+ "String_Node_Str"+ collectionMapping.getReferenceClass().getSimpleName()+ "String_Node_Str";
      }
 else {
        target=collectionType + "String_Node_Str" + collectionMapping.getReferenceClass().getSimpleName()+ "String_Node_Str";
      }
    }
 else {
      CollectionMapping collectionMapping=(CollectionMapping)mapping;
      String collectionType=collectionMapping.getContainerPolicy().getContainerClassName();
      if (collectionMapping.getContainerPolicy().isMapPolicy()) {
        String mapKeyType=((MapContainerPolicy)collectionMapping.getContainerPolicy()).getKeyType().toString();
        target=collectionType + "String_Node_Str" + mapKeyType+ "String_Node_Str"+ collectionMapping.getReferenceClass().getSimpleName()+ "String_Node_Str";
      }
 else {
        target=collectionType + "String_Node_Str" + collectionMapping.getReferenceClass().getSimpleName()+ "String_Node_Str";
      }
    }
  }
 else   if (mapping.isForeignReferenceMapping()) {
    target=((ForeignReferenceMapping)mapping).getReferenceClass().getSimpleName();
  }
 else {
    target=mapping.getAttributeClassification().getSimpleName();
  }
  descriptor.getAttributes().add(new Attribute(mapping.getAttributeName(),target));
}
Program: 64089
Project: 64089
Buggy source:
protected Descriptor buildDescriptor(PersistenceContext app,String persistenceUnit,ClassDescriptor descriptor,String baseUri){
  Descriptor returnDescriptor=new Descriptor();
  returnDescriptor.setName(descriptor.getAlias());
  returnDescriptor.setType(descriptor.getJavaClassName());
  returnDescriptor.getLinkTemplates().add(new LinkTemplate("String_Node_Str","String_Node_Str",baseUri + persistenceUnit + "String_Node_Str"+ descriptor.getAlias()+ "String_Node_Str"));
  returnDescriptor.getLinkTemplates().add(new LinkTemplate("String_Node_Str","String_Node_Str",baseUri + persistenceUnit + "String_Node_Str"+ descriptor.getAlias()));
  returnDescriptor.getLinkTemplates().add(new LinkTemplate("String_Node_Str","String_Node_Str",baseUri + persistenceUnit + "String_Node_Str"+ descriptor.getAlias()));
  returnDescriptor.getLinkTemplates().add(new LinkTemplate("String_Node_Str","String_Node_Str",baseUri + persistenceUnit + "String_Node_Str"+ descriptor.getAlias()+ "String_Node_Str"));
  if (!descriptor.getMappings().isEmpty()) {
    Iterator<DatabaseMapping> mappingIterator=descriptor.getMappings().iterator();
    while (mappingIterator.hasNext()) {
      DatabaseMapping mapping=mappingIterator.next();
      addMapping(returnDescriptor,mapping);
    }
  }
  addQueries(returnDescriptor.getQueries(),app,descriptor.getJavaClassName());
  return returnDescriptor;
}

Fixed version (ground truth):
protected Descriptor buildDescriptor(PersistenceContext app,String persistenceUnit,ClassDescriptor descriptor,String baseUri){
  Descriptor returnDescriptor=new Descriptor();
  returnDescriptor.setName(descriptor.getAlias());
  returnDescriptor.setType(descriptor.getJavaClass().getSimpleName());
  returnDescriptor.getLinkTemplates().add(new LinkTemplate("String_Node_Str","String_Node_Str",baseUri + persistenceUnit + "String_Node_Str"+ descriptor.getAlias()+ "String_Node_Str"));
  returnDescriptor.getLinkTemplates().add(new LinkTemplate("String_Node_Str","String_Node_Str",baseUri + persistenceUnit + "String_Node_Str"+ descriptor.getAlias()));
  returnDescriptor.getLinkTemplates().add(new LinkTemplate("String_Node_Str","String_Node_Str",baseUri + persistenceUnit + "String_Node_Str"+ descriptor.getAlias()));
  returnDescriptor.getLinkTemplates().add(new LinkTemplate("String_Node_Str","String_Node_Str",baseUri + persistenceUnit + "String_Node_Str"+ descriptor.getAlias()+ "String_Node_Str"));
  if (!descriptor.getMappings().isEmpty()) {
    Iterator<DatabaseMapping> mappingIterator=descriptor.getMappings().iterator();
    while (mappingIterator.hasNext()) {
      DatabaseMapping mapping=mappingIterator.next();
      addMapping(returnDescriptor,mapping);
    }
  }
  addQueries(returnDescriptor.getQueries(),app,descriptor.getJavaClassName());
  return returnDescriptor;
}
Program: 64093
Project: 64093
Buggy source:
/** 
 * Build an XMLInverseMapping based on a particular mapping and replace that mapping with the newly created XMLInverseMapping in jaxbDescriptor
 * @param jaxbDescriptor
 * @param mapping
 * @param mappedBy
 */
private static void convertMappingToXMLInverseReferenceMapping(ClassDescriptor jaxbDescriptor,DatabaseMapping mapping,String mappedBy){
  if ((mapping != null) && (jaxbDescriptor != null)) {
    if (!(mapping.isXMLMapping())) {
      return;
    }
    XMLInverseReferenceMapping jaxbInverseMapping=new XMLInverseReferenceMapping();
    copyAccessorToMapping(mapping,jaxbInverseMapping);
    jaxbInverseMapping.setProperties(mapping.getProperties());
    jaxbInverseMapping.setIsReadOnly(mapping.isReadOnly());
    jaxbInverseMapping.setMappedBy(mappedBy);
    if (mapping.isAbstractCompositeCollectionMapping()) {
      jaxbInverseMapping.setContainerPolicy(mapping.getContainerPolicy());
      jaxbInverseMapping.setReferenceClass(((XMLCompositeCollectionMapping)mapping).getReferenceClass());
    }
 else     if (mapping.isAbstractCompositeObjectMapping()) {
      jaxbInverseMapping.setReferenceClass(((XMLCompositeObjectMapping)mapping).getReferenceClass());
    }
    jaxbDescriptor.removeMappingForAttributeName(mapping.getAttributeName());
    jaxbDescriptor.addMapping(jaxbInverseMapping);
  }
}

Fixed version (ground truth):
/** 
 * Build an XMLInverseMapping based on a particular mapping and replace that mapping with the newly created XMLInverseMapping in jaxbDescriptor
 * @param jaxbDescriptor
 * @param mapping
 * @param mappedBy
 */
private static void convertMappingToXMLInverseReferenceMapping(ClassDescriptor jaxbDescriptor,DatabaseMapping mapping,String mappedBy){
  if ((mapping != null) && (jaxbDescriptor != null)) {
    if (!(mapping.isXMLMapping())) {
      return;
    }
    if ((mapping.isAggregateCollectionMapping()) || (mapping.isAggregateMapping())) {
      return;
    }
    XMLInverseReferenceMapping jaxbInverseMapping=new XMLInverseReferenceMapping();
    copyAccessorToMapping(mapping,jaxbInverseMapping);
    jaxbInverseMapping.setProperties(mapping.getProperties());
    jaxbInverseMapping.setIsReadOnly(mapping.isReadOnly());
    jaxbInverseMapping.setMappedBy(mappedBy);
    if (mapping.isAbstractCompositeCollectionMapping()) {
      jaxbInverseMapping.setContainerPolicy(mapping.getContainerPolicy());
      jaxbInverseMapping.setReferenceClass(((XMLCompositeCollectionMapping)mapping).getReferenceClass());
    }
 else     if (mapping.isAbstractCompositeObjectMapping()) {
      jaxbInverseMapping.setReferenceClass(((XMLCompositeObjectMapping)mapping).getReferenceClass());
    }
    jaxbDescriptor.removeMappingForAttributeName(mapping.getAttributeName());
    jaxbDescriptor.addMapping(jaxbInverseMapping);
  }
}
Program: 64095
Project: 64095
Buggy source:
/** 
 * Create a javaType to be used by JAXB to map a particular class. For static classes, JAXB annotations, xml and defaults will be used to map the class. For Dynamic classes we create properties for each JPA mapping on the class thing we create is a 
 * @param classDescriptor
 * @param objectFactory
 * @return
 */
private JavaType createJAXBType(ClassDescriptor classDescriptor,ObjectFactory objectFactory){
  JavaType javaType=new JavaType();
  javaType.setName(classDescriptor.getAlias());
  javaType.setJavaAttributes(new JavaAttributes());
  boolean isDynamic=DynamicEntity.class.isAssignableFrom(classDescriptor.getJavaClass());
  for (  DatabaseMapping ormMapping : classDescriptor.getMappings()) {
    JAXBElement<XmlElement> element=createJAXBProperty(ormMapping,objectFactory,javaType,isDynamic);
    if (element != null) {
      javaType.getJavaAttributes().getJavaAttribute().add(element);
    }
  }
  javaType.setXmlRootElement(new org.eclipse.persistence.jaxb.xmlmodel.XmlRootElement());
  String name=RestAdapterClassWriter.constructClassNameForReferenceAdapter(classDescriptor.getJavaClassName());
  XmlJavaTypeAdapter adapter=new XmlJavaTypeAdapter();
  adapter.setValue(name);
  adapter.setValueType(classDescriptor.getJavaClassName());
  adapter.setType(classDescriptor.getJavaClassName());
  javaType.setXmlJavaTypeAdapter(adapter);
  return javaType;
}

Fixed version (ground truth):
/** 
 * Create a javaType to be used by JAXB to map a particular class. For static classes, JAXB annotations, xml and defaults will be used to map the class. For Dynamic classes we create properties for each JPA mapping on the class thing we create is a 
 * @param classDescriptor
 * @param objectFactory
 * @return
 */
private JavaType createJAXBType(ClassDescriptor classDescriptor,ObjectFactory objectFactory){
  JavaType javaType=new JavaType();
  String alias=classDescriptor.getAlias();
  if (alias == null || alias.isEmpty()) {
    alias=classDescriptor.getJavaClass().getSimpleName();
  }
  javaType.setName(alias);
  javaType.setJavaAttributes(new JavaAttributes());
  boolean isDynamic=DynamicEntity.class.isAssignableFrom(classDescriptor.getJavaClass());
  for (  DatabaseMapping ormMapping : classDescriptor.getMappings()) {
    JAXBElement<XmlElement> element=createJAXBProperty(ormMapping,objectFactory,javaType,isDynamic);
    if (element != null) {
      javaType.getJavaAttributes().getJavaAttribute().add(element);
    }
  }
  javaType.setXmlRootElement(new org.eclipse.persistence.jaxb.xmlmodel.XmlRootElement());
  if (classDescriptor.isAggregateDescriptor()) {
    return javaType;
  }
  String name=RestAdapterClassWriter.constructClassNameForReferenceAdapter(classDescriptor.getJavaClassName());
  XmlJavaTypeAdapter adapter=new XmlJavaTypeAdapter();
  adapter.setValue(name);
  adapter.setValueType(classDescriptor.getJavaClassName());
  adapter.setType(classDescriptor.getJavaClassName());
  javaType.setXmlJavaTypeAdapter(adapter);
  return javaType;
}
Program: 64097
Project: 64097
Buggy source:
/** 
 * INTERNAL: This method will insert the group into the entity hierarchy just below this AttributeGroup.
 * @param group
 */
public void insertSubClass(CoreAttributeGroup group){
  if (this == group) {
    return;
  }
  group.superClassGroup=this;
  if (subClasses != null) {
    for (Iterator<CoreAttributeGroup> subClasses=this.subClasses.iterator(); subClasses.hasNext(); ) {
      CoreAttributeGroup subClass=subClasses.next();
      if (group.getType().isAssignableFrom(subClass.getType())) {
        group.subClasses.add(subClass);
        subClass.superClassGroup=group;
        subClasses.remove();
      }
    }
  }
 else {
    this.subClasses=new HashSet<CoreAttributeGroup>();
  }
  this.subClasses.add(group);
}

Fixed version (ground truth):
/** 
 * INTERNAL: This method will insert the group into the entity hierarchy just below this AttributeGroup.
 * @param group
 */
public void insertSubClass(CoreAttributeGroup group){
  if (this == group) {
    return;
  }
  group.superClassGroup=this;
  if (subClasses != null) {
    for (Iterator<CoreAttributeGroup> subClasses=this.subClasses.iterator(); subClasses.hasNext(); ) {
      CoreAttributeGroup subClass=subClasses.next();
      if (group != subClass && group.getType().isAssignableFrom(subClass.getType())) {
        group.subClasses.add(subClass);
        subClass.superClassGroup=group;
        subClasses.remove();
      }
    }
  }
 else {
    this.subClasses=new HashSet<CoreAttributeGroup>();
  }
  this.subClasses.add(group);
}
Program: 64099
Project: 64099
Buggy source:
/** 
 * INTERNAL: Convert all the class-name-based settings in this Descriptor to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes.
 * @param classLoader 
 */
public void convertClassNamesToClasses(ClassLoader classLoader){
  Map<Object,ATTRIBUTE_GROUP> newMap=new HashMap<Object,ATTRIBUTE_GROUP>();
  if (this.subGroups != null) {
    for (    ATTRIBUTE_GROUP entry : this.subGroups.values()) {
      entry.convertClassNamesToClasses(classLoader);
      newMap.put(entry.getType(),entry);
      entry.setAllSubclasses(newMap);
    }
  }
  this.subGroups=newMap;
  newMap=new HashMap<Object,ATTRIBUTE_GROUP>();
  if (this.keyGroups != null) {
    for (    ATTRIBUTE_GROUP entry : this.keyGroups.values()) {
      entry.convertClassNamesToClasses(classLoader);
      newMap.put(entry.getType(),entry);
      entry.setAllSubclasses(newMap);
    }
  }
  this.keyGroups=newMap;
  for (  ATTRIBUTE_GROUP group : this.subGroups.values()) {
    if (orderInheritance(group,this.subGroups)) {
      group.insertSubClass(this.group);
      this.group=group;
    }
  }
  for (  ATTRIBUTE_GROUP group : this.keyGroups.values()) {
    if (orderInheritance(group,this.keyGroups)) {
      group.insertSubClass(this.keyGroup);
      this.keyGroup=group;
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Convert all the class-name-based settings in this Descriptor to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes.
 * @param classLoader 
 */
public void convertClassNamesToClasses(ClassLoader classLoader){
  Map<Object,ATTRIBUTE_GROUP> newMap=new HashMap<Object,ATTRIBUTE_GROUP>();
  if (this.subGroups != null) {
    for (    ATTRIBUTE_GROUP entry : this.subGroups.values()) {
      entry.convertClassNamesToClasses(classLoader);
      if (!(entry.getSubClassGroups().isEmpty())) {
        newMap.putAll(entry.getSubClassGroups());
      }
      newMap.put(entry.getType(),entry);
      entry.setAllSubclasses(newMap);
    }
  }
  this.subGroups=newMap;
  newMap=new HashMap<Object,ATTRIBUTE_GROUP>();
  if (this.keyGroups != null) {
    for (    ATTRIBUTE_GROUP entry : this.keyGroups.values()) {
      entry.convertClassNamesToClasses(classLoader);
      newMap.put(entry.getType(),entry);
      entry.setAllSubclasses(newMap);
    }
  }
  this.keyGroups=newMap;
  for (  ATTRIBUTE_GROUP group : this.subGroups.values()) {
    if (orderInheritance(group,this.subGroups)) {
      group.insertSubClass(this.group);
      this.group=group;
    }
  }
  for (  ATTRIBUTE_GROUP group : this.keyGroups.values()) {
    if (orderInheritance(group,this.keyGroups)) {
      group.insertSubClass(this.keyGroup);
      this.keyGroup=group;
    }
  }
}
Program: 64102
Project: 64102
Buggy source:
/** 
 * Truncate any trailing zeros from the millisecond portion of a given string. The string is assumed to be in dateTime or time format, as returned by XMLGregorianCalendar.toXMLFormat().
 * @param xmlFormat
 * @return
 */
private String truncateMillis(String xmlFormat){
  String result=xmlFormat;
  int dotIdx=xmlFormat.indexOf('.');
  if (dotIdx > 0) {
    String pre=xmlFormat.substring(0,dotIdx);
    String post=Constants.EMPTY_STRING;
    if (xmlFormat.length() > (dotIdx + 4)) {
      post=xmlFormat.substring(dotIdx + 4,xmlFormat.length());
    }
    String milliStr=xmlFormat.substring(dotIdx + 1,dotIdx + 4);
    char[] numbChar=new char[milliStr.length()];
    milliStr.getChars(0,milliStr.length(),numbChar,0);
    int truncIndex=2;
    while (truncIndex >= 1 && numbChar[truncIndex] == '0') {
      truncIndex--;
    }
    milliStr=new String(numbChar,0,truncIndex + 1);
    if (milliStr.length() > 0) {
      milliStr='.' + milliStr;
      result=pre + milliStr + post;
    }
 else {
      result=pre + post;
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Truncate any trailing zeros from the millisecond portion of a given string. The string is assumed to be in dateTime or time format, as returned by XMLGregorianCalendar.toXMLFormat().
 * @param xmlFormat
 * @return
 */
private String truncateMillis(String xmlFormat){
  String result=xmlFormat;
  int dotIdx=xmlFormat.indexOf('.');
  if (dotIdx > 0) {
    String pre=xmlFormat.substring(0,dotIdx);
    String post=Constants.EMPTY_STRING;
    if (xmlFormat.length() > (dotIdx + 4)) {
      post=xmlFormat.substring(dotIdx + 4,xmlFormat.length());
    }
    String milliStr=xmlFormat.substring(dotIdx + 1,dotIdx + 4);
    char[] numbChar=new char[milliStr.length()];
    milliStr.getChars(0,milliStr.length(),numbChar,0);
    int truncIndex=2;
    while (truncIndex >= 1 && numbChar[truncIndex] == '0') {
      truncIndex--;
    }
    milliStr=new String(numbChar,0,truncIndex + 1);
    if (milliStr.length() > 0 && !"String_Node_Str".equals(milliStr)) {
      milliStr='.' + milliStr;
      result=pre + milliStr + post;
    }
 else {
      result=pre + post;
    }
  }
  return result;
}
Program: 64105
Project: 64105
Buggy source:
private void addReferencedElement(Property property,ElementDeclaration referencedElement,Set<QName> referenceQNames,String typeName,String className){
  boolean canAdd=referenceQNames.add(referencedElement.getElementName());
  if (!canAdd && !(JAVAX_XML_BIND_JAXBELEMENT.equals(typeName))) {
    throw org.eclipse.persistence.exceptions.JAXBException.multipleXmlElementRef(typeName,className);
  }
  property.addReferencedElement(referencedElement);
  if (referencedElement.getSubstitutableElements() != null && referencedElement.getSubstitutableElements().size() > 0) {
    for (    ElementDeclaration substitutable : referencedElement.getSubstitutableElements()) {
      if (substitutable != referencedElement) {
        addReferencedElement(property,substitutable,referenceQNames,typeName,className);
      }
    }
  }
}

Fixed version (ground truth):
private void addReferencedElement(Property property,ElementDeclaration referencedElement){
  property.addReferencedElement(referencedElement);
  if (referencedElement.getSubstitutableElements() != null && referencedElement.getSubstitutableElements().size() > 0) {
    for (    ElementDeclaration substitutable : referencedElement.getSubstitutableElements()) {
      if (substitutable != referencedElement) {
        addReferencedElement(property,substitutable);
      }
    }
  }
}
Program: 64108
Project: 64108
Buggy source:
/** 
 * Add an element to the list of elements which can be substituted for this element (ie: has this element in their substitutionGroup)
 */
public void addSubstitutableElement(ElementDeclaration element){
  if (element != this) {
    this.substitutableElements.add(element);
  }
}

Fixed version (ground truth):
/** 
 * Add an element to the list of elements which can be substituted for this element (ie: has this element in their substitutionGroup)
 */
public void addSubstitutableElement(ElementDeclaration element){
  if (element != this && element != null) {
    QName elementName=element.getElementName();
    for (    ElementDeclaration substitutableElement : substitutableElements) {
      if (substitutableElement.getElementName().equals(elementName)) {
        return;
      }
    }
    this.substitutableElements.add(element);
  }
}
Program: 64110
Project: 64110
Buggy source:
protected Response getDescriptorMetadata(String version,String persistenceUnit,String descriptorAlias,HttpHeaders hh,URI baseURI){
  PersistenceContext app=getPersistenceContext(persistenceUnit,baseURI,version,null);
  if (app == null) {
    JPARSLogger.fine("String_Node_Str",new Object[]{persistenceUnit});
    return Response.status(Status.NOT_FOUND).type(StreamingOutputMarshaller.getResponseMediaType(hh)).build();
  }
 else {
    ClassDescriptor descriptor=app.getJpaSession().getDescriptorForAlias(descriptorAlias);
    if (descriptor == null) {
      JPARSLogger.fine("String_Node_Str",new Object[]{descriptorAlias,persistenceUnit});
      return Response.status(Status.NOT_FOUND).type(StreamingOutputMarshaller.getResponseMediaType(hh)).build();
    }
 else {
      String mediaType=StreamingOutputMarshaller.mediaType(hh.getAcceptableMediaTypes()).toString();
      Descriptor returnDescriptor=buildDescriptor(app,persistenceUnit,descriptor,baseURI.toString());
      String result=null;
      try {
        result=marshallMetadata(returnDescriptor,mediaType);
      }
 catch (      JAXBException e) {
        JPARSLogger.fine("String_Node_Str",new Object[]{descriptorAlias,persistenceUnit,e.toString()});
        return Response.status(Status.INTERNAL_SERVER_ERROR).type(StreamingOutputMarshaller.getResponseMediaType(hh)).build();
      }
      return Response.ok(new StreamingOutputMarshaller(null,result,hh.getAcceptableMediaTypes())).build();
    }
  }
}

Fixed version (ground truth):
protected Response getDescriptorMetadata(String version,String persistenceUnit,String descriptorAlias,HttpHeaders hh,URI baseURI){
  PersistenceContext app=getPersistenceContext(persistenceUnit,baseURI,version,null);
  if (app == null) {
    JPARSLogger.fine("String_Node_Str",new Object[]{persistenceUnit});
    return Response.status(Status.NOT_FOUND).type(StreamingOutputMarshaller.getResponseMediaType(hh)).build();
  }
 else {
    ClassDescriptor descriptor=app.getJpaSession().getDescriptorForAlias(descriptorAlias);
    if (descriptor == null) {
      JPARSLogger.fine("String_Node_Str",new Object[]{descriptorAlias,persistenceUnit});
      return Response.status(Status.NOT_FOUND).type(StreamingOutputMarshaller.getResponseMediaType(hh)).build();
    }
 else {
      String mediaType=StreamingOutputMarshaller.mediaType(hh.getAcceptableMediaTypes()).toString();
      Descriptor returnDescriptor=buildDescriptor(app,persistenceUnit,descriptor,baseURI.toString(),version);
      String result=null;
      try {
        result=marshallMetadata(returnDescriptor,mediaType);
      }
 catch (      JAXBException e) {
        JPARSLogger.fine("String_Node_Str",new Object[]{descriptorAlias,persistenceUnit,e.toString()});
        return Response.status(Status.INTERNAL_SERVER_ERROR).type(StreamingOutputMarshaller.getResponseMediaType(hh)).build();
      }
      return Response.ok(new StreamingOutputMarshaller(null,result,hh.getAcceptableMediaTypes())).build();
    }
  }
}
Program: 64113
Project: 64113
Buggy source:
public void endDocument(){
  try {
    if (isStartElementOpen) {
      openAndCloseStartElement();
      isStartElementOpen=false;
    }
    xmlEventWriter.add(xmlEventFactory.createEndDocument());
  }
 catch (  Exception e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
public void endDocument(){
  try {
    if (isStartElementOpen) {
      openAndCloseStartElement();
      isStartElementOpen=false;
    }
    xmlEventWriter.add(xmlEventFactory.createEndDocument());
    xmlEventWriter.flush();
  }
 catch (  Exception e) {
    throw XMLMarshalException.marshalException(e);
  }
}
Program: 64114
Project: 64114
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  String contextPath="String_Node_Str";
  System.setProperty("String_Node_Str",contextPath);
  String platform=System.getProperty("String_Node_Str");
  boolean jaxpPlatform=true;
  suite.addTestSuite(MarshallerTestCases.class);
  suite.addTestSuite(UnmarshallerTestCases.class);
  if (!jaxpPlatform) {
    suite.addTestSuite(ValidatorTestCases.class);
  }
  suite.addTestSuite(UnmarshallValidationTestCases.class);
  suite.addTestSuite(MarshallerPropertiesTestCases.class);
  suite.addTestSuite(CharacterEscapeHandlerTestCases.class);
  suite.addTestSuite(MarshallerFormattingTestCases.class);
  suite.addTest(MarshallerEncodingTestCases.suite());
  suite.addTestSuite(MarshallerFragmentTestCases.class);
  suite.addTestSuite(XMLDeclarationTestCases.class);
  suite.addTestSuite(NonELCharacterEscapeHandlerTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  String contextPath="String_Node_Str";
  System.setProperty("String_Node_Str",contextPath);
  String platform=System.getProperty("String_Node_Str");
  boolean jaxpPlatform=true;
  suite.addTestSuite(MarshallerTestCases.class);
  suite.addTestSuite(UnmarshallerTestCases.class);
  if (!jaxpPlatform) {
    suite.addTestSuite(ValidatorTestCases.class);
  }
  suite.addTestSuite(UnmarshallValidationTestCases.class);
  suite.addTestSuite(MarshallerPropertiesTestCases.class);
  suite.addTestSuite(CharacterEscapeHandlerTestCases.class);
  suite.addTestSuite(MarshallerFormattingTestCases.class);
  suite.addTest(MarshallerEncodingTestCases.suite());
  suite.addTestSuite(MarshallerFragmentTestCases.class);
  suite.addTestSuite(XMLDeclarationTestCases.class);
  suite.addTestSuite(NonELCharacterEscapeHandlerTestCases.class);
  suite.addTestSuite(FlushTestCases.class);
  return suite;
}
Program: 64115
Project: 64115
Buggy source:
/** 
 * Copy constructor
 */
protected XMLMarshaller(XMLMarshaller xmlMarshaller){
  super(xmlMarshaller);
  attachmentMarshaller=xmlMarshaller.getAttachmentMarshaller();
  attributePrefix=xmlMarshaller.getAttributePrefix();
  fragment=xmlMarshaller.isFragment();
  includeRoot=xmlMarshaller.isIncludeRoot();
  marshalEmptyCollections=xmlMarshaller.isMarshalEmptyCollections();
  mediaType=(MEDIA_TYPE)xmlMarshaller.getMediaType();
  namespaceSeparator=xmlMarshaller.getNamespaceSeparator();
  noNamespaceSchemaLocation=xmlMarshaller.getNoNamespaceSchemaLocation();
  reduceAnyArrays=xmlMarshaller.isReduceAnyArrays();
  if (null != xmlMarshaller.getSchema()) {
    setSchema(xmlMarshaller.getSchema());
  }
  schemaLocation=xmlMarshaller.getSchemaLocation();
  valueWrapper=xmlMarshaller.getValueWrapper();
  xmlHeader=xmlMarshaller.getXmlHeader();
}

Fixed version (ground truth):
/** 
 * Copy constructor
 */
protected XMLMarshaller(XMLMarshaller xmlMarshaller){
  super(xmlMarshaller);
  attachmentMarshaller=xmlMarshaller.getAttachmentMarshaller();
  attributePrefix=xmlMarshaller.getAttributePrefix();
  fragment=xmlMarshaller.isFragment();
  includeRoot=xmlMarshaller.isIncludeRoot();
  marshalEmptyCollections=xmlMarshaller.isMarshalEmptyCollections();
  mediaType=(MEDIA_TYPE)xmlMarshaller.getMediaType();
  namespaceSeparator=xmlMarshaller.getNamespaceSeparator();
  noNamespaceSchemaLocation=xmlMarshaller.getNoNamespaceSchemaLocation();
  reduceAnyArrays=xmlMarshaller.isReduceAnyArrays();
  if (null != xmlMarshaller.getSchema()) {
    setSchema(xmlMarshaller.getSchema());
  }
  schemaLocation=xmlMarshaller.getSchemaLocation();
  valueWrapper=xmlMarshaller.getValueWrapper();
  wrapperAsCollectionName=xmlMarshaller.isWrapperAsCollectionName();
  xmlHeader=xmlMarshaller.getXmlHeader();
}
Program: 64118
Project: 64118
Buggy source:
/** 
 * Handle marshal of an empty collection.  
 * @param xPathFragment
 * @param namespaceResolver
 * @param openGrouping if grouping elements should be marshalled for empty collections
 * @return
 */
public boolean emptyCollection(XPathFragment xPathFragment,NamespaceResolver namespaceResolver,boolean openGrouping){
  if (marshaller.isMarshalEmptyCollections()) {
    super.emptyCollection(xPathFragment,namespaceResolver,true);
    startCollection();
    if (xPathFragment != null && !xPathFragment.isSelfFragment()) {
      openStartElement(xPathFragment,namespaceResolver);
      if (!levels.isEmpty()) {
        Level position=levels.peek();
        position.setNeedToCloseComplex(false);
        position.setNeedToOpenComplex(false);
      }
      endElement(xPathFragment,namespaceResolver);
    }
    endEmptyCollection();
    return true;
  }
 else {
    return super.emptyCollection(xPathFragment,namespaceResolver,openGrouping);
  }
}

Fixed version (ground truth):
/** 
 * Handle marshal of an empty collection.  
 * @param xPathFragment
 * @param namespaceResolver
 * @param openGrouping if grouping elements should be marshalled for empty collections
 * @return
 */
public boolean emptyCollection(XPathFragment xPathFragment,NamespaceResolver namespaceResolver,boolean openGrouping){
  if (marshaller.isMarshalEmptyCollections()) {
    super.emptyCollection(xPathFragment,namespaceResolver,true);
    if (null != xPathFragment) {
      startCollection();
      if (!xPathFragment.isSelfFragment()) {
        openStartElement(xPathFragment,namespaceResolver);
        if (!levels.isEmpty()) {
          Level position=levels.peek();
          position.setNeedToCloseComplex(false);
          position.setNeedToOpenComplex(false);
        }
        endElement(xPathFragment,namespaceResolver);
      }
      endEmptyCollection();
    }
    return true;
  }
 else {
    return super.emptyCollection(xPathFragment,namespaceResolver,openGrouping);
  }
}
Program: 64122
Project: 64122
Buggy source:
private void addReferencedElement(Property property,ElementDeclaration referencedElement){
  property.addReferencedElement(referencedElement);
  if (referencedElement.getSubstitutableElements() != null && referencedElement.getSubstitutableElements().size() > 0) {
    for (    ElementDeclaration substitutable : referencedElement.getSubstitutableElements()) {
      if (substitutable != referencedElement) {
        addReferencedElement(property,substitutable);
      }
    }
  }
}

Fixed version (ground truth):
private void addReferencedElement(Property property,ElementDeclaration referencedElement,Set<QName> referenceQNames,String typeName,String className){
  boolean canAdd=referenceQNames.add(referencedElement.getElementName());
  if (!canAdd && !(JAVAX_XML_BIND_JAXBELEMENT.equals(typeName))) {
    throw org.eclipse.persistence.exceptions.JAXBException.multipleXmlElementRef(typeName,className);
  }
  property.addReferencedElement(referencedElement);
  if (referencedElement.getSubstitutableElements() != null && referencedElement.getSubstitutableElements().size() > 0) {
    for (    ElementDeclaration substitutable : referencedElement.getSubstitutableElements()) {
      if (substitutable != referencedElement) {
        addReferencedElement(property,substitutable,referenceQNames,typeName,className);
      }
    }
  }
}
Program: 64127
Project: 64127
Buggy source:
/** 
 * Returns this <code>JavaMethod's</code> return type.
 * @return a <code>JavaClass</code> representing the return type of this method.
 */
@SuppressWarnings("String_Node_Str") public JavaClass getReturnType(){
  JType type=xjcMethod.type();
  try {
    Field argsField=PrivilegedAccessHelper.getDeclaredField(type.getClass(),"String_Node_Str",true);
    List<JClass> args=(List<JClass>)PrivilegedAccessHelper.getValueFromField(argsField,type);
    type=args.get(0);
  }
 catch (  Exception e) {
  }
  if (((XJCJavaClassImpl)getOwningClass()).getJavaModel() != null) {
    return ((XJCJavaClassImpl)getOwningClass()).getJavaModel().getClass(type.fullName());
  }
  try {
    return new XJCJavaClassImpl(jCodeModel._class(type.fullName()),jCodeModel,dynamicClassLoader);
  }
 catch (  JClassAlreadyExistsException ex) {
    return new XJCJavaClassImpl(jCodeModel._getClass(type.fullName()),jCodeModel,dynamicClassLoader);
  }
}

Fixed version (ground truth):
/** 
 * Returns this <code>JavaMethod's</code> return type.
 * @return a <code>JavaClass</code> representing the return type of this method.
 */
@SuppressWarnings("String_Node_Str") public JavaClass getReturnType(){
  JType type=xjcMethod.type();
  JavaClass returnClass=null;
  JClass arg=null;
  try {
    Field argsField=PrivilegedAccessHelper.getDeclaredField(type.getClass(),"String_Node_Str",true);
    List<JClass> args=(List<JClass>)PrivilegedAccessHelper.getValueFromField(argsField,type);
    arg=args.get(0);
  }
 catch (  Exception e) {
  }
  if (((XJCJavaClassImpl)getOwningClass()).getJavaModel() != null) {
    returnClass=((XJCJavaClassImpl)getOwningClass()).getJavaModel().getClass(type.fullName());
  }
 else {
    try {
      returnClass=new XJCJavaClassImpl(jCodeModel._class(type.fullName()),jCodeModel,dynamicClassLoader);
    }
 catch (    JClassAlreadyExistsException ex) {
      returnClass=new XJCJavaClassImpl(jCodeModel._getClass(type.fullName()),jCodeModel,dynamicClassLoader);
    }
  }
  if (arg != null) {
    JavaClass argClass=((XJCJavaClassImpl)getOwningClass()).getJavaModel().getClass(arg.fullName());
    ((XJCJavaClassImpl)returnClass).setActualTypeArgument(argClass);
  }
  return returnClass;
}
Program: 64130
Project: 64130
Buggy source:
/** 
 * The setup is done as a test, both to record its failure, and to allow execution in the server.
 */
public void testSetup(){
  EntityManager em=createEntityManager(DDL_PU);
  DatabaseSessionImpl session=this.getDatabaseSession(DDL_PU);
  TableCreator defaultTableCreator=new DefaultTableGenerator(session.getProject(),true).generateDefaultTableCreator();
  defaultTableCreator.setIgnoreDatabaseException(true);
  defaultTableCreator.dropTables(session);
  Exception exception=null;
  try {
    em.createQuery("String_Node_Str").getResultList();
  }
 catch (  DatabaseException caught) {
    exception=caught;
  }
  this.assertNotNull("String_Node_Str",exception);
  TableCreator tbCreator=new EmptyTableCreator();
  tbCreator.createTables(session);
  Map properties=new HashMap();
  properties.put(PersistenceUnitProperties.DDL_GENERATION,PersistenceUnitProperties.CREATE_OR_EXTEND);
  properties.put(PersistenceUnitProperties.DDL_GENERATION_MODE,PersistenceUnitProperties.DDL_DATABASE_GENERATION);
  properties.put(PersistenceUnitProperties.DEPLOY_ON_STARTUP,"String_Node_Str");
  beginTransaction(em);
  JpaHelper.getEntityManagerFactory(em).refreshMetadata(properties);
  commitTransaction(em);
  closeEntityManager(em);
  clearCache(DDL_PU);
}

Fixed version (ground truth):
/** 
 * The setup is done as a test, both to record its failure, and to allow execution in the server.
 */
public void testSetup(){
  EntityManager em=createEntityManager(DDL_PU);
  DatabaseSessionImpl session=this.getDatabaseSession(DDL_PU);
  TableCreator defaultTableCreator=new DefaultTableGenerator(session.getProject(),true).generateDefaultTableCreator();
  defaultTableCreator.setIgnoreDatabaseException(true);
  defaultTableCreator.dropTables(session);
  Exception exception=null;
  try {
    em.createQuery("String_Node_Str").getResultList();
  }
 catch (  DatabaseException caught) {
    exception=caught;
  }
catch (  PersistenceException e) {
    exception=e;
  }
  this.assertNotNull("String_Node_Str",exception);
  TableCreator tbCreator=new EmptyTableCreator();
  tbCreator.createTables(session);
  Map properties=new HashMap();
  properties.put(PersistenceUnitProperties.DDL_GENERATION,PersistenceUnitProperties.CREATE_OR_EXTEND);
  properties.put(PersistenceUnitProperties.DDL_GENERATION_MODE,PersistenceUnitProperties.DDL_DATABASE_GENERATION);
  properties.put(PersistenceUnitProperties.DEPLOY_ON_STARTUP,"String_Node_Str");
  beginTransaction(em);
  JpaHelper.getEntityManagerFactory(em).refreshMetadata(properties);
  commitTransaction(em);
  closeEntityManager(em);
  clearCache(DDL_PU);
}
Program: 64131
Project: 64131
Buggy source:
/** 
 * INTERNAL: Stage 1 processing is a pre-processing stage that will perform the  following tasks: - gather a list of mapping accessors for all entities and embeddables. - discover all global converter specifications. - discover mapped superclasses and inheritance parents. NOTE: This method should only perform any preparatory work like, class discovery, flag settings etc. Hard processing will begin in stage 2.
 * @see processStage2
 */
public void processStage1(){
  for (  EntityAccessor entity : getEntityAccessors()) {
    if (!entity.isPreProcessed()) {
      entity.preProcess();
    }
  }
  for (  EmbeddableAccessor embeddable : getRootEmbeddableAccessors()) {
    if (!embeddable.isPreProcessed()) {
      embeddable.preProcess();
    }
  }
  for (  ConverterAccessor converterAccessor : getConverterAccessors().values()) {
    if (converterAccessor.autoApply()) {
      m_autoApplyConvertAccessors.put(converterAccessor.getAttributeClassification(),converterAccessor);
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Stage 1 processing is a pre-processing stage that will perform the  following tasks: - gather a list of mapping accessors for all entities and embeddables. - discover all global converter specifications. - discover mapped superclasses and inheritance parents. NOTE: This method should only perform any preparatory work like, class discovery, flag settings etc. Hard processing will begin in stage 2.
 * @see processStage2
 */
public void processStage1(){
  for (  EntityAccessor entity : getEntityAccessors()) {
    if (!entity.isPreProcessed()) {
      entity.preProcess();
    }
  }
  for (  EmbeddableAccessor embeddable : getRootEmbeddableAccessors()) {
    if (!embeddable.isPreProcessed()) {
      embeddable.preProcess();
    }
  }
  for (  ConverterAccessor converterAccessor : getConverterAccessors().values()) {
    if (converterAccessor.autoApply()) {
      m_autoApplyConvertAccessors.put(converterAccessor.getAttributeClassification(),converterAccessor);
    }
  }
  for (  EmbeddableAccessor embeddable : getEmbeddableAccessors()) {
    if (!embeddable.isPreProcessed()) {
      embeddable.preProcess();
    }
  }
}
Program: 64134
Project: 64134
Buggy source:
/** 
 * @return true indicating that <i>MOXyJsonProvider</i> willbe used for the JSON binding if the media type is of the following  patterns *&#47;json or *&#47;*+json, and the type is not assignable from  any of the the following: <ul> <li>byte[]</li> <li>java.io.File</li> <li>java.io.InputStream</li> <li>java.io.Reader</li> <li>java.lang.String</li> <li>javax.activation.DataSource</li> </ul>
 */
public boolean isReadable(Class<?> type,Type genericType,Annotation[] annotations,MediaType mediaType){
  if (!supportsMediaType(mediaType)) {
    return false;
  }
 else   if (CoreClassConstants.APBYTE == type || CoreClassConstants.STRING == type) {
    return false;
  }
 else   if (File.class.isAssignableFrom(type)) {
    return false;
  }
 else   if (DataSource.class.isAssignableFrom(type)) {
    return false;
  }
 else   if (InputStream.class.isAssignableFrom(type)) {
    return false;
  }
 else   if (Reader.class.isAssignableFrom(type)) {
    return false;
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
/** 
 * @return true indicating that <i>MOXyJsonProvider</i> willbe used for the JSON binding if the media type is of the following  patterns *&#47;json or *&#47;*+json, and the type is not assignable from  any of (or a Collection or JAXBElement of) the following: <ul> <li>byte[]</li> <li>java.io.File</li> <li>java.io.InputStream</li> <li>java.io.Reader</li> <li>java.lang.Object</li> <li>java.lang.String</li> <li>javax.activation.DataSource</li> </ul>
 */
public boolean isReadable(Class<?> type,Type genericType,Annotation[] annotations,MediaType mediaType){
  if (!supportsMediaType(mediaType)) {
    return false;
  }
 else   if (CoreClassConstants.APBYTE == type || CoreClassConstants.STRING == type) {
    return false;
  }
 else   if (File.class.isAssignableFrom(type)) {
    return false;
  }
 else   if (DataSource.class.isAssignableFrom(type)) {
    return false;
  }
 else   if (InputStream.class.isAssignableFrom(type)) {
    return false;
  }
 else   if (Reader.class.isAssignableFrom(type)) {
    return false;
  }
 else   if (Object.class == type) {
    return false;
  }
 else   if (JAXBElement.class.isAssignableFrom(type)) {
    return isReadable(getDomainClass(genericType),null,annotations,mediaType);
  }
 else   if (Collection.class.isAssignableFrom(type)) {
    return isReadable(getDomainClass(genericType),null,annotations,mediaType);
  }
 else {
    return true;
  }
}