Program: 65137
Project: 65137
Buggy source:
@Override protected Attribute[] attributes(){
  if (null == attributes) {
    if (tree.getType() == JSONLexer.NULL) {
      attributes=new Attribute[1];
      attributes[0]=new Attribute(XMLConstants.SCHEMA_INSTANCE_URL,XMLConstants.SCHEMA_NIL_ATTRIBUTE,XMLConstants.SCHEMA_NIL_ATTRIBUTE,"String_Node_Str");
      return attributes;
    }
    if (tree.getType() == JSONLexer.OBJECT) {
      ArrayList<Attribute> attributesList=new ArrayList<Attribute>(tree.getChildCount());
      for (int x=0; x < tree.getChildCount(); x++) {
        Tree childTree=tree.getChild(x);
        String attributeLocalName=childTree.getChild(0).getText().substring(1,childTree.getChild(0).getText().length() - 1);
        if (attributePrefix != null) {
          if (attributeLocalName.startsWith(attributePrefix)) {
            attributeLocalName=attributeLocalName.substring(attributePrefix.length());
          }
 else {
            break;
          }
        }
        String uri=XMLConstants.EMPTY_STRING;
        if (namespaceAware && namespaces != null) {
          int nsIndex=attributeLocalName.indexOf(namespaceSeparator);
          if (nsIndex > -1) {
            String prefix=attributeLocalName.substring(0,nsIndex);
            attributeLocalName=attributeLocalName.substring(nsIndex + 1);
            uri=namespaces.resolveNamespacePrefix(prefix);
          }
        }
        Tree childValueTree=childTree.getChild(1);
        if (childValueTree.getType() == JSONLexer.ARRAY) {
          for (int y=0, size=childValueTree.getChildCount(); y < size; y++) {
            CommonTree nextChildTree=(CommonTree)childValueTree.getChild(y);
            addSimpleAttribute(attributesList,uri,attributeLocalName,nextChildTree);
          }
        }
 else {
          addSimpleAttribute(attributesList,uri,attributeLocalName,childValueTree);
        }
      }
      attributes=attributesList.toArray(new Attribute[attributesList.size()]);
    }
 else {
      attributes=NO_ATTRIBUTES;
    }
  }
  return attributes;
}

Fixed version (ground truth):
@Override protected Attribute[] attributes(){
  if (null == attributes) {
    if (tree.getType() == JSONLexer.NULL) {
      attributes=new Attribute[1];
      attributes[0]=new Attribute(XMLConstants.SCHEMA_INSTANCE_URL,XMLConstants.SCHEMA_NIL_ATTRIBUTE,XMLConstants.SCHEMA_NIL_ATTRIBUTE,"String_Node_Str");
      return attributes;
    }
    if (tree.getType() == JSONLexer.OBJECT) {
      ArrayList<Attribute> attributesList=new ArrayList<Attribute>(tree.getChildCount());
      for (int x=0; x < tree.getChildCount(); x++) {
        Tree childTree=tree.getChild(x);
        String attributeLocalName=childTree.getChild(0).getText().substring(1,childTree.getChild(0).getText().length() - 1);
        if (attributePrefix != null) {
          if (attributeLocalName.startsWith(attributePrefix)) {
            attributeLocalName=attributeLocalName.substring(attributePrefix.length());
          }
 else {
            break;
          }
        }
        String uri=XMLConstants.EMPTY_STRING;
        if (namespaceAware && namespaces != null) {
          int nsIndex=attributeLocalName.indexOf(namespaceSeparator);
          if (nsIndex > -1) {
            String prefix=attributeLocalName.substring(0,nsIndex);
            attributeLocalName=attributeLocalName.substring(nsIndex + 1);
            uri=namespaces.resolveNamespacePrefix(prefix);
          }
        }
        Tree childValueTree=childTree.getChild(1);
        if (childValueTree.getType() == JSONLexer.ARRAY) {
          int size=childValueTree.getChildCount();
          if (size == 0) {
            attributesList.add(new Attribute(uri,attributeLocalName,attributeLocalName,"String_Node_Str"));
          }
          for (int y=0; y < size; y++) {
            CommonTree nextChildTree=(CommonTree)childValueTree.getChild(y);
            addSimpleAttribute(attributesList,uri,attributeLocalName,nextChildTree);
          }
        }
 else {
          addSimpleAttribute(attributesList,uri,attributeLocalName,childValueTree);
        }
      }
      attributes=attributesList.toArray(new Attribute[attributesList.size()]);
    }
 else {
      attributes=NO_ATTRIBUTES;
    }
  }
  return attributes;
}