nus-yam/ex-repair huggingface dataset:
Program: 67103
Project: 67103
Buggy source:
/** 
 * INTERNAL: Get the reference ID open content Property if it exists for this Type.
 * @return id Property or null
 */
private SDOProperty getIDProp(Type aType){
  return (SDOProperty)aType.getProperty((String)aType.get(SDOConstants.ID_PROPERTY));
}

Fixed version (ground truth):
/** 
 * INTERNAL: Get the reference ID open content Property if it exists for this Type.
 * @return id Property or null
 */
private SDOProperty getIDProp(Type aType){
  return (SDOProperty)aType.getProperty((String)((SDOType)aType).get(SDOConstants.ID_PROPERTY));
}
Program: 67104
Project: 67104
Buggy source:
protected void updateNamespaces(QName qname,MarshalRecord marshalRecord,XMLField xmlField){
  if (qname != null) {
    if (xmlField != null) {
      if (xmlField.isTypedTextField()) {
        if (xmlField.getSchemaType() == null) {
          if (qname.equals(XMLConstants.STRING_QNAME)) {
            return;
          }
        }
 else {
          if (xmlField.isSchemaType(qname)) {
            return;
          }
        }
      }
 else {
        return;
      }
    }
    String prefix=marshalRecord.getNamespaceResolver().resolveNamespaceURI(qname.getNamespaceURI());
    if ((prefix == null) || prefix.equals("String_Node_Str")) {
      if (XMLConstants.SCHEMA_URL.equals(qname.getNamespaceURI())) {
        prefix=marshalRecord.getNamespaceResolver().generatePrefix(XMLConstants.SCHEMA_PREFIX);
      }
 else {
        prefix=marshalRecord.getNamespaceResolver().generatePrefix();
      }
      marshalRecord.attribute(XMLConstants.XMLNS_URL,prefix,XMLConstants.XMLNS + "String_Node_Str" + prefix,qname.getNamespaceURI());
    }
    String typeValue=prefix + "String_Node_Str" + qname.getLocalPart();
    addTypeAttribute(marshalRecord,typeValue);
  }
}

Fixed version (ground truth):
protected void updateNamespaces(QName qname,MarshalRecord marshalRecord,XMLField xmlField){
  if (qname != null) {
    if (xmlField != null) {
      if (xmlField.isTypedTextField()) {
        if (xmlField.getSchemaType() == null) {
          if (qname.equals(XMLConstants.STRING_QNAME)) {
            return;
          }
        }
 else {
          if (xmlField.isSchemaType(qname)) {
            return;
          }
        }
      }
 else {
        return;
      }
    }
    String prefix=marshalRecord.getNamespaceResolver().resolveNamespaceURI(qname.getNamespaceURI());
    if ((prefix == null) || prefix.length() == 0) {
      if (XMLConstants.SCHEMA_URL.equals(qname.getNamespaceURI())) {
        prefix=marshalRecord.getNamespaceResolver().generatePrefix(XMLConstants.SCHEMA_PREFIX);
      }
 else {
        prefix=marshalRecord.getNamespaceResolver().generatePrefix();
      }
      marshalRecord.attribute(XMLConstants.XMLNS_URL,prefix,XMLConstants.XMLNS + XMLConstants.COLON + prefix,qname.getNamespaceURI());
    }
    String typeValue=prefix + XMLConstants.COLON + qname.getLocalPart();
    addTypeAttribute(marshalRecord,typeValue);
  }
}
Program: 67105
Project: 67105
Buggy source:
protected void addTypeAttribute(MarshalRecord marshalRecord,String typeValue){
  String xsiPrefix=null;
  if (marshalRecord.getNamespaceResolver() != null) {
    xsiPrefix=marshalRecord.getNamespaceResolver().resolveNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL);
  }
 else {
    xsiPrefix=XMLConstants.SCHEMA_INSTANCE_PREFIX;
    marshalRecord.attribute(XMLConstants.XMLNS_URL,xsiPrefix,XMLConstants.XMLNS + "String_Node_Str" + xsiPrefix,XMLConstants.SCHEMA_INSTANCE_URL);
  }
  if (xsiPrefix == null) {
    xsiPrefix=marshalRecord.getNamespaceResolver().generatePrefix(XMLConstants.SCHEMA_INSTANCE_PREFIX);
    marshalRecord.attribute(XMLConstants.XMLNS_URL,xsiPrefix,XMLConstants.XMLNS + "String_Node_Str" + xsiPrefix,XMLConstants.SCHEMA_INSTANCE_URL);
  }
  marshalRecord.attribute(XMLConstants.SCHEMA_INSTANCE_URL,XMLConstants.SCHEMA_TYPE_ATTRIBUTE,xsiPrefix + "String_Node_Str" + XMLConstants.SCHEMA_TYPE_ATTRIBUTE,typeValue);
}

Fixed version (ground truth):
protected void addTypeAttribute(MarshalRecord marshalRecord,String typeValue){
  String xsiPrefix=null;
  if (marshalRecord.getNamespaceResolver() != null) {
    xsiPrefix=marshalRecord.getNamespaceResolver().resolveNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL);
  }
 else {
    xsiPrefix=XMLConstants.SCHEMA_INSTANCE_PREFIX;
    marshalRecord.attribute(XMLConstants.XMLNS_URL,xsiPrefix,XMLConstants.XMLNS + XMLConstants.COLON + xsiPrefix,XMLConstants.SCHEMA_INSTANCE_URL);
  }
  if (xsiPrefix == null) {
    xsiPrefix=marshalRecord.getNamespaceResolver().generatePrefix(XMLConstants.SCHEMA_INSTANCE_PREFIX);
    marshalRecord.attribute(XMLConstants.XMLNS_URL,xsiPrefix,XMLConstants.XMLNS + XMLConstants.COLON + xsiPrefix,XMLConstants.SCHEMA_INSTANCE_URL);
  }
  marshalRecord.attribute(XMLConstants.SCHEMA_INSTANCE_URL,XMLConstants.SCHEMA_TYPE_ATTRIBUTE,xsiPrefix + XMLConstants.COLON + XMLConstants.SCHEMA_TYPE_ATTRIBUTE,typeValue);
}
Program: 67106
Project: 67106
Buggy source:
protected String getStringForQName(QName qName,NamespaceResolver namespaceResolver){
  if (null == qName) {
    return null;
  }
  if (null == qName.getNamespaceURI()) {
    return qName.getLocalPart();
  }
 else {
    String namespaceURI=qName.getNamespaceURI();
    if (namespaceResolver == null) {
      throw XMLMarshalException.namespaceResolverNotSpecified(namespaceURI);
    }
    String prefix=namespaceResolver.resolveNamespaceURI(namespaceURI);
    if (null == prefix) {
      return qName.getLocalPart();
    }
 else {
      return prefix + COLON + qName.getLocalPart();
    }
  }
}

Fixed version (ground truth):
protected String getStringForQName(QName qName,NamespaceResolver namespaceResolver){
  if (null == qName) {
    return null;
  }
  if (null == qName.getNamespaceURI()) {
    return qName.getLocalPart();
  }
 else {
    String namespaceURI=qName.getNamespaceURI();
    if (namespaceResolver == null) {
      throw XMLMarshalException.namespaceResolverNotSpecified(namespaceURI);
    }
    String prefix=namespaceResolver.resolveNamespaceURI(namespaceURI);
    if (null == prefix) {
      return qName.getLocalPart();
    }
 else {
      return prefix + XMLConstants.COLON + qName.getLocalPart();
    }
  }
}
Program: 67112
Project: 67112
Buggy source:
public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  if (value != null) {
    String namespace=null;
    int colonIndex=value.indexOf(COLON);
    if (colonIndex > -1) {
      String prefix=value.substring(0,colonIndex);
      namespace=unmarshalRecord.resolveNamespacePrefix(prefix);
      value=value.substring(colonIndex + 1);
    }
    unmarshalRecord.setTypeQName(new QName(namespace,value));
  }
}

Fixed version (ground truth):
public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  if (value != null) {
    String namespace=null;
    int colonIndex=value.indexOf(XMLConstants.COLON);
    if (colonIndex > -1) {
      String prefix=value.substring(0,colonIndex);
      namespace=unmarshalRecord.resolveNamespacePrefix(prefix);
      value=value.substring(colonIndex + 1);
    }
    unmarshalRecord.setTypeQName(new QName(namespace,value));
  }
}
Program: 67113
Project: 67113
Buggy source:
private boolean sameNamespaceURI(Node node,String namespaceURI){
  String nodeNamespaceURI=node.getNamespaceURI();
  if (nodeNamespaceURI == namespaceURI) {
    return true;
  }
  if ((nodeNamespaceURI == null) && namespaceURI.equals("String_Node_Str")) {
    return true;
  }
  if ((namespaceURI == null) && nodeNamespaceURI.equals("String_Node_Str")) {
    return true;
  }
  return (null != nodeNamespaceURI) && nodeNamespaceURI.equals(namespaceURI);
}

Fixed version (ground truth):
private boolean sameNamespaceURI(Node node,String namespaceURI){
  String nodeNamespaceURI=node.getNamespaceURI();
  if (nodeNamespaceURI == namespaceURI) {
    return true;
  }
  if ((nodeNamespaceURI == null) && namespaceURI.length() == 0) {
    return true;
  }
  if ((namespaceURI == null) && nodeNamespaceURI.length() == 0) {
    return true;
  }
  return (null != nodeNamespaceURI) && nodeNamespaceURI.equals(namespaceURI);
}
Program: 67115
Project: 67115
Buggy source:
protected TestSuite getLOBOCITestSuite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  Object obj=getSession().getPlatform();
  suite.addTests(TestVariation.get(obj,str,new LOBTestWrapper(new LOBInsertTest(ImageSimulator.generateImage(240000,120000)),true)));
  return suite;
}

Fixed version (ground truth):
protected TestSuite getLOBOCITestSuite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  Object obj=getSession().getPlatform();
  suite.addTests(TestVariation.get(obj,str,new LOBTestWrapper(new LOBInsertTest(ImageSimulator.generateImage(240000,120000)),false)));
  return suite;
}
Program: 67116
Project: 67116
Buggy source:
public LOBTestWrapper(AutoVerifyTestCase test,boolean ociOnlyMode){
  super(test);
  this.ociOnlyMode=ociOnlyMode;
  setName(getName() + "String_Node_Str");
}

Fixed version (ground truth):
public LOBTestWrapper(AutoVerifyTestCase test,boolean shouldUseLocatorForLOBWrite){
  super(test);
  this.shouldUseLocatorForLOBWrite=shouldUseLocatorForLOBWrite;
  this.shouldSetUseLocatorForLOBWriteIntoPlatform=true;
  setName(getName() + "String_Node_Str" + (shouldUseLocatorForLOBWrite ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
}
Program: 67117
Project: 67117
Buggy source:
protected void setup() throws Throwable {
  if (!getSession().getPlatform().isOracle()) {
    throw new TestWarningException("String_Node_Str");
  }
  try {
    platform8=getOracle8Platform();
  }
 catch (  ClassCastException ex) {
    if (!ociOnlyMode) {
      DatabasePlatform platform=getSession().getPlatform();
      try {
        getSession().getLogin().usePlatform(new Oracle8Platform());
        getDatabaseSession().logout();
        getDatabaseSession().login();
        platform8=getOracle8Platform();
        platformOriginal=platform;
      }
 catch (      Exception ex2) {
        throw new TestWarningException("String_Node_Str");
      }
    }
  }
  if (platform8 != null) {
    shouldUseLocatorForLOBWriteOriginal=platform8.shouldUseLocatorForLOBWrite();
    shouldUseLocatorForLOBWrite=!ociOnlyMode;
    if (shouldUseLocatorForLOBWrite != shouldUseLocatorForLOBWriteOriginal) {
      platform8.setShouldUseLocatorForLOBWrite(shouldUseLocatorForLOBWrite);
    }
  }
  if (ociOnlyMode) {
    usesByteArrayBindingOriginal=getSession().getPlatform().usesByteArrayBinding();
    getSession().getPlatform().setUsesByteArrayBinding(true);
    usesStringBindingOriginal=getSession().getPlatform().usesStringBinding();
    getSession().getPlatform().setUsesStringBinding(true);
    usesStreamForBindingOriginal=getSession().getPlatform().usesStreamsForBinding();
    getSession().getPlatform().setUsesStreamsForBinding(true);
  }
  super.setup();
}

Fixed version (ground truth):
protected void setup() throws Throwable {
  DatabasePlatform platform=getSession().getPlatform();
  if (!platform.isOracle()) {
    throw new TestWarningException("String_Node_Str");
  }
  if (platform instanceof Oracle8Platform) {
    Oracle8Platform platform8=(Oracle8Platform)platform;
    shouldUseLocatorForLOBWriteOriginal=platform8.shouldUseLocatorForLOBWrite();
    if (shouldSetUseLocatorForLOBWriteIntoPlatform) {
      platform8.setShouldUseLocatorForLOBWrite(shouldUseLocatorForLOBWrite);
    }
 else {
      this.shouldUseLocatorForLOBWrite=shouldUseLocatorForLOBWriteOriginal;
    }
  }
 else {
    if (shouldSetUseLocatorForLOBWriteIntoPlatform && shouldUseLocatorForLOBWrite) {
      throw new TestProblemException("String_Node_Str");
    }
    this.shouldUseLocatorForLOBWrite=false;
  }
  if (!shouldUseLocatorForLOBWrite) {
    usesStringBindingOriginal=platform.usesStringBinding();
    platform.setUsesStringBinding(true);
  }
  super.setup();
}
Program: 67118
Project: 67118
Buggy source:
public void reset() throws Throwable {
  super.reset();
  if (ociOnlyMode) {
    getSession().getPlatform().setUsesByteArrayBinding(usesByteArrayBindingOriginal);
    getSession().getPlatform().setUsesStringBinding(usesStringBindingOriginal);
    getSession().getPlatform().setUsesStreamsForBinding(usesStreamForBindingOriginal);
  }
  if (platform8 != null) {
    if (shouldUseLocatorForLOBWrite != shouldUseLocatorForLOBWriteOriginal) {
      getOracle8Platform().setShouldUseLocatorForLOBWrite(shouldUseLocatorForLOBWriteOriginal);
    }
    if (platformOriginal != null) {
      getSession().getLogin().usePlatform(platformOriginal);
      getDatabaseSession().logout();
      getDatabaseSession().login();
      platformOriginal=null;
    }
    platform8=null;
  }
}

Fixed version (ground truth):
public void reset() throws Throwable {
  super.reset();
  DatabasePlatform platform=getSession().getPlatform();
  if (!shouldUseLocatorForLOBWrite) {
    platform.setUsesStringBinding(usesStringBindingOriginal);
  }
  if (platform instanceof Oracle8Platform) {
    Oracle8Platform platform8=(Oracle8Platform)platform;
    if (shouldSetUseLocatorForLOBWriteIntoPlatform) {
      platform8.setShouldUseLocatorForLOBWrite(shouldUseLocatorForLOBWriteOriginal);
    }
  }
}
Program: 67119
Project: 67119
Buggy source:
/** 
 * This is the default constructor for the class. Bug 2804663 - Each DatabaseAccessor will now hold on to its own instance of this class, hence a singleton pattern is not applicable.
 */
public LOBValueWriter(Accessor accessor){
  this.accessor=accessor;
}

Fixed version (ground truth):
/** 
 * This is the default constructor for the class. Bug 2804663 - Each DatabaseAccessor will now hold on to its own instance of this class, hence a singleton pattern is not applicable.
 */
public LOBValueWriter(Accessor accessor){
  this.accessor=accessor;
  DatabasePlatform platform=((DatabaseAccessor)accessor).getPlatform();
  this.isNativeConnectionRequired=platform.isOracle() && ((OraclePlatform)platform).isNativeConnectionRequiredForLobLocator();
}
Program: 67120
Project: 67120
Buggy source:
/** 
 * Build the sql call from the select statement for selecting the locator
 */
private DatabaseCall buildCallFromSelectStatementForLocator(SQLSelectStatement selectStatement,WriteObjectQuery writeQuery,DatabaseCall dbCall,AbstractSession session){
  DatabaseCall call=selectStatement.buildCall(session);
  call.setIsNativeConnectionRequired(true);
  call.setContexts(dbCall.getContexts());
  call.returnOneRow();
  call.setQuery(writeQuery);
  call.prepare(session);
  call.translate(writeQuery.getTranslationRow(),writeQuery.getModifyRow(),session);
  return call;
}

Fixed version (ground truth):
/** 
 * Build the sql call from the select statement for selecting the locator
 */
private DatabaseCall buildCallFromSelectStatementForLocator(SQLSelectStatement selectStatement,WriteObjectQuery writeQuery,DatabaseCall dbCall,AbstractSession session){
  DatabaseCall call=selectStatement.buildCall(session);
  call.setIsNativeConnectionRequired(this.isNativeConnectionRequired);
  call.setContexts(dbCall.getContexts());
  call.returnOneRow();
  call.setQuery(writeQuery);
  call.prepare(session);
  call.translate(writeQuery.getTranslationRow(),writeQuery.getModifyRow(),session);
  return call;
}
Program: 67121
Project: 67121
Buggy source:
/** 
 * INTERNAL: Invalid the cache, that is, those objects in the cache that were affected by the query.
 */
protected void invalidateCache(){
  org.eclipse.persistence.sessions.IdentityMapAccessor identityMapAccessor=getSession().getIdentityMapAccessor();
  if (getSelectionCriteria() == null) {
    if (getDescriptor().isChildDescriptor()) {
      Vector collectionToInvalidate=identityMapAccessor.getAllFromIdentityMap(null,getReferenceClass(),getTranslationRow(),null);
      identityMapAccessor.invalidateObjects(collectionToInvalidate);
    }
 else {
      identityMapAccessor.invalidateClass(getReferenceClass());
    }
  }
 else {
    boolean noObjectsModifiedInDb=result != null && result.intValue() == 0;
    try {
      int policy=InMemoryQueryIndirectionPolicy.SHOULD_IGNORE_EXCEPTION_RETURN_CONFORMED;
      if (noObjectsModifiedInDb) {
        policy=InMemoryQueryIndirectionPolicy.SHOULD_IGNORE_EXCEPTION_RETURN_NOT_CONFORMED;
      }
      Vector collectionToInvalidate=identityMapAccessor.getAllFromIdentityMap(getSelectionCriteria(),getReferenceClass(),getTranslationRow(),policy);
      identityMapAccessor.invalidateObjects(collectionToInvalidate);
    }
 catch (    QueryException ex) {
      if (ex.getErrorCode() == QueryException.CANNOT_CONFORM_EXPRESSION) {
        if (!noObjectsModifiedInDb) {
          identityMapAccessor.invalidateClass(getReferenceClass());
        }
      }
 else {
        throw ex;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Invalid the cache, that is, those objects in the cache that were affected by the query.
 */
protected void invalidateCache(){
  if (result != null && result.intValue() == 0) {
    return;
  }
  getSession().getIdentityMapAccessor().invalidateObjects(getSelectionCriteria(),getReferenceClass(),getTranslationRow(),true);
}
Program: 67122
Project: 67122
Buggy source:
/** 
 * ADVANCED: Sets all of the Objects matching the given Expression to be invalid in the cache. <p> <b>Example</b> - Invalidating Employee Objects with non-null first names:  <p>  <code> ExpressionBuilder eb = new ExpressionBuilder(Employee.class);    <br> Expression exp = eb.get("firstName").notNull();                  <br> session.getIdentityMapAccessor().invalidateObjects(exp);         <br>  </code>
 * @param selectionCriteria Expression
 */
public void invalidateObjects(Expression selectionCriteria);

Fixed version (ground truth):
/** 
 * ADVANCED: Queries the cache in-memory with the passed in criteria and invalidates matching Objects. If the expression is too complex either all or none object of theClass invalidated (depending on shouldInvalidateOnException value).
 * @param selectionCriteria Expression selecting the Objects to be returned
 * @param theClass Class to be considered
 * @param translationRow Record
 * @param shouldInvalidateOnException boolean indicates weather to invalidate the object if conform threw exception.
 */
public void invalidateObjects(Expression selectionCriteria,Class theClass,Record translationRow,boolean shouldInvalidateOnException);
Program: 67123
Project: 67123
Buggy source:
private void getModified(SDODataObject sdoDataObject,List modifiedList){
  if (null == sdoDataObject) {
    return;
  }
  if (isModified(sdoDataObject)) {
    modifiedList.add(sdoDataObject);
  }
  List<Property> properties=(List<Property>)sdoDataObject.getInstanceProperties();
  for (int x=0; x < properties.size(); x++) {
    Property property=properties.get(x);
    if (property.isContainment()) {
      if (property.isMany()) {
        List<SDODataObject> dataObjects=(List<SDODataObject>)sdoDataObject.getList(property);
        for (int y=0; y < dataObjects.size(); y++) {
          getModified(dataObjects.get(y),modifiedList);
        }
      }
 else {
        if ((property.getType() != null) && !(((SDOType)property.getType()).isChangeSummaryType())) {
          getModified((SDODataObject)sdoDataObject.getDataObject(property),modifiedList);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void getModified(SDODataObject sdoDataObject,List modifiedList){
  if (null == sdoDataObject) {
    return;
  }
  if (isModified(sdoDataObject)) {
    modifiedList.add(sdoDataObject);
  }
  List<Property> properties=(List<Property>)sdoDataObject.getInstanceProperties();
  for (int x=0; x < properties.size(); x++) {
    Property property=properties.get(x);
    if (property.isContainment()) {
      if (property.isMany()) {
        List<SDODataObject> dataObjects=(List<SDODataObject>)sdoDataObject.getList(property);
        for (int y=0; y < dataObjects.size(); y++) {
          getModified(dataObjects.get(y),modifiedList);
        }
      }
 else {
        if ((property.getType() != null) && !(((SDOType)property.getType()).isChangeSummaryType())) {
          getModified(sdoDataObject.getDataObject(property),modifiedList);
        }
      }
    }
  }
}
Program: 67124
Project: 67124
Buggy source:
/** 
 * Returns a   {@link ChangeSummary.Setting setting} for the specified propertyrepresenting the property value of the given <code>dataObject</code> at the point when logging  {@link #beginLogging() began}. <p>Returns null if the property was not modified and has not been   {@link #isDeleted(DataObject) deleted}.
 * @param dataObject the object in question.
 * @param property the property of the object.
 * @return the Setting for the specified property.
 * @see #getChangedDataObjects
 */
public ChangeSummary.Setting getOldValue(DataObject dataObject,Property property){
  if ((dataObject == null) || (!isDeleted(dataObject) && ((dataObject.getChangeSummary() != null) && (dataObject.getChangeSummary() != this)))) {
    return null;
  }
  if (!isCreated(dataObject) && isDirty(dataObject)) {
    return getOldValueForChangedDataObject(dataObject,(SDOProperty)property);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns a   {@link ChangeSummary.Setting setting} for the specified propertyrepresenting the property value of the given <code>dataObject</code> at the point when logging  {@link #beginLogging() began}. <p>Returns null if the property was not modified and has not been   {@link #isDeleted(DataObject) deleted}.
 * @param dataObject the object in question.
 * @param property the property of the object.
 * @return the Setting for the specified property.
 * @see #getChangedDataObjects
 */
public SDOChangeSummary.Setting getOldValue(DataObject dataObject,Property property){
  if ((dataObject == null) || (!isDeleted(dataObject) && ((dataObject.getChangeSummary() != null) && (dataObject.getChangeSummary() != this)))) {
    return null;
  }
  if (!isCreated(dataObject) && isDirty(dataObject)) {
    return getOldValueForChangedDataObject(dataObject,(SDOProperty)property);
  }
  return null;
}
Program: 67125
Project: 67125
Buggy source:
/** 
 * Returns the ChangeSummary root DataObject - the object from which changes are tracked. When a DataGraph is used, this is the same as getDataGraph().getRootObject().
 * @return the ChangeSummary root DataObject
 */
public DataObject getRootObject(){
  return rootDataObject;
}

Fixed version (ground truth):
/** 
 * Returns the ChangeSummary root DataObject - the object from which changes are tracked. When a DataGraph is used, this is the same as getDataGraph().getRootObject().
 * @return the ChangeSummary root DataObject
 */
public SDODataObject getRootObject(){
  return rootDataObject;
}
Program: 67127
Project: 67127
Buggy source:
/** 
 * Returns the   {@link Type type} with the given the {@link Type#getURI() URI}, or contained by the resource at the given URI, and with the given   {@link Type#getName name}.
 * @param uri the namespace URI of a type or the location URI of a resource containing a type.
 * @param typeName name of a type.
 * @return the type with the corresponding namespace and name.
 */
public Type getType(String uri,String typeName){
  return helperContext.getTypeHelper().getType(uri,typeName);
}

Fixed version (ground truth):
/** 
 * Returns the   {@link Type type} with the given the {@link Type#getURI() URI}, or contained by the resource at the given URI, and with the given   {@link Type#getName name}.
 * @param uri the namespace URI of a type or the location URI of a resource containing a type.
 * @param typeName name of a type.
 * @return the type with the corresponding namespace and name.
 */
public SDOType getType(String uri,String typeName){
  return (SDOType)helperContext.getTypeHelper().getType(uri,typeName);
}
Program: 67128
Project: 67128
Buggy source:
/** 
 * Creates a new root data object of the specified type. An exception is thrown if a root object exists.
 * @param type the type of the new root.
 * @return the new root.
 * @throws IllegalStateException if the root object already exists.
 * @see #createRootObject(String,String)
 */
public DataObject createRootObject(Type type){
  if (null != rootObject) {
    throw new IllegalStateException();
  }
  rootObject=(SDODataObject)helperContext.getDataFactory().create(type);
  rootObject.setDataGraph(this);
  rootObject._setChangeSummary(changeSummary);
  changeSummary.setRootDataObject(rootObject);
  return rootObject;
}

Fixed version (ground truth):
/** 
 * Creates a new root data object of the specified type. An exception is thrown if a root object exists.
 * @param type the type of the new root.
 * @return the new root.
 * @throws IllegalStateException if the root object already exists.
 * @see #createRootObject(String,String)
 */
public SDODataObject createRootObject(Type type){
  if (null != rootObject) {
    throw new IllegalStateException();
  }
  rootObject=(SDODataObject)helperContext.getDataFactory().create(type);
  rootObject.setDataGraph(this);
  rootObject._setChangeSummary(changeSummary);
  changeSummary.setRootDataObject(rootObject);
  return rootObject;
}
Program: 67129
Project: 67129
Buggy source:
/** 
 * Returns the root   {@link DataObject data object} of this data graph.
 * @return the root data object.
 * @see DataObject#getDataGraph
 */
public DataObject getRootObject(){
  return this.rootObject;
}

Fixed version (ground truth):
/** 
 * Returns the root   {@link DataObject data object} of this data graph.
 * @return the root data object.
 * @see DataObject#getDataGraph
 */
public SDODataObject getRootObject(){
  return this.rootObject;
}
Program: 67130
Project: 67130
Buggy source:
/** 
 * Returns the   {@link ChangeSummary change summary} associated with this data graph.
 * @return the change summary.
 * @see ChangeSummary#getDataGraph
 */
public ChangeSummary getChangeSummary(){
  return this.changeSummary;
}

Fixed version (ground truth):
/** 
 * Returns the   {@link ChangeSummary change summary} associated with this data graph.
 * @return the change summary.
 * @see ChangeSummary#getDataGraph
 */
public SDOChangeSummary getChangeSummary(){
  return this.changeSummary;
}
Program: 67131
Project: 67131
Buggy source:
public Map getAttributeChildrenMap(){
  return this.attributeChildrenMap;
}

Fixed version (ground truth):
public Map<XPathFragment,XPathNode> getAttributeChildrenMap(){
  return this.attributeChildrenMap;
}
Program: 67132
Project: 67132
Buggy source:
public Map getNonAttributeChildrenMap(){
  return this.nonAttributeChildrenMap;
}

Fixed version (ground truth):
public Map<XPathFragment,XPathNode> getNonAttributeChildrenMap(){
  return this.nonAttributeChildrenMap;
}
Program: 67133
Project: 67133
Buggy source:
/** 
 * INTERNAL: Returns a Vector of of Namespace objects in the current Namespace Resolver Used for deployment XML
 * @return  A Vector containing the namespace URIs in the namespace resolver
 */
public Vector getNamespaces(){
  Vector names=new Vector(namespaces.size());
  for (Enumeration sources=namespaces.keys(); sources.hasMoreElements(); ) {
    String prefix=(String)sources.nextElement();
    String URI=(String)namespaces.get(prefix);
    Namespace namespace=new Namespace(prefix,URI);
    names.addElement(namespace);
  }
  return names;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Returns a Vector of of Namespace objects in the current Namespace Resolver Used for deployment XML
 * @return  A Vector containing the namespace URIs in the namespace resolver
 */
public Vector getNamespaces(){
  Vector names=new Vector(prefixesToNamespaces.size());
  for (  Entry<String,String> entry : prefixesToNamespaces.entrySet()) {
    Namespace namespace=new Namespace(entry.getKey(),entry.getValue());
    names.addElement(namespace);
  }
  return names;
}
Program: 67134
Project: 67134
Buggy source:
public void removeNamespace(String prefix){
  namespaces.remove(prefix);
}

Fixed version (ground truth):
public void removeNamespace(String prefix){
  prefixesToNamespaces.remove(prefix);
}
Program: 67135
Project: 67135
Buggy source:
/** 
 * Adds a namespace to the collection of namespaces on the NamespaceResolver
 * @param prefix  The prefix for a namespace
 * @param namespaceURI  The namespace URI associated with the specified prefix
 */
public void put(String prefix,String namespaceURI){
  namespaces.setProperty(prefix,namespaceURI);
}

Fixed version (ground truth):
/** 
 * Adds a namespace to the collection of namespaces on the NamespaceResolver
 * @param prefix  The prefix for a namespace
 * @param namespaceURI  The namespace URI associated with the specified prefix
 */
public void put(String prefix,String namespaceURI){
  prefixesToNamespaces.put(prefix,namespaceURI.intern());
}
Program: 67136
Project: 67136
Buggy source:
/** 
 * Returns the namespace URI associated with a specified namespace prefix
 * @param prefix The prefix to lookup a namespace URI for
 * @return The namespace URI associated with the specified prefix
 */
public String resolveNamespacePrefix(String prefix){
  if (null == prefix) {
    return defaultNamespaceURI;
  }
  String uri=namespaces.getProperty(prefix);
  if ((uri == null) && prefix.equals(XMLConstants.XML_NAMESPACE_PREFIX)) {
    uri=XMLConstants.XML_NAMESPACE_URL;
  }
  return uri;
}

Fixed version (ground truth):
/** 
 * Returns the namespace URI associated with a specified namespace prefix
 * @param prefix The prefix to lookup a namespace URI for
 * @return The namespace URI associated with the specified prefix
 */
public String resolveNamespacePrefix(String prefix){
  if (null == prefix) {
    return defaultNamespaceURI;
  }
  String uri=prefixesToNamespaces.get(prefix);
  if (null != uri) {
    return uri;
  }
 else   if (XMLConstants.XML_NAMESPACE_PREFIX.equals(prefix)) {
    return XMLConstants.XML_NAMESPACE_URL;
  }
  return null;
}
Program: 67137
Project: 67137
Buggy source:
/** 
 * INTERNAL: Set the namespaces on the namespace resolver based on the specified Vector of Namespace objects Used for deployment XML
 * @param names A Vector of namespace URIs
 */
public void setNamespaces(Vector names){
  namespaces=new Properties();
  for (Enumeration sources=names.elements(); sources.hasMoreElements(); ) {
    Namespace namespace=(Namespace)sources.nextElement();
    if ((namespace.getPrefix() != null) && (namespace.getNamespaceURI() != null)) {
      namespaces.put(namespace.getPrefix(),namespace.getNamespaceURI());
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Set the namespaces on the namespace resolver based on the specified Vector of Namespace objects Used for deployment XML
 * @param names A Vector of namespace URIs
 */
public void setNamespaces(Vector names){
  prefixesToNamespaces=new HashMap<String,String>(names.size());
  for (  Namespace namespace : (Vector<Namespace>)names) {
    if ((namespace.getPrefix() != null) && (namespace.getNamespaceURI() != null)) {
      prefixesToNamespaces.put(namespace.getPrefix(),namespace.getNamespaceURI());
    }
  }
}
Program: 67138
Project: 67138
Buggy source:
/** 
 * Default constructor, creates a new NamespaceResolver.
 */
public NamespaceResolver(){
  super();
  namespaces=new Properties();
}

Fixed version (ground truth):
/** 
 * Default constructor, creates a new NamespaceResolver.
 */
public NamespaceResolver(){
  super();
  prefixesToNamespaces=new HashMap<String,String>();
}
Program: 67139
Project: 67139
Buggy source:
/** 
 * Returns the list of prefixes in the NamespaceResolver
 * @return An Enumeration containing the prefixes in the NamespaceResolver
 */
public Enumeration getPrefixes(){
  return namespaces.keys();
}

Fixed version (ground truth):
/** 
 * Returns the list of prefixes in the NamespaceResolver
 * @return An Enumeration containing the prefixes in the NamespaceResolver
 */
public Enumeration getPrefixes(){
  return new IteratorEnumeration(prefixesToNamespaces.keySet().iterator());
}
Program: 67140
Project: 67140
Buggy source:
/** 
 * This has the same effect as calling the setXPath method
 * @param xPath The xPath associated with this XMLField
 */
public void setName(String xPath){
  super.setName(xPath);
  if (hasPath(xPath)) {
    buildFragments(xPath);
  }
 else {
    XPathFragment xPathFragment=new XPathFragment(xPath);
    setXPathFragment(xPathFragment);
    setLastXPathFragment(xPathFragment);
  }
}

Fixed version (ground truth):
/** 
 * This has the same effect as calling the setXPath method
 * @param xPath The xPath associated with this XMLField
 */
public void setName(String xPath){
  super.setName(xPath);
  if (hasPath(xPath)) {
    buildFragments(xPath);
  }
 else {
    XPathFragment xPathFragment=new XPathFragment(xPath.intern());
    setXPathFragment(xPathFragment);
    setLastXPathFragment(xPathFragment);
  }
}
Program: 67141
Project: 67141
Buggy source:
private void buildFragments(String xpathString){
  StringTokenizer st=new StringTokenizer(xpathString,"String_Node_Str");
  String next;
  int i=0;
  XPathFragment currentXPathFragment=null;
  XPathFragment nextXPathFragment=null;
  if (xpathString.startsWith("String_Node_Str")) {
    next=st.nextToken();
    next="String_Node_Str" + next;
    currentXPathFragment=new XPathFragment(next);
    setXPathFragment(currentXPathFragment);
    i++;
  }
  while (st.hasMoreTokens()) {
    next=st.nextToken();
    if (null != next) {
      if (next.equals(XPathFragment.TEXT)) {
        nextXPathFragment=new XPathFragment(XPathFragment.TEXT);
      }
 else {
        nextXPathFragment=new XPathFragment(next);
      }
      if (0 == i) {
        setXPathFragment(nextXPathFragment);
      }
 else {
        currentXPathFragment.setNextFragment(nextXPathFragment);
        if (nextXPathFragment.isAttribute() || nextXPathFragment.nameIsText()) {
          currentXPathFragment.setHasText(true);
        }
      }
      currentXPathFragment=nextXPathFragment;
      i++;
    }
    setLastXPathFragment(currentXPathFragment);
  }
}

Fixed version (ground truth):
private void buildFragments(String xpathString){
  StringTokenizer st=new StringTokenizer(xpathString,"String_Node_Str");
  String next;
  int i=0;
  XPathFragment currentXPathFragment=null;
  XPathFragment nextXPathFragment=null;
  if (xpathString.startsWith("String_Node_Str")) {
    next=st.nextToken();
    next="String_Node_Str" + next;
    currentXPathFragment=new XPathFragment(next);
    setXPathFragment(currentXPathFragment);
    i++;
  }
  while (st.hasMoreTokens()) {
    next=st.nextToken().intern();
    if (null != next) {
      if (next.equals(XPathFragment.TEXT)) {
        nextXPathFragment=new XPathFragment(XPathFragment.TEXT);
      }
 else {
        nextXPathFragment=new XPathFragment(next);
      }
      if (0 == i) {
        setXPathFragment(nextXPathFragment);
      }
 else {
        currentXPathFragment.setNextFragment(nextXPathFragment);
        if (nextXPathFragment.isAttribute() || nextXPathFragment.nameIsText()) {
          currentXPathFragment.setHasText(true);
        }
      }
      currentXPathFragment=nextXPathFragment;
      i++;
    }
    setLastXPathFragment(currentXPathFragment);
  }
}
Program: 67142
Project: 67142
Buggy source:
/** 
 * Marshal only one of the values from the collection. 
 * @param xPathFragment
 * @param marshalRecord
 * @param object
 * @param value
 * @param session
 * @param namespaceResolver
 * @param marshalContext
 */
public void marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object value,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext);

Fixed version (ground truth):
/** 
 * Marshal only one of the values from the collection. 
 * @param xPathFragment
 * @param marshalRecord
 * @param object
 * @param value
 * @param session
 * @param namespaceResolver
 * @param marshalContext
 */
public boolean marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object value,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext);
Program: 67143
Project: 67143
Buggy source:
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  Object value=fieldTransformer.buildFieldValue(object,getXMLField().getXPath(),session);
  if (value == null) {
    return false;
  }
  XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
  if (getXMLField().getLastXPathFragment().isAttribute()) {
    marshalRecord.add(getXMLField(),value);
    marshalRecord.closeStartGroupingElements(groupingFragment);
  }
 else {
    marshalRecord.closeStartGroupingElements(groupingFragment);
    marshalRecord.add(getXMLField(),value);
  }
  return true;
}

Fixed version (ground truth):
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  Object value=fieldTransformer.buildFieldValue(object,getXMLField().getXPath(),session);
  return this.marshalSingleValue(xPathFragment,marshalRecord,object,value,session,namespaceResolver,marshalContext);
}
Program: 67144
Project: 67144
Buggy source:
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
  if (marshalRecord.getLeafElementType() != null) {
    XMLDescriptor xmlDescriptor=(XMLDescriptor)session.getDescriptor(object.getClass());
    XMLSchemaReference xmlRef=xmlDescriptor.getSchemaReference();
    if (xmlRef.getType() == 1 && xmlRef.isGlobalDefinition()) {
      QName ctxQName=xmlRef.getSchemaContextAsQName(xmlDescriptor.getNamespaceResolver());
      if (ctxQName.equals(marshalRecord.getLeafElementType())) {
        marshalRecord.closeStartGroupingElements(groupingFragment);
      }
 else {
        XMLField xmlField=(XMLField)getInheritancePolicy().getClassIndicatorField();
        if (xmlField.getLastXPathFragment().isAttribute()) {
          marshalRecord.put(xmlField,xmlRef.getSchemaContext().substring(1));
          marshalRecord.closeStartGroupingElements(groupingFragment);
        }
 else {
          marshalRecord.closeStartGroupingElements(groupingFragment);
          marshalRecord.put(xmlField,xmlRef.getSchemaContext().substring(1));
        }
      }
      return true;
    }
  }
  XMLField xmlField=(XMLField)getInheritancePolicy().getClassIndicatorField();
  if (xmlField.getLastXPathFragment().isAttribute()) {
    getInheritancePolicy().addClassIndicatorFieldToRow(marshalRecord);
    marshalRecord.closeStartGroupingElements(groupingFragment);
  }
 else {
    marshalRecord.closeStartGroupingElements(groupingFragment);
    getInheritancePolicy().addClassIndicatorFieldToRow(marshalRecord);
  }
  return true;
}

Fixed version (ground truth):
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  return this.marshalSingleValue(xPathFragment,marshalRecord,object,null,session,namespaceResolver,marshalContext);
}
Program: 67145
Project: 67145
Buggy source:
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  Object objectValue=directMapping.getAttributeValueFromObject(object);
  Object fieldValue=directMapping.getFieldValue(objectValue,session);
  if ((null == fieldValue) || (null == namespaceResolver)) {
    return false;
  }
  XMLField xmlField=(XMLField)directMapping.getField();
  QName schemaType=getSchemaType(xmlField,fieldValue,session);
  if (null == schemaType) {
    return false;
  }
  if (xmlField.getSchemaType() == null) {
    if (schemaType.equals(XMLConstants.STRING_QNAME)) {
      return false;
    }
  }
 else {
    if (xmlField.isSchemaType(schemaType)) {
      return false;
    }
  }
  XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
  String typeQName=namespaceResolver.resolveNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL) + "String_Node_Str";
  String schemaTypePrefix=namespaceResolver.resolveNamespaceURI(schemaType.getNamespaceURI());
  if (schemaTypePrefix == null) {
    if (XMLConstants.SCHEMA_URL.equals(schemaType.getNamespaceURI())) {
      schemaTypePrefix=namespaceResolver.generatePrefix(XMLConstants.SCHEMA_PREFIX);
    }
 else {
      schemaTypePrefix=namespaceResolver.generatePrefix();
    }
    marshalRecord.attribute(XMLConstants.XMLNS_URL,schemaTypePrefix,XMLConstants.XMLNS + "String_Node_Str" + schemaTypePrefix,schemaType.getNamespaceURI());
  }
  marshalRecord.attribute(XMLConstants.SCHEMA_INSTANCE_URL,"String_Node_Str",typeQName,schemaTypePrefix + ':' + schemaType.getLocalPart());
  marshalRecord.closeStartGroupingElements(groupingFragment);
  return true;
}

Fixed version (ground truth):
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  Object objectValue=directMapping.getAttributeValueFromObject(object);
  return this.marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,marshalContext);
}
Program: 67146
Project: 67146
Buggy source:
public void marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object value,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
}

Fixed version (ground truth):
public boolean marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object value,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  return true;
}
Program: 67152
Project: 67152
Buggy source:
/** 
 * INTERNAL: Return true is this field is a valid persistence field. User decorated is used to indicate that the field either had persistence annotations defined on it or that it was specified in XML.
 */
public boolean isValidPersistenceField(MetadataDescriptor descriptor,boolean userDecorated){
  if (!isValidPersistenceElement(getModifiers())) {
    if (userDecorated) {
      throw ValidationException.mappingMetadataAppliedToInvalidAttribute(this,descriptor.getJavaClass());
    }
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return true is this field is a valid persistence field. User decorated is used to indicate that the field either had persistence annotations defined on it or that it was specified in XML.
 */
public boolean isValidPersistenceField(MetadataDescriptor descriptor,boolean userDecorated){
  if (!isValidPersistenceElement(getModifiers())) {
    if (userDecorated) {
      getLogger().logWarningMessage(MetadataLogger.IGNORE_MAPPING_METADATA,this,descriptor.getJavaClass());
    }
    return false;
  }
  return true;
}
Program: 67153
Project: 67153
Buggy source:
/** 
 * INTERNAL: Return true is this method is a valid persistence method. User decorated is used to indicate that the method either had persistence annotations defined on it or that it was specified in XML.
 */
public boolean isValidPersistenceMethod(MetadataDescriptor descriptor,boolean userDecorated){
  if (!isValidPersistenceElement(getModifiers()) || !isValidPersistenceMethod()) {
    if (userDecorated) {
      if (hasParameters()) {
        throw ValidationException.mappingMetadataAppliedToMethodWithArguments(this,descriptor.getJavaClass());
      }
 else       if (!hasSetMethod()) {
        throw ValidationException.noCorrespondingSetterMethodDefined(descriptor.getJavaClass(),this);
      }
 else {
        throw ValidationException.mappingMetadataAppliedToInvalidAttribute(this,descriptor.getJavaClass());
      }
    }
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return true is this method is a valid persistence method. User decorated is used to indicate that the method either had persistence annotations defined on it or that it was specified in XML.
 */
public boolean isValidPersistenceMethod(MetadataDescriptor descriptor,boolean userDecorated){
  if (!isValidPersistenceElement(getModifiers()) || !isValidPersistenceMethod()) {
    if (userDecorated) {
      if (hasParameters()) {
        throw ValidationException.mappingMetadataAppliedToMethodWithArguments(this,descriptor.getJavaClass());
      }
 else       if (!hasSetMethod()) {
        throw ValidationException.noCorrespondingSetterMethodDefined(descriptor.getJavaClass(),this);
      }
 else {
        getLogger().logWarningMessage(MetadataLogger.IGNORE_MAPPING_METADATA,this,descriptor.getJavaClass());
      }
    }
    return false;
  }
  return true;
}
Program: 67154
Project: 67154
Buggy source:
/** 
 * Tests override via eclipselink-oxm.xml.  Here, the metadata file is not handed in via properties or context path, but looked up by package in the context factory.  An @XmlTransient override will be performed  on Address to ensure the xml file was picked up properly. 1 x Positive test, 1x Negative test
 */
public void testLoadMultipleXmlFilesViaSamePackage(){
  outputResolver=generateSchema(new Class[]{Employee.class,Address.class},1);
  String src=PATH + "String_Node_Str";
  String result=validateAgainstSchema(src,null,outputResolver);
  assertTrue("String_Node_Str",result != null);
  src=PATH + "String_Node_Str";
  result=validateAgainstSchema(src,EMPTY_NAMESPACE,outputResolver);
  assertTrue("String_Node_Str" + result,result == null);
}

Fixed version (ground truth):
/** 
 * Tests override via eclipselink-oxm.xml.  Here, the metadata file is not handed in via properties or context path, but looked up by package in the context factory.  An @XmlTransient override will be performed  on Address to ensure the xml file was picked up properly. 1 x Positive test, 1x Negative test
 */
public void testLoadMultipleXmlFilesViaSamePackage(){
  outputResolver=generateSchema(new Class[]{Employee.class,Address.class},CONTEXT_PATH,PATH,1);
  String src=PATH + "String_Node_Str";
  String result=validateAgainstSchema(src,null,outputResolver);
  assertTrue("String_Node_Str",result != null);
  src=PATH + "String_Node_Str";
  result=validateAgainstSchema(src,EMPTY_NAMESPACE,outputResolver);
  assertTrue("String_Node_Str" + result,result == null);
}
Program: 67155
Project: 67155
Buggy source:
/** 
 * Tests override via eclipselink-oxm.xml.  Here, the metadata file is not handed in via properties or context path, but looked up by package in the context factory.  An @XmlTransient override will be performed  on Employee.lastName to ensure the xml file was picked up properly. Positive test.
 */
public void testLoadXmlFileViaPackage(){
  outputResolver=generateSchema(new Class[]{Employee.class},1);
  String src=PATH + "String_Node_Str";
  String result=validateAgainstSchema(src,EMPTY_NAMESPACE,outputResolver);
  assertTrue("String_Node_Str" + result,result == null);
}

Fixed version (ground truth):
/** 
 * Tests override via eclipselink-oxm.xml.  Here, the metadata file is not handed in via properties or context path, but looked up by package in the context factory.  An @XmlTransient override will be performed  on Employee.lastName to ensure the xml file was picked up properly. Positive test.
 */
public void testLoadXmlFileViaPackage(){
  outputResolver=generateSchema(new Class[]{Employee.class},CONTEXT_PATH,PATH,1);
  String src=PATH + "String_Node_Str";
  String result=validateAgainstSchema(src,EMPTY_NAMESPACE,outputResolver);
  assertTrue("String_Node_Str" + result,result == null);
}