jobject jnode = env->AllocObject(JavaDOMGlobals::nodeClass); if (!jnode) { PR_LOG(JavaDOMGlobals::log, PR_LOG_ERROR, ("NodeList.item: failed to allocate object\n")); return NULL; }  env->SetLongField(jnode, JavaDOMGlobals::nodePtrFID, (jlong) node); if (env->ExceptionOccurred()) { PR_LOG(JavaDOMGlobals::log, PR_LOG_ERROR, ("NodeList.item: failed to set node ptr: %x\n", node)); return NULL; }  node->AddRef(); return jnode;
return JavaDOMGlobals::CreateNodeSubtype(env, node);
JNIEXPORT jobject JNICALL Java_org_mozilla_dom_NodeListImpl_item  (JNIEnv *env, jobject jthis, jint jindex){  nsIDOMNodeList* nodes = (nsIDOMNodeList*)     env->GetLongField(jthis, JavaDOMGlobals::nodeListPtrFID);  if (!nodes) {    PR_LOG(JavaDOMGlobals::log, PR_LOG_WARNING, 	   ("NodeList.item: NULL pointer\n"));    return NULL;  }  nsIDOMNode* node = NULL;  nsresult rv = nodes->Item((PRUint32) jindex, &node);  if (NS_FAILED(rv) || !node) {    PR_LOG(JavaDOMGlobals::log, PR_LOG_ERROR, 	   ("NodeList.item: failed (%x)\n", rv));    return NULL;  }  jobject jnode = env->AllocObject(JavaDOMGlobals::nodeClass);  if (!jnode) {    PR_LOG(JavaDOMGlobals::log, PR_LOG_ERROR, 	   ("NodeList.item: failed to allocate object\n"));    return NULL;  }  env->SetLongField(jnode, JavaDOMGlobals::nodePtrFID, (jlong) node);  if (env->ExceptionOccurred()) {    PR_LOG(JavaDOMGlobals::log, PR_LOG_ERROR, 	   ("NodeList.item: failed to set node ptr: %x\n", node));    return NULL;  }  node->AddRef();  return jnode;}