Program: 68257
Project: 68257
Buggy source:
public SchemaTypeInfo addClass(JavaClass javaClass){
  if (javaClass == null) {
    return null;
  }
  if (typeInfo == null) {
    this.typeInfoClasses=new ArrayList<JavaClass>();
    this.typeInfo=new HashMap<String,TypeInfo>();
    this.userDefinedSchemaTypes=new HashMap<String,QName>();
    this.packageToNamespaceMappings=new HashMap<String,NamespaceInfo>();
    this.namespaceResolver=new NamespaceResolver();
  }
  TypeInfo info=createTypeInfoFor(javaClass);
  NamespaceInfo namespaceInfo;
  JavaPackage pack=javaClass.getPackage();
  namespaceInfo=this.packageToNamespaceMappings.get(pack.getQualifiedName());
  SchemaTypeInfo schemaInfo=new SchemaTypeInfo();
  schemaInfo.setSchemaTypeName(new QName(info.getClassNamespace(),info.getSchemaTypeName()));
  if (helper.isAnnotationPresent(javaClass,XmlRootElement.class)) {
    XmlRootElement rootElemAnnotation=(XmlRootElement)helper.getAnnotation(javaClass,XmlRootElement.class);
    String elementName=rootElemAnnotation.name();
    if (elementName.equals("String_Node_Str") || elementName.equals("String_Node_Str")) {
      if (javaClass.getName().indexOf("String_Node_Str") != -1) {
        elementName=Introspector.decapitalize(javaClass.getName().substring(javaClass.getName().lastIndexOf('$') + 1));
      }
 else {
        elementName=Introspector.decapitalize(javaClass.getName().substring(javaClass.getName().lastIndexOf('.') + 1));
      }
    }
    String rootNamespace=rootElemAnnotation.namespace();
    QName rootElemName=null;
    if (rootNamespace.equals("String_Node_Str")) {
      rootElemName=new QName(namespaceInfo.getNamespace(),elementName);
    }
 else {
      rootElemName=new QName(rootNamespace,elementName);
    }
    schemaInfo.getGlobalElementDeclarations().add(rootElemName);
    ElementDeclaration declaration=new ElementDeclaration(rootElemName,javaClass.getRawName());
    this.globalElements.put(rootElemName,declaration);
  }
  return schemaInfo;
}

Fixed version (ground truth):
public SchemaTypeInfo addClass(JavaClass javaClass){
  if (javaClass == null) {
    return null;
  }
  if (typeInfo == null) {
    this.typeInfoClasses=new ArrayList<JavaClass>();
    this.typeInfo=new HashMap<String,TypeInfo>();
    this.userDefinedSchemaTypes=new HashMap<String,QName>();
    this.packageToNamespaceMappings=new HashMap<String,NamespaceInfo>();
    this.namespaceResolver=new NamespaceResolver();
  }
  TypeInfo info=createTypeInfoFor(javaClass);
  NamespaceInfo namespaceInfo;
  JavaPackage pack=javaClass.getPackage();
  namespaceInfo=this.packageToNamespaceMappings.get(pack.getQualifiedName());
  SchemaTypeInfo schemaInfo=new SchemaTypeInfo();
  schemaInfo.setSchemaTypeName(new QName(info.getClassNamespace(),info.getSchemaTypeName()));
  if (helper.isAnnotationPresent(javaClass,XmlRootElement.class)) {
    XmlRootElement rootElemAnnotation=(XmlRootElement)helper.getAnnotation(javaClass,XmlRootElement.class);
    String elementName=rootElemAnnotation.name();
    if (elementName.equals("String_Node_Str") || elementName.equals("String_Node_Str")) {
      if (javaClass.getName().indexOf("String_Node_Str") != -1) {
        elementName=Introspector.decapitalize(javaClass.getName().substring(javaClass.getName().lastIndexOf('$') + 1));
      }
 else {
        elementName=Introspector.decapitalize(javaClass.getName().substring(javaClass.getName().lastIndexOf('.') + 1));
      }
    }
    String rootNamespace=rootElemAnnotation.namespace();
    QName rootElemName=null;
    if (rootNamespace.equals("String_Node_Str")) {
      rootElemName=new QName(namespaceInfo.getNamespace(),elementName);
    }
 else {
      rootElemName=new QName(rootNamespace,elementName);
    }
    schemaInfo.getGlobalElementDeclarations().add(rootElemName);
    ElementDeclaration declaration=new ElementDeclaration(rootElemName,javaClass,javaClass.getRawName());
    this.globalElements.put(rootElemName,declaration);
  }
  return schemaInfo;
}