Program: 64654
Project: 64654
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) {
          String prefix=XMLConstants.EMPTY_STRING;
          int nsIndex=attributeLocalName.indexOf(namespaceSeparator);
          if (nsIndex > -1) {
            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;
}

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) {
          if (attributeLocalName.length() > 2) {
            String prefix=XMLConstants.EMPTY_STRING;
            int nsIndex=attributeLocalName.indexOf(namespaceSeparator,1);
            if (nsIndex > -1) {
              prefix=attributeLocalName.substring(0,nsIndex);
            }
            uri=namespaces.resolveNamespacePrefix(prefix);
            if (uri == null) {
              uri=namespaces.getDefaultNamespaceURI();
            }
 else {
              attributeLocalName=attributeLocalName.substring(nsIndex + 1);
            }
          }
 else {
            uri=namespaces.getDefaultNamespaceURI();
          }
        }
        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;
}