nsresult rv = NS_NewLocalFile(*path, false, aLocalFile); delete path; return rv;
if (!path) rv = NS_ERROR_OUT_OF_MEMORY;  if (NS_SUCCEEDED(rv)) { rv = NS_NewLocalFile(*path, false, aLocalFile); delete path; }
File_to_nsILocalFile(JNIEnv* env, jobject aFile, nsILocalFile** aLocalFile){  jstring pathName = nsnull;  jclass clazz = env->FindClass("java/io/File");  if (clazz) {    jmethodID pathMID = env->GetMethodID(clazz, "getCanonicalPath",                                         "()Ljava/lang/String;");    if (pathMID) {      pathName = (jstring) env->CallObjectMethod(aFile, pathMID);    }  }  if (pathName) {    nsAString* path = jstring_to_nsAString(env, pathName);    nsresult rv = NS_NewLocalFile(*path, false, aLocalFile);    delete path;    return rv;  }  return NS_ERROR_FAILURE;}