nus-yam/ex-repair huggingface dataset:
Program: 190793
Project: 190793
Buggy source:
/** 
 * Performs the schema correctness check by using JAXP 1.3. <p> This is "weak", because   {@link SchemaFactory#newSchema(Source[])}doesn't handle inclusions very correctly (it ends up parsing it from its original source, not in this tree), and because it doesn't handle two documents for the same namespace very well. <p> We should eventually fix JAXP (and Xerces), but meanwhile this weaker and potentially wrong correctness check is still better than nothing when used inside JAX-WS (JAXB CLI and Ant does a better job of checking this.) <p> To receive errors, use   {@link SchemaFactory#setErrorHandler(ErrorHandler)}.
 */
public void weakSchemaCorrectnessCheck(SchemaFactory sf){
  SAXSource[] sources=new SAXSource[getRootDocuments().size()];
  int i=0;
  for (  String systemId : getRootDocuments()) {
    sources[i]=createSAXSource(systemId);
    try {
      sources[i].getXMLReader().setFeature("String_Node_Str",true);
    }
 catch (    SAXException e) {
      throw new AssertionError(e);
    }
    i++;
  }
  try {
    sf.newSchema(sources);
  }
 catch (  SAXException e) {
  }
}

Fixed version (ground truth):
/** 
 * Performs the schema correctness check by using JAXP 1.3. <p> This is "weak", because   {@link SchemaFactory#newSchema(Source[])}doesn't handle inclusions very correctly (it ends up parsing it from its original source, not in this tree), and because it doesn't handle two documents for the same namespace very well. <p> We should eventually fix JAXP (and Xerces), but meanwhile this weaker and potentially wrong correctness check is still better than nothing when used inside JAX-WS (JAXB CLI and Ant does a better job of checking this.) <p> To receive errors, use   {@link SchemaFactory#setErrorHandler(ErrorHandler)}.
 */
public void weakSchemaCorrectnessCheck(SchemaFactory sf){
  List<SAXSource> sources=new ArrayList<SAXSource>();
  for (  String systemId : getRootDocuments()) {
    Document dom=get(systemId);
    if (dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI))     continue;
    SAXSource ss=createSAXSource(systemId);
    try {
      ss.getXMLReader().setFeature("String_Node_Str",true);
    }
 catch (    SAXException e) {
      throw new AssertionError(e);
    }
    sources.add(ss);
  }
  try {
    sf.newSchema(sources.toArray(new SAXSource[0]));
  }
 catch (  SAXException e) {
  }
}
Program: 190794
Project: 190794
Buggy source:
private void handleCharacters(){
  if (context.expectText()) {
    if (firstCIIChunk && fastInfosetStreamReader.getTextAlgorithmBytes() == null) {
      buffer.append(fastInfosetStreamReader.getTextCharacters(),fastInfosetStreamReader.getTextStart(),fastInfosetStreamReader.getTextLength());
      firstCIIChunk=false;
    }
 else     if (firstCIIChunk && fastInfosetStreamReader.getTextAlgorithmIndex() == EncodingAlgorithmIndexes.BASE64) {
      firstCIIChunk=false;
      hasBase64Data=true;
      base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),"String_Node_Str");
      return;
    }
 else {
      if (hasBase64Data) {
        buffer.append(base64Data);
        hasBase64Data=false;
      }
      buffer.append(fastInfosetStreamReader.getTextCharacters(),fastInfosetStreamReader.getTextStart(),fastInfosetStreamReader.getTextLength());
    }
  }
}

Fixed version (ground truth):
private void handleCharacters(){
  if (context.expectText()) {
    if (firstCIIChunk && fastInfosetStreamReader.getTextAlgorithmBytes() == null) {
      buffer.append(fastInfosetStreamReader.getTextCharacters(),fastInfosetStreamReader.getTextStart(),fastInfosetStreamReader.getTextLength());
      firstCIIChunk=false;
    }
 else     if (firstCIIChunk && fastInfosetStreamReader.getTextAlgorithmIndex() == EncodingAlgorithmIndexes.BASE64) {
      firstCIIChunk=false;
      hasBase64Data=true;
      base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
      return;
    }
 else {
      if (hasBase64Data) {
        buffer.append(base64Data);
        hasBase64Data=false;
      }
      buffer.append(fastInfosetStreamReader.getTextCharacters(),fastInfosetStreamReader.getTextStart(),fastInfosetStreamReader.getTextLength());
    }
  }
}
Program: 190795
Project: 190795
Buggy source:
public TypeUse getTypeUse(XSSimpleType owner){
  if (typeUse != null)   return typeUse;
  JCodeModel cm=getCodeModel();
  typeUse=TypeUseFactory.adapt(CBuiltinLeafInfo.STRING,new CAdapter(cm.ref(adapter)));
  return typeUse;
}

Fixed version (ground truth):
public TypeUse getTypeUse(XSSimpleType owner){
  if (typeUse != null)   return typeUse;
  JCodeModel cm=getCodeModel();
  JDefinedClass a;
  try {
    a=cm._class(adapter);
    a.hide();
    a._extends(cm.ref(XmlAdapter.class).narrow(String.class).narrow(cm.ref(type)));
  }
 catch (  JClassAlreadyExistsException e) {
    a=e.getExistingClass();
  }
  typeUse=TypeUseFactory.adapt(CBuiltinLeafInfo.STRING,new CAdapter(a));
  return typeUse;
}
Program: 190796
Project: 190796
Buggy source:
@Override protected void handleCharacters() throws XMLStreamException, SAXException {
  if (context.expectText()) {
    CharSequence pcdata=in.getPCDATA();
    if (pcdata instanceof org.jvnet.staxex.Base64Data) {
      org.jvnet.staxex.Base64Data bd=(org.jvnet.staxex.Base64Data)pcdata;
      binary.set(bd.get(),bd.getDataLen(),bd.getMimeType());
      visitor.text(binary);
    }
 else {
      buffer.append(pcdata);
    }
  }
}

Fixed version (ground truth):
@Override protected void handleCharacters() throws XMLStreamException, SAXException {
  if (context.expectText()) {
    CharSequence pcdata=in.getPCDATA();
    if (pcdata instanceof org.jvnet.staxex.Base64Data) {
      org.jvnet.staxex.Base64Data bd=(org.jvnet.staxex.Base64Data)pcdata;
      binary.set(bd.get(),bd.getDataLen(),bd.getMimeType());
      visitor.text(binary);
      textReported=true;
    }
 else {
      buffer.append(pcdata);
    }
  }
}
Program: 190797
Project: 190797
Buggy source:
private void processText(boolean ignorable) throws SAXException {
  if (context.expectText() && (!ignorable || !WhiteSpaceProcessor.isWhiteSpace(buffer)))   visitor.text(buffer);
  buffer.setLength(0);
}

Fixed version (ground truth):
private void processText(boolean ignorable) throws SAXException {
  if (context.expectText() && (!ignorable || !WhiteSpaceProcessor.isWhiteSpace(buffer))) {
    if (textReported) {
      textReported=false;
    }
 else {
      visitor.text(buffer);
    }
  }
  buffer.setLength(0);
}
Program: 190799
Project: 190799
Buggy source:
public void generateSchema(SchemaOutputResolver outputResolver) throws IOException {
  if (outputResolver == null) {
    throw new IOException(Messages.NULL_OUTPUT_RESOLVER.format());
  }
  RuntimeTypeInfoSet tis;
  try {
    tis=getTypeInfoSet();
  }
 catch (  IllegalAnnotationsException e) {
    throw new AssertionError(e);
  }
  XmlSchemaGenerator<Type,Class,Field,Method> xsdgen=new XmlSchemaGenerator<Type,Class,Field,Method>(tis.getNavigator(),tis);
  Set<QName> rootTagNames=new HashSet<QName>();
  for (  RuntimeElementInfo ei : tis.getAllElements()) {
    rootTagNames.add(ei.getElementName());
  }
  for (  RuntimeClassInfo ci : tis.beans().values()) {
    if (ci.isElement())     rootTagNames.add(ci.asElement().getElementName());
  }
  for (  TypeReference tr : bridges.keySet()) {
    if (rootTagNames.contains(tr.tagName))     continue;
    if (tr.type == void.class || tr.type == Void.class) {
      xsdgen.add(tr.tagName,null);
    }
 else {
      NonElement<Type,Class> typeInfo=getXmlType(tis,tr);
      xsdgen.add(tr.tagName,typeInfo);
    }
  }
  xsdgen.write(outputResolver);
}

Fixed version (ground truth):
public void generateSchema(SchemaOutputResolver outputResolver) throws IOException {
  if (outputResolver == null) {
    throw new IOException(Messages.NULL_OUTPUT_RESOLVER.format());
  }
  RuntimeTypeInfoSet tis;
  try {
    tis=getTypeInfoSet();
  }
 catch (  IllegalAnnotationsException e) {
    throw new AssertionError(e);
  }
  XmlSchemaGenerator<Type,Class,Field,Method> xsdgen=new XmlSchemaGenerator<Type,Class,Field,Method>(tis.getNavigator(),tis);
  Set<QName> rootTagNames=new HashSet<QName>();
  for (  RuntimeElementInfo ei : tis.getAllElements()) {
    rootTagNames.add(ei.getElementName());
  }
  for (  RuntimeClassInfo ci : tis.beans().values()) {
    if (ci.isElement())     rootTagNames.add(ci.asElement().getElementName());
  }
  for (  TypeReference tr : bridges.keySet()) {
    if (rootTagNames.contains(tr.tagName))     continue;
    if (tr.type == void.class || tr.type == Void.class) {
      xsdgen.add(tr.tagName,false,null);
    }
 else {
      NonElement<Type,Class> typeInfo=getXmlType(tis,tr);
      xsdgen.add(tr.tagName,Navigator.REFLECTION.isPrimitive(tr.type),typeInfo);
    }
  }
  xsdgen.write(outputResolver);
}
Program: 190800
Project: 190800
Buggy source:
public ElementWithType(NonElement<T,C> type){
  this.type=type;
}

Fixed version (ground truth):
public ElementWithType(boolean nillable,NonElement<T,C> type){
  this.type=type;
  this.nillable=nillable;
}
Program: 190801
Project: 190801
Buggy source:
public void addGlobalElement(TypeRef<T,C> tref){
  elementDecls.put(tref.getTagName().getLocalPart(),new ElementWithType(tref.getTarget()));
}

Fixed version (ground truth):
public void addGlobalElement(TypeRef<T,C> tref){
  elementDecls.put(tref.getTagName().getLocalPart(),new ElementWithType(false,tref.getTarget()));
}
Program: 190802
Project: 190802
Buggy source:
/** 
 * Adds an additional element declaration.
 * @param tagName The name of the element declaration to be added.
 * @param type The type this element refers to. Can be null, in which case the element refers to an empty anonymous complex type.
 */
public void add(QName tagName,NonElement<T,C> type){
  if (type != null && type.getType() == navigator.ref(CompositeStructure.class))   return;
  Namespace n=getNamespace(tagName.getNamespaceURI());
  n.elementDecls.put(tagName.getLocalPart(),n.new ElementWithType(type));
  if (type != null)   n.addDependencyTo(type.getTypeName());
}

Fixed version (ground truth):
/** 
 * Adds an additional element declaration.
 * @param tagName The name of the element declaration to be added.
 * @param type The type this element refers to. Can be null, in which case the element refers to an empty anonymous complex type.
 */
public void add(QName tagName,boolean isNillable,NonElement<T,C> type){
  if (type != null && type.getType() == navigator.ref(CompositeStructure.class))   return;
  Namespace n=getNamespace(tagName.getNamespaceURI());
  n.elementDecls.put(tagName.getLocalPart(),n.new ElementWithType(isNillable,type));
  if (type != null)   n.addDependencyTo(type.getTypeName());
}
Program: 190803
Project: 190803
Buggy source:
public void writeTo(String localName,Schema schema){
  TopLevelElement e=schema.element().name(localName);
  if (type != null) {
    if (!navigator.isPrimitive(type.getType()))     e.nillable(true);
    writeTypeRef(e,type,"String_Node_Str");
  }
 else {
    e.complexType();
  }
  e.commit();
}

Fixed version (ground truth):
public void writeTo(String localName,Schema schema){
  TopLevelElement e=schema.element().name(localName);
  if (nillable)   e.nillable(true);
  if (type != null) {
    writeTypeRef(e,type,"String_Node_Str");
  }
 else {
    e.complexType();
  }
  e.commit();
}
Program: 190804
Project: 190804
Buggy source:
public void generateSchema(SchemaOutputResolver outputResolver,ErrorListener errorListener) throws IOException {
  XmlSchemaGenerator<TypeMirror,TypeDeclaration,FieldDeclaration,MethodDeclaration> xsdgen=new XmlSchemaGenerator<TypeMirror,TypeDeclaration,FieldDeclaration,MethodDeclaration>(types.getNavigator(),types);
  for (  Map.Entry<QName,Reference> e : additionalElementDecls.entrySet()) {
    Reference value=e.getValue();
    if (value != null) {
      NonElement<TypeMirror,TypeDeclaration> typeInfo=refMap.get(value);
      if (typeInfo == null)       throw new IllegalArgumentException(e.getValue() + "String_Node_Str");
      xsdgen.add(e.getKey(),typeInfo);
    }
 else {
      xsdgen.add(e.getKey(),null);
    }
  }
  xsdgen.write(outputResolver);
}

Fixed version (ground truth):
public void generateSchema(SchemaOutputResolver outputResolver,ErrorListener errorListener) throws IOException {
  XmlSchemaGenerator<TypeMirror,TypeDeclaration,FieldDeclaration,MethodDeclaration> xsdgen=new XmlSchemaGenerator<TypeMirror,TypeDeclaration,FieldDeclaration,MethodDeclaration>(types.getNavigator(),types);
  for (  Map.Entry<QName,Reference> e : additionalElementDecls.entrySet()) {
    Reference value=e.getValue();
    if (value != null) {
      NonElement<TypeMirror,TypeDeclaration> typeInfo=refMap.get(value);
      if (typeInfo == null)       throw new IllegalArgumentException(e.getValue() + "String_Node_Str");
      xsdgen.add(e.getKey(),value.type instanceof PrimitiveType,typeInfo);
    }
 else {
      xsdgen.add(e.getKey(),false,null);
    }
  }
  xsdgen.write(outputResolver);
}
Program: 190805
Project: 190805
Buggy source:
@Override public void startElement(UnmarshallingContext.State state,TagName ea){
  state.getContext().startScope(1);
}

Fixed version (ground truth):
@Override public void startElement(UnmarshallingContext.State state,TagName ea){
  state.getContext().startScope(1);
  state.target=state.prev.target;
}
Program: 190808
Project: 190808
Buggy source:
/** 
 * The same as   {@link #create0} but with an error handling to makethe instanciation error fatal.
 */
public static <T>T create(Class<T> clazz){
  try {
    return create0(clazz);
  }
 catch (  InstantiationException e) {
    logger.log(Level.INFO,"String_Node_Str" + clazz,e);
    throw new InstantiationError(e.toString());
  }
catch (  IllegalAccessException e) {
    logger.log(Level.INFO,"String_Node_Str" + clazz,e);
    throw new IllegalAccessError(e.toString());
  }
catch (  InvocationTargetException e) {
    Throwable target=e.getTargetException();
    if (target instanceof RuntimeException)     throw (RuntimeException)target;
    if (target instanceof Error)     throw (Error)target;
    throw new IllegalStateException(target);
  }
}

Fixed version (ground truth):
/** 
 * Call a method in the factory class to get the object.
 */
public static Object create(final Method method) throws IllegalAccessException, InvocationTargetException, InstantiationException {
  return AccessController.doPrivileged(new PrivilegedAction(){
    public Object run(){
      Object cons=null;
      Throwable errorMsg=null;
      try {
        cons=method.invoke(null,emptyObject);
      }
 catch (      InvocationTargetException ive) {
        Throwable target=ive.getTargetException();
        if (target instanceof RuntimeException)         throw (RuntimeException)target;
        if (target instanceof Error)         throw (Error)target;
        throw new IllegalStateException(target);
      }
catch (      IllegalAccessException e) {
        logger.log(Level.INFO,"String_Node_Str" + method.getReturnType().getName(),e);
        throw new IllegalAccessError(e.toString());
      }
catch (      IllegalArgumentException iae) {
        logger.log(Level.INFO,"String_Node_Str" + method.getReturnType().getName(),iae);
        errorMsg=iae;
      }
catch (      NullPointerException npe) {
        logger.log(Level.INFO,"String_Node_Str" + method.getReturnType().getName(),npe);
        errorMsg=npe;
      }
catch (      ExceptionInInitializerError eie) {
        logger.log(Level.INFO,"String_Node_Str" + method.getReturnType().getName(),eie);
        errorMsg=eie;
      }
      if (errorMsg != null) {
        NoSuchMethodError exp;
        exp=new NoSuchMethodError(errorMsg.getMessage());
        exp.initCause(errorMsg);
        throw exp;
      }
      return cons;
    }
  }
);
}
Program: 190809
Project: 190809
Buggy source:
public Constructor<T> run(){
  Constructor<T> cons;
  try {
    cons=clazz.getDeclaredConstructor(emptyClass);
  }
 catch (  NoSuchMethodException e) {
    logger.log(Level.INFO,"String_Node_Str" + clazz,e);
    NoSuchMethodError exp;
    if (clazz.getDeclaringClass() != null && !Modifier.isStatic(clazz.getModifiers())) {
      exp=new NoSuchMethodError(Messages.NO_DEFAULT_CONSTRUCTOR_IN_INNER_CLASS.format(clazz.getName()));
    }
 else {
      exp=new NoSuchMethodError(e.getMessage());
    }
    exp.initCause(e);
    throw exp;
  }
  int classMod=clazz.getModifiers();
  if (!Modifier.isPublic(classMod) || !Modifier.isPublic(cons.getModifiers())) {
    try {
      cons.setAccessible(true);
    }
 catch (    SecurityException e) {
      logger.log(Level.FINE,"String_Node_Str" + clazz + "String_Node_Str",e);
      throw e;
    }
  }
  return cons;
}

Fixed version (ground truth):
public Object run(){
  Object cons=null;
  Throwable errorMsg=null;
  try {
    cons=method.invoke(null,emptyObject);
  }
 catch (  InvocationTargetException ive) {
    Throwable target=ive.getTargetException();
    if (target instanceof RuntimeException)     throw (RuntimeException)target;
    if (target instanceof Error)     throw (Error)target;
    throw new IllegalStateException(target);
  }
catch (  IllegalAccessException e) {
    logger.log(Level.INFO,"String_Node_Str" + method.getReturnType().getName(),e);
    throw new IllegalAccessError(e.toString());
  }
catch (  IllegalArgumentException iae) {
    logger.log(Level.INFO,"String_Node_Str" + method.getReturnType().getName(),iae);
    errorMsg=iae;
  }
catch (  NullPointerException npe) {
    logger.log(Level.INFO,"String_Node_Str" + method.getReturnType().getName(),npe);
    errorMsg=npe;
  }
catch (  ExceptionInInitializerError eie) {
    logger.log(Level.INFO,"String_Node_Str" + method.getReturnType().getName(),eie);
    errorMsg=eie;
  }
  if (errorMsg != null) {
    NoSuchMethodError exp;
    exp=new NoSuchMethodError(errorMsg.getMessage());
    exp.initCause(errorMsg);
    throw exp;
  }
  return cons;
}
Program: 190810
Project: 190810
Buggy source:
/** 
 * A   {@link ClassInfo} can be referenced by {@link XmlIDREF} ifit has an ID property.
 */
public boolean canBeReferencedByIDREF(){
  for (  PropertyInfo<T,C> p : getProperties()) {
    if (p.id() == ID.ID)     return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * A   {@link ClassInfo} can be referenced by {@link XmlIDREF} ifit has an ID property.
 */
public boolean canBeReferencedByIDREF(){
  for (  PropertyInfo<T,C> p : getProperties()) {
    if (p.id() == ID.ID)     return true;
  }
  ClassInfoImpl<T,C,F,M> base=getBaseClass();
  if (base != null)   return base.canBeReferencedByIDREF();
 else   return false;
}
Program: 190811
Project: 190811
Buggy source:
private void processText(boolean ignorable) throws SAXException {
  firstCIIChunk=true;
  if (context.expectText() && (!ignorable || !WhiteSpaceProcessor.isWhiteSpace(buffer))) {
    if (!hasBase64Data) {
      visitor.text(buffer);
      buffer.setLength(0);
    }
 else {
      visitor.text(base64Data);
      hasBase64Data=false;
    }
  }
}

Fixed version (ground truth):
private void processText(boolean ignorable) throws SAXException {
  firstCIIChunk=true;
  if (context.expectText() && (!ignorable || !WhiteSpaceProcessor.isWhiteSpace(buffer))) {
    if (!hasBase64Data) {
      visitor.text(buffer);
    }
 else {
      visitor.text(base64Data);
      hasBase64Data=false;
    }
  }
  buffer.setLength(0);
}
Program: 190813
Project: 190813
Buggy source:
public ClassInfoImpl<T,C,F,M> getScope(){
  TODO.checkSpec("String_Node_Str");
  return null;
}

Fixed version (ground truth):
/** 
 * When a bean binds to an element, it's always through   {@link XmlRootElement}, so this method always return null.
 * @deprecated you shouldn't be invoking this method on  {@link ClassInfoImpl}.
 */
public ClassInfoImpl<T,C,F,M> getScope(){
  return null;
}
Program: 190814
Project: 190814
Buggy source:
/** 
 * @param clazz
 * @param type clazz and type should both point to the enum class that this  {@link EnumLeafInfo} represents.Because of the type parameterization we have to take them separately.
 */
public EnumLeafInfoImpl(ModelBuilder<T,C,F,M> builder,Locatable upstream,C clazz,T type){
  super(builder,upstream);
  this.clazz=clazz;
  this.type=type;
  typeName=parseTypeName(clazz);
  XmlEnum xe=builder.reader.getClassAnnotation(XmlEnum.class,clazz,this);
  if (xe != null) {
    T base=builder.reader.getClassValue(xe,"String_Node_Str");
    baseType=builder.getTypeInfo(base,this);
  }
 else {
    baseType=builder.getTypeInfo(builder.nav.ref(String.class),this);
  }
}

Fixed version (ground truth):
/** 
 * @param clazz
 * @param type clazz and type should both point to the enum class that this  {@link EnumLeafInfo} represents.Because of the type parameterization we have to take them separately.
 */
public EnumLeafInfoImpl(ModelBuilder<T,C,F,M> builder,Locatable upstream,C clazz,T type){
  super(builder,upstream);
  this.clazz=clazz;
  this.type=type;
  elementName=parseElementName(clazz);
  typeName=parseTypeName(clazz);
  XmlEnum xe=builder.reader.getClassAnnotation(XmlEnum.class,clazz,this);
  if (xe != null) {
    T base=builder.reader.getClassValue(xe,"String_Node_Str");
    baseType=builder.getTypeInfo(base,this);
  }
 else {
    baseType=builder.getTypeInfo(builder.nav.ref(String.class),this);
  }
}
Program: 190815
Project: 190815
Buggy source:
public Iterator<? extends EnumConstantImpl<T,C,F,M>> iterator(){
  return new Iterator<EnumConstantImpl<T,C,F,M>>(){
    private EnumConstantImpl<T,C,F,M> next=firstConstant;
    public boolean hasNext(){
      return next != null;
    }
    public EnumConstantImpl<T,C,F,M> next(){
      EnumConstantImpl<T,C,F,M> r=next;
      next=next.next;
      return r;
    }
    public void remove(){
      throw new UnsupportedOperationException();
    }
  }
;
}

Fixed version (ground truth):
public Iterator<EnumConstantImpl<T,C,F,M>> iterator(){
  return new Iterator<EnumConstantImpl<T,C,F,M>>(){
    private EnumConstantImpl<T,C,F,M> next=firstConstant;
    public boolean hasNext(){
      return next != null;
    }
    public EnumConstantImpl<T,C,F,M> next(){
      EnumConstantImpl<T,C,F,M> r=next;
      next=next.next;
      return r;
    }
    public void remove(){
      throw new UnsupportedOperationException();
    }
  }
;
}
Program: 190816
Project: 190816
Buggy source:
private boolean addAllSubtypes(T type){
  Navigator<T,C,F,M> nav=nav();
  NonElement<T,C> t=parent.builder.getClassInfo(nav.asDecl(type),this);
  if (!(t instanceof ClassInfo))   return false;
  boolean result=false;
  ClassInfo<T,C> c=(ClassInfo<T,C>)t;
  if (c != null && c.isElement()) {
    types.add(c.asElement());
    result=true;
  }
  for (  ClassInfo<T,C> ci : parent.owner.beans().values()) {
    if (ci.isElement() && nav.isSubClassOf(ci.getType(),type)) {
      types.add(ci.asElement());
      result=true;
    }
  }
  for (  ElementInfo<T,C> ei : parent.owner.getElementMappings(null).values()) {
    if (nav.isSubClassOf(ei.getType(),type)) {
      types.add(ei);
      result=true;
    }
  }
  return result;
}

Fixed version (ground truth):
private boolean addAllSubtypes(T type){
  Navigator<T,C,F,M> nav=nav();
  NonElement<T,C> t=parent.builder.getClassInfo(nav.asDecl(type),this);
  if (!(t instanceof ClassInfo))   return false;
  boolean result=false;
  ClassInfo<T,C> c=(ClassInfo<T,C>)t;
  if (c.isElement()) {
    types.add(c.asElement());
    result=true;
  }
  for (  ClassInfo<T,C> ci : parent.owner.beans().values()) {
    if (ci.isElement() && nav.isSubClassOf(ci.getType(),type)) {
      types.add(ci.asElement());
      result=true;
    }
  }
  for (  ElementInfo<T,C> ei : parent.owner.getElementMappings(null).values()) {
    if (nav.isSubClassOf(ei.getType(),type)) {
      types.add(ei);
      result=true;
    }
  }
  return result;
}
Program: 190817
Project: 190817
Buggy source:
public final XmlNsForm getAttributeFormDefault(String nsUri){
  for (  ClassInfoImpl<TypeT,ClassDeclT,FieldT,MethodT> ci : beans().values()) {
    XmlSchema xs=reader.getPackageAnnotation(XmlSchema.class,ci.getClazz(),null);
    if (xs == null)     continue;
    if (!xs.namespace().equals(nsUri))     continue;
    XmlNsForm xnf=xs.attributeFormDefault();
    if (xnf != XmlNsForm.UNSET)     return xnf;
  }
  return XmlNsForm.UNQUALIFIED;
}

Fixed version (ground truth):
public final XmlNsForm getAttributeFormDefault(String nsUri){
  for (  ClassInfoImpl<TypeT,ClassDeclT,FieldT,MethodT> ci : beans().values()) {
    XmlSchema xs=reader.getPackageAnnotation(XmlSchema.class,ci.getClazz(),null);
    if (xs == null)     continue;
    if (!xs.namespace().equals(nsUri))     continue;
    XmlNsForm xnf=xs.attributeFormDefault();
    if (xnf != XmlNsForm.UNSET)     return xnf;
  }
  return XmlNsForm.UNSET;
}
Program: 190818
Project: 190818
Buggy source:
public final XmlNsForm getElementFormDefault(String nsUri){
  for (  ClassInfoImpl<TypeT,ClassDeclT,FieldT,MethodT> ci : beans().values()) {
    XmlSchema xs=reader.getPackageAnnotation(XmlSchema.class,ci.getClazz(),null);
    if (xs == null)     continue;
    if (!xs.namespace().equals(nsUri))     continue;
    XmlNsForm xnf=xs.elementFormDefault();
    if (xnf != XmlNsForm.UNSET)     return xnf;
  }
  return XmlNsForm.UNQUALIFIED;
}

Fixed version (ground truth):
public final XmlNsForm getElementFormDefault(String nsUri){
  for (  ClassInfoImpl<TypeT,ClassDeclT,FieldT,MethodT> ci : beans().values()) {
    XmlSchema xs=reader.getPackageAnnotation(XmlSchema.class,ci.getClazz(),null);
    if (xs == null)     continue;
    if (!xs.namespace().equals(nsUri))     continue;
    XmlNsForm xnf=xs.elementFormDefault();
    if (xnf != XmlNsForm.UNSET)     return xnf;
  }
  return XmlNsForm.UNSET;
}
Program: 190820
Project: 190820
Buggy source:
/** 
 * Encodes a byte array into another byte array by first doing base64 encoding then encoding the result in ASCII. The caller must supply a big enough buffer.
 * @return the value of  {@code ptr+((len+2)/3)*4}, which is the new offset in the output buffer where the further bytes should be placed.
 */
public static int _printBase64Binary(byte[] input,int offset,int len,byte[] out,int ptr){
  byte[] buf=out;
  int max=len + offset;
  for (int i=offset; i < max; i+=3) {
switch (len - i) {
case 1:
      buf[ptr++]=encodeByte(input[i] >> 2);
    buf[ptr++]=encodeByte(((input[i]) & 0x3) << 4);
  buf[ptr++]='=';
buf[ptr++]='=';
break;
case 2:
buf[ptr++]=encodeByte(input[i] >> 2);
buf[ptr++]=encodeByte(((input[i] & 0x3) << 4) | ((input[i + 1] >> 4) & 0xF));
buf[ptr++]=encodeByte((input[i + 1] & 0xF) << 2);
buf[ptr++]='=';
break;
default :
buf[ptr++]=encodeByte(input[i] >> 2);
buf[ptr++]=encodeByte(((input[i] & 0x3) << 4) | ((input[i + 1] >> 4) & 0xF));
buf[ptr++]=encodeByte(((input[i + 1] & 0xF) << 2) | ((input[i + 2] >> 6) & 0x3));
buf[ptr++]=encodeByte(input[i + 2] & 0x3F);
break;
}
}
return ptr;
}

Fixed version (ground truth):
/** 
 * Encodes a byte array into another byte array by first doing base64 encoding then encoding the result in ASCII. The caller must supply a big enough buffer.
 * @return the value of  {@code ptr+((len+2)/3)*4}, which is the new offset in the output buffer where the further bytes should be placed.
 */
public static int _printBase64Binary(byte[] input,int offset,int len,byte[] out,int ptr){
  byte[] buf=out;
  int max=len + offset;
  for (int i=offset; i < max; i+=3) {
switch (max - i) {
case 1:
      buf[ptr++]=encodeByte(input[i] >> 2);
    buf[ptr++]=encodeByte(((input[i]) & 0x3) << 4);
  buf[ptr++]='=';
buf[ptr++]='=';
break;
case 2:
buf[ptr++]=encodeByte(input[i] >> 2);
buf[ptr++]=encodeByte(((input[i] & 0x3) << 4) | ((input[i + 1] >> 4) & 0xF));
buf[ptr++]=encodeByte((input[i + 1] & 0xF) << 2);
buf[ptr++]='=';
break;
default :
buf[ptr++]=encodeByte(input[i] >> 2);
buf[ptr++]=encodeByte(((input[i] & 0x3) << 4) | ((input[i + 1] >> 4) & 0xF));
buf[ptr++]=encodeByte(((input[i + 1] & 0xF) << 2) | ((input[i + 2] >> 6) & 0x3));
buf[ptr++]=encodeByte(input[i + 2] & 0x3F);
break;
}
}
return ptr;
}
Program: 190821
Project: 190821
Buggy source:
/** 
 * Returns a class loader that can load classes from JDK tools.jar.
 */
private static URL getToolsJar() throws ToolsJarNotFoundException {
  File jreHome=new File(System.getProperty("String_Node_Str"));
  File toolsJar=new File(jreHome.getParent(),"String_Node_Str");
  if (!toolsJar.exists()) {
    throw new ToolsJarNotFoundException(toolsJar);
  }
  try {
    return toolsJar.toURL();
  }
 catch (  MalformedURLException e) {
    throw new AssertionError(e);
  }
}

Fixed version (ground truth):
/** 
 * Returns a class loader that can load classes from JDK tools.jar.
 * @param parent
 */
private static URL[] getToolsJar(ClassLoader parent) throws ToolsJarNotFoundException {
  try {
    parent.loadClass("String_Node_Str");
    parent.loadClass("String_Node_Str");
    return new URL[0];
  }
 catch (  ClassNotFoundException e) {
  }
  File jreHome=new File(System.getProperty("String_Node_Str"));
  File toolsJar=new File(jreHome.getParent(),"String_Node_Str");
  if (!toolsJar.exists()) {
    throw new ToolsJarNotFoundException(toolsJar);
  }
  try {
    return new URL[]{toolsJar.toURL()};
  }
 catch (  MalformedURLException e) {
    throw new AssertionError(e);
  }
}
Program: 190822
Project: 190822
Buggy source:
/** 
 * @param packagePrefixes The package prefixes that are forced to resolve within this class loader.
 * @param parent The parent class loader to delegate to.
 */
public APTClassLoader(ClassLoader parent,String[] packagePrefixes) throws ToolsJarNotFoundException {
  super(new URL[]{getToolsJar()},parent);
  this.packagePrefixes=packagePrefixes;
}

Fixed version (ground truth):
/** 
 * @param packagePrefixes The package prefixes that are forced to resolve within this class loader.
 * @param parent The parent class loader to delegate to.
 */
public APTClassLoader(ClassLoader parent,String[] packagePrefixes) throws ToolsJarNotFoundException {
  super(getToolsJar(parent),parent);
  if (getURLs().length == 0)   this.packagePrefixes=new String[0];
 else   this.packagePrefixes=packagePrefixes;
}
Program: 190823
Project: 190823
Buggy source:
/** 
 * Writes the given byte[] as base64 encoded binary to the output. <p> Being defined on this class allows this method to access the buffer directly, which translates to a better performance.
 */
public void text(byte[] data,int dataLen) throws IOException {
  int start=0;
  while (dataLen > 0) {
    int batchSize=Math.min(((_octetBuffer.length - _octetBufferIndex) / 4) * 3,dataLen);
    _octetBufferIndex=DatatypeConverterImpl._printBase64Binary(data,start,batchSize,_octetBuffer,_octetBufferIndex);
    start+=batchSize;
    dataLen-=batchSize;
    if (_octetBufferIndex == _octetBuffer.length)     flushBuffer();
  }
}

Fixed version (ground truth):
/** 
 * Writes the given byte[] as base64 encoded binary to the output. <p> Being defined on this class allows this method to access the buffer directly, which translates to a better performance.
 */
public void text(byte[] data,int dataLen) throws IOException {
  int start=0;
  while (dataLen > 0) {
    int batchSize=Math.min(((_octetBuffer.length - _octetBufferIndex) / 4) * 3,dataLen);
    _octetBufferIndex=DatatypeConverterImpl._printBase64Binary(data,start,batchSize,_octetBuffer,_octetBufferIndex);
    start+=batchSize;
    dataLen-=batchSize;
    if (batchSize < dataLen)     flushBuffer();
  }
}
Program: 190824
Project: 190824
Buggy source:
public void text(Pcdata value,boolean needsSeparatingWhitespace) throws IOException, SAXException, XMLStreamException {
  if (needsSeparatingWhitespace)   out.writeCharacters("String_Node_Str");
  int len=value.length();
  if (len < buf.length) {
    value.writeTo(buf,len);
    out.writeCharacters(buf,0,len);
  }
 else {
    out.writeCharacters(value.toString());
  }
}

Fixed version (ground truth):
public void text(Pcdata value,boolean needsSeparatingWhitespace) throws IOException, SAXException, XMLStreamException {
  if (needsSeparatingWhitespace)   out.writeCharacters("String_Node_Str");
  int len=value.length();
  if (len < buf.length) {
    value.writeTo(buf,0);
    out.writeCharacters(buf,0,len);
  }
 else {
    out.writeCharacters(value.toString());
  }
}
Program: 190825
Project: 190825
Buggy source:
public Accessor getElementPropertyAccessor(String nsUri,String localName){
  if (wrapperTagName != null) {
    if (wrapperTagName.equals(nsUri,localName))     return acc;
  }
 else {
    for (    TagAndType tt : typeMap.values()) {
      if (tt.tagName.equals(nsUri,localName))       return new NullSafeAccessor(acc);
    }
  }
  return null;
}

Fixed version (ground truth):
public Accessor getElementPropertyAccessor(String nsUri,String localName){
  if (wrapperTagName != null) {
    if (wrapperTagName.equals(nsUri,localName))     return acc;
  }
 else {
    for (    TagAndType tt : typeMap.values()) {
      if (tt.tagName.equals(nsUri,localName))       return new NullSafeAccessor(acc,lister);
    }
  }
  return null;
}
Program: 190826
Project: 190826
Buggy source:
public NullSafeAccessor(Accessor<B,V> core){
  super(core.getValueType());
  this.core=core;
  this.implClass=ClassFactory.inferImplClass(getValueType(),ClassFactory.COLLECTION_IMPL_CLASSES);
}

Fixed version (ground truth):
public NullSafeAccessor(Accessor<B,V> core,Lister lister){
  super(core.getValueType());
  this.core=core;
  this.lister=lister;
}
Program: 190827
Project: 190827
Buggy source:
public V get(B bean) throws AccessorException {
  V v=core.get(bean);
  if (v == null) {
    try {
      v=ClassFactory.create0(implClass);
    }
 catch (    IllegalAccessException e) {
      throw new AccessorException(e);
    }
catch (    InvocationTargetException e) {
      throw new AccessorException(e);
    }
catch (    InstantiationException e) {
      throw new AccessorException(e);
    }
  }
  return v;
}

Fixed version (ground truth):
public V get(B bean) throws AccessorException {
  V v=core.get(bean);
  if (v == null) {
    Object pack=lister.startPacking(bean,core);
    lister.endPacking(pack,bean,core);
    v=core.get(bean);
  }
  return v;
}
Program: 190828
Project: 190828
Buggy source:
public TypeReference(QName tagName,Type type,Annotation... annotations){
  this.tagName=tagName;
  this.type=type;
  this.annotations=annotations;
  if (tagName == null || type == null || annotations == null)   throw new IllegalArgumentException();
}

Fixed version (ground truth):
public TypeReference(QName tagName,Type type,Annotation... annotations){
  if (tagName == null || type == null || annotations == null)   throw new IllegalArgumentException();
  this.tagName=new QName(tagName.getNamespaceURI().intern(),tagName.getLocalPart().intern(),tagName.getPrefix());
  this.type=type;
  this.annotations=annotations;
}
Program: 190829
Project: 190829
Buggy source:
protected void link(){
  super.link();
  for (  TypeRefImpl<TypeT,ClassDeclT> ref : getTypes()) {
    ref.link();
  }
  if (isValueList()) {
    for (    TypeRefImpl<TypeT,ClassDeclT> ref : types) {
      if (!ref.getTarget().isSimpleType()) {
        parent.builder.reportError(new IllegalAnnotationException(Messages.XMLLIST_NEEDS_SIMPLETYPE.format(nav().getTypeName(ref.getTarget().getType())),this));
        break;
      }
    }
  }
}

Fixed version (ground truth):
protected void link(){
  super.link();
  for (  TypeRefImpl<TypeT,ClassDeclT> ref : getTypes()) {
    ref.link();
  }
  if (isValueList()) {
    if (id() != ID.IDREF) {
      for (      TypeRefImpl<TypeT,ClassDeclT> ref : types) {
        if (!ref.getTarget().isSimpleType()) {
          parent.builder.reportError(new IllegalAnnotationException(Messages.XMLLIST_NEEDS_SIMPLETYPE.format(nav().getTypeName(ref.getTarget().getType())),this));
          break;
        }
      }
    }
  }
}
Program: 190831
Project: 190831
Buggy source:
/** 
 * Writes a type attribute (if the referenced type is a global type) or writes out the definition of the anonymous type in place (if the referenced type is not a global type.)
 * @param th the TXW interface to which the attribute will be written.
 * @param type type to be referenced.
 * @param refAttName The name of the attribute used when referencing a type by QName.
 */
private void writeTypeRef(TypeHost th,NonElement<TypeT,ClassDeclT> type,String refAttName){
  if (type.getTypeName() == null) {
    if (type instanceof ClassInfo) {
      depth++;
      for (int i=0; i < depth; i++)       System.out.print("String_Node_Str");
      System.out.println(((ClassInfo<TypeT,ClassDeclT>)type).getClazz());
      writeClass((ClassInfo<TypeT,ClassDeclT>)type,th);
      depth--;
    }
 else {
      writeEnum((EnumLeafInfo<TypeT,ClassDeclT>)type,(SimpleTypeHost)th);
    }
  }
 else {
    th._attribute(refAttName,type.getTypeName());
  }
}

Fixed version (ground truth):
/** 
 * Writes a type attribute (if the referenced type is a global type) or writes out the definition of the anonymous type in place (if the referenced type is not a global type.)
 * @param th the TXW interface to which the attribute will be written.
 * @param type type to be referenced.
 * @param refAttName The name of the attribute used when referencing a type by QName.
 */
private void writeTypeRef(TypeHost th,NonElement<TypeT,ClassDeclT> type,String refAttName){
  if (type.getTypeName() == null) {
    if (type instanceof ClassInfo) {
      writeClass((ClassInfo<TypeT,ClassDeclT>)type,th);
    }
 else {
      writeEnum((EnumLeafInfo<TypeT,ClassDeclT>)type,(SimpleTypeHost)th);
    }
  }
 else {
    th._attribute(refAttName,type.getTypeName());
  }
}
Program: 190832
Project: 190832
Buggy source:
/** 
 * Marshals one attribute.
 * @see JaxBeanInfo#serializeAttributes(Object,XMLSerializer)
 */
public void serializeAttributes(BeanT o,XMLSerializer w) throws SAXException, AccessorException, IOException, XMLStreamException {
  if (xacc.hasValue(o))   w.attribute(attName,xacc.print(o).toString());
}

Fixed version (ground truth):
/** 
 * Marshals one attribute.
 * @see JaxBeanInfo#serializeAttributes(Object,XMLSerializer)
 */
public void serializeAttributes(BeanT o,XMLSerializer w) throws SAXException, AccessorException, IOException, XMLStreamException {
  CharSequence value=xacc.print(o);
  if (value != null)   w.attribute(attName,value.toString());
}
Program: 190833
Project: 190833
Buggy source:
public void serializeURIs(BeanT o,XMLSerializer w) throws AccessorException, SAXException {
  if (xacc.hasValue(o))   xacc.declareNamespace(o,w);
}

Fixed version (ground truth):
public void serializeURIs(BeanT o,XMLSerializer w) throws AccessorException, SAXException {
  xacc.declareNamespace(o,w);
}
Program: 190834
Project: 190834
Buggy source:
public final void serializeBody(BeanT o,XMLSerializer w,Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException {
  if (xacc.hasValue(o)) {
    w.text(xacc.print(o),fieldName);
  }
}

Fixed version (ground truth):
public final void serializeBody(BeanT o,XMLSerializer w,Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException {
  CharSequence value=xacc.print(o);
  if (value != null)   w.text(value,fieldName);
}
Program: 190835
Project: 190835
Buggy source:
public void declareNamespace(BeanT bean,XMLSerializer w) throws AccessorException {
  xducer.declareNamespace(acc.get(bean),w);
}

Fixed version (ground truth):
public void declareNamespace(BeanT bean,XMLSerializer w) throws AccessorException {
  Object o=acc.get(bean);
  if (o != null)   xducer.declareNamespace(o,w);
}
Program: 190836
Project: 190836
Buggy source:
protected PropertyInfoImpl(ClassInfoImpl<T,C,F,M> parent,PropertySeed<T,C,F,M> spi){
  this.seed=spi;
  this.parent=parent;
  this.id=calcId();
  MimeType mt=Util.calcExpectedMediaType(seed,parent.builder);
  if (mt != null && !kind().canHaveXmlMimeType) {
    parent.builder.reportError(new IllegalAnnotationException(Messages.ILLEGAL_ANNOTATION.format(XmlMimeType.class.getName()),seed.readAnnotation(XmlMimeType.class)));
    mt=null;
  }
  this.expectedMimeType=mt;
  this.inlineBinary=seed.hasAnnotation(XmlInlineBinaryData.class);
  this.schemaType=Util.calcSchemaType(reader(),seed,parent.clazz,getIndividualType(),this);
  T t=seed.getRawType();
  if (nav().isSubClassOf(t,nav().ref(Collection.class)) || nav().isArrayButNotByteArray(t))   this.isCollection=true;
 else   this.isCollection=false;
  XmlJavaTypeAdapter xjta=getApplicableAdapter(getIndividualType());
  if (xjta == null) {
    XmlAttachmentRef xsa=seed.readAnnotation(XmlAttachmentRef.class);
    if (xsa != null) {
      adapter=new Adapter<T,C>(nav().asDecl(SwaRefAdapter.class),nav());
    }
 else {
      adapter=null;
    }
  }
 else {
    adapter=new Adapter<T,C>(xjta,reader(),nav());
  }
}

Fixed version (ground truth):
protected PropertyInfoImpl(ClassInfoImpl<T,C,F,M> parent,PropertySeed<T,C,F,M> spi){
  this.seed=spi;
  this.parent=parent;
  this.id=calcId();
  MimeType mt=Util.calcExpectedMediaType(seed,parent.builder);
  if (mt != null && !kind().canHaveXmlMimeType) {
    parent.builder.reportError(new IllegalAnnotationException(Messages.ILLEGAL_ANNOTATION.format(XmlMimeType.class.getName()),seed.readAnnotation(XmlMimeType.class)));
    mt=null;
  }
  this.expectedMimeType=mt;
  this.inlineBinary=seed.hasAnnotation(XmlInlineBinaryData.class);
  this.schemaType=Util.calcSchemaType(reader(),seed,parent.clazz,getIndividualType(),this);
  T t=seed.getRawType();
  this.isCollection=nav().isSubClassOf(t,nav().ref(Collection.class)) || nav().isArrayButNotByteArray(t);
  XmlJavaTypeAdapter xjta=getApplicableAdapter(getIndividualType());
  if (xjta == null) {
    XmlAttachmentRef xsa=seed.readAnnotation(XmlAttachmentRef.class);
    if (xsa != null) {
      adapter=new Adapter<T,C>(nav().asDecl(SwaRefAdapter.class),nav());
    }
 else {
      adapter=null;
    }
  }
 else {
    adapter=new Adapter<T,C>(xjta,reader(),nav());
  }
}
Program: 190837
Project: 190837
Buggy source:
/** 
 * Checks if the given adapter is applicable to the declared property type.
 */
private boolean isApplicable(XmlJavaTypeAdapter jta,T declaredType){
  if (jta == null)   return false;
  T type=reader().getClassValue(jta,"String_Node_Str");
  if (declaredType.equals(type))   return true;
  return false;
}

Fixed version (ground truth):
/** 
 * Checks if the given adapter is applicable to the declared property type.
 */
private boolean isApplicable(XmlJavaTypeAdapter jta,T declaredType){
  if (jta == null)   return false;
  T type=reader().getClassValue(jta,"String_Node_Str");
  return declaredType.equals(type);
}
Program: 190838
Project: 190838
Buggy source:
private XmlJavaTypeAdapter getApplicableAdapter(T type){
  XmlJavaTypeAdapter jta=seed.readAnnotation(XmlJavaTypeAdapter.class);
  if (jta != null)   return jta;
  XmlJavaTypeAdapters jtas=reader().getPackageAnnotation(XmlJavaTypeAdapters.class,parent.clazz,seed);
  if (jtas != null) {
    for (    XmlJavaTypeAdapter xjta : jtas.value()) {
      if (isApplicable(xjta,type))       return xjta;
    }
  }
  jta=reader().getPackageAnnotation(XmlJavaTypeAdapter.class,parent.clazz,seed);
  if (isApplicable(jta,type))   return jta;
  C refType=nav().asDecl(seed.getRawType());
  if (refType != null) {
    jta=reader().getClassAnnotation(XmlJavaTypeAdapter.class,refType,seed);
    if (isApplicable(jta,type))     return jta;
  }
  return null;
}

Fixed version (ground truth):
private XmlJavaTypeAdapter getApplicableAdapter(T type){
  XmlJavaTypeAdapter jta=seed.readAnnotation(XmlJavaTypeAdapter.class);
  if (jta != null)   return jta;
  XmlJavaTypeAdapters jtas=reader().getPackageAnnotation(XmlJavaTypeAdapters.class,parent.clazz,seed);
  if (jtas != null) {
    for (    XmlJavaTypeAdapter xjta : jtas.value()) {
      if (isApplicable(xjta,type))       return xjta;
    }
  }
  jta=reader().getPackageAnnotation(XmlJavaTypeAdapter.class,parent.clazz,seed);
  if (isApplicable(jta,type))   return jta;
  C refType=nav().asDecl(seed.getRawType());
  if (refType != null) {
    jta=reader().getClassAnnotation(XmlJavaTypeAdapter.class,refType,seed);
    if (jta != null)     return jta;
  }
  return null;
}
Program: 190839
Project: 190839
Buggy source:
private final QName calcXmlName(String uri,String local){
  TODO.checkSpec();
  if (local.length() == 0 || local.equals("String_Node_Str"))   local=seed.getName();
  if (uri.equals("String_Node_Str")) {
    XmlSchema xs=reader().getPackageAnnotation(XmlSchema.class,parent.getClazz(),this);
    if (xs != null) {
switch (xs.elementFormDefault()) {
case QUALIFIED:
        uri=parent.getTypeName().getNamespaceURI();
      if (uri.length() == 0)       uri=parent.builder.defaultNsUri;
    break;
case UNQUALIFIED:
case UNSET:
  uri="String_Node_Str";
}
}
 else {
uri="String_Node_Str";
}
}
return new QName(uri.intern(),local.intern());
}

Fixed version (ground truth):
private QName calcXmlName(String uri,String local){
  TODO.checkSpec();
  if (local.length() == 0 || local.equals("String_Node_Str"))   local=seed.getName();
  if (uri.equals("String_Node_Str")) {
    XmlSchema xs=reader().getPackageAnnotation(XmlSchema.class,parent.getClazz(),this);
    if (xs != null) {
switch (xs.elementFormDefault()) {
case QUALIFIED:
        uri=parent.getTypeName().getNamespaceURI();
      if (uri.length() == 0)       uri=parent.builder.defaultNsUri;
    break;
case UNQUALIFIED:
case UNSET:
  uri="String_Node_Str";
}
}
 else {
uri="String_Node_Str";
}
}
return new QName(uri.intern(),local.intern());
}
Program: 190840
Project: 190840
Buggy source:
/** 
 * @param coreList A concrete class that implements the List interface. An instance of this class will be used to store data for this field.
 */
protected UntypedListField(ClassOutlineImpl context,CPropertyInfo prop,JClass coreList){
  super(context,prop,!coreList.name().equals("String_Node_Str"));
  this.coreList=coreList.narrow(exposedType.boxify());
  generate();
}

Fixed version (ground truth):
/** 
 * @param coreList A concrete class that implements the List interface. An instance of this class will be used to store data for this field.
 */
protected UntypedListField(ClassOutlineImpl context,CPropertyInfo prop,JClass coreList){
  super(context,prop,!coreList.fullName().equals("String_Node_Str"));
  this.coreList=coreList.narrow(exposedType.boxify());
  generate();
}
Program: 190841
Project: 190841
Buggy source:
/** 
 * Builds DOMForest and performs the internalization.
 * @throws SAXException when a fatal happe
 */
public DOMForest buildDOMForest(InternalizationLogic logic) throws SAXException {
  DOMForest forest=new DOMForest(logic);
  forest.setErrorHandler(errorReceiver);
  if (opt.entityResolver != null)   forest.setEntityResolver(opt.entityResolver);
  for (  InputSource value : opt.getGrammars())   forest.parse(value,true);
  for (  InputSource value : opt.getBindFiles()) {
    Element root=forest.parse(value,true).getDocumentElement();
    if (!root.getNamespaceURI().equals(Const.JAXB_NSURI) || !root.getLocalName().equals("String_Node_Str"))     errorReceiver.error(new SAXParseException(Messages.format(Messages.ERR_NOT_A_BINDING_FILE,root.getNamespaceURI(),root.getLocalName()),null,value.getSystemId(),-1,-1));
  }
  forest.transform();
  return forest;
}

Fixed version (ground truth):
/** 
 * Builds DOMForest and performs the internalization.
 * @throws SAXException when a fatal happe
 */
public DOMForest buildDOMForest(InternalizationLogic logic) throws SAXException {
  DOMForest forest=new DOMForest(logic);
  forest.setErrorHandler(errorReceiver);
  if (opt.entityResolver != null)   forest.setEntityResolver(opt.entityResolver);
  for (  InputSource value : opt.getGrammars())   forest.parse(value,true);
  for (  InputSource value : opt.getBindFiles()) {
    Document dom=forest.parse(value,true);
    if (dom == null)     continue;
    Element root=dom.getDocumentElement();
    if (!root.getNamespaceURI().equals(Const.JAXB_NSURI) || !root.getLocalName().equals("String_Node_Str"))     errorReceiver.error(new SAXParseException(Messages.format(Messages.ERR_NOT_A_BINDING_FILE,root.getNamespaceURI(),root.getLocalName()),null,value.getSystemId(),-1,-1));
  }
  forest.transform();
  return forest;
}