NS_WARNING("Problem creating org.mozilla.xpcom.XPCOMJavaProxy globals");
NS_WARNING("Problem creating org.mozilla.xpcom.internal.XPCOMJavaProxy globals");
InitializeJavaGlobals(JNIEnv *env){  if (gJavaXPCOMInitialized)    return PR_TRUE;  jclass clazz;  if (!(clazz = env->FindClass("java/lang/Object")) ||      !(hashCodeMID = env->GetMethodID(clazz, "hashCode","()I")))  {    NS_WARNING("Problem creating java.lang.Object globals");    goto init_error;  }  if (!(clazz = env->FindClass("java/lang/Boolean")) ||      !(booleanClass = (jclass) env->NewGlobalRef(clazz)) ||      !(booleanValueMID = env->GetMethodID(clazz, "booleanValue", "()Z")) ||      !(booleanInitMID = env->GetMethodID(clazz, "<init>", "(Z)V")))  {    NS_WARNING("Problem creating java.lang.Boolean globals");    goto init_error;  }  if (!(clazz = env->FindClass("java/lang/Character")) ||      !(charClass = (jclass) env->NewGlobalRef(clazz)) ||      !(charValueMID = env->GetMethodID(clazz, "charValue", "()C")) ||      !(charInitMID = env->GetMethodID(clazz, "<init>", "(C)V")))  {    NS_WARNING("Problem creating java.lang.Character globals");    goto init_error;  }  if (!(clazz = env->FindClass("java/lang/Byte")) ||      !(byteClass = (jclass) env->NewGlobalRef(clazz)) ||      !(byteValueMID = env->GetMethodID(clazz, "byteValue", "()B")) ||      !(byteInitMID = env->GetMethodID(clazz, "<init>", "(B)V")))  {    NS_WARNING("Problem creating java.lang.Byte globals");    goto init_error;  }  if (!(clazz = env->FindClass("java/lang/Short")) ||      !(shortClass = (jclass) env->NewGlobalRef(clazz)) ||      !(shortValueMID = env->GetMethodID(clazz, "shortValue", "()S")) ||      !(shortInitMID = env->GetMethodID(clazz, "<init>", "(S)V")))  {    NS_WARNING("Problem creating java.lang.Short globals");    goto init_error;  }  if (!(clazz = env->FindClass("java/lang/Integer")) ||      !(intClass = (jclass) env->NewGlobalRef(clazz)) ||      !(intValueMID = env->GetMethodID(clazz, "intValue", "()I")) ||      !(intInitMID = env->GetMethodID(clazz, "<init>", "(I)V")))  {    NS_WARNING("Problem creating java.lang.Integer globals");    goto init_error;  }  if (!(clazz = env->FindClass("java/lang/Long")) ||      !(longClass = (jclass) env->NewGlobalRef(clazz)) ||      !(longValueMID = env->GetMethodID(clazz, "longValue", "()J")) ||      !(longInitMID = env->GetMethodID(clazz, "<init>", "(J)V")))  {    NS_WARNING("Problem creating java.lang.Long globals");    goto init_error;  }  if (!(clazz = env->FindClass("java/lang/Float")) ||      !(floatClass = (jclass) env->NewGlobalRef(clazz)) ||      !(floatValueMID = env->GetMethodID(clazz, "floatValue", "()F")) ||      !(floatInitMID = env->GetMethodID(clazz, "<init>", "(F)V")))  {    NS_WARNING("Problem creating java.lang.Float globals");    goto init_error;  }  if (!(clazz = env->FindClass("java/lang/Double")) ||      !(doubleClass = (jclass) env->NewGlobalRef(clazz)) ||      !(doubleValueMID = env->GetMethodID(clazz, "doubleValue", "()D")) ||      !(doubleInitMID = env->GetMethodID(clazz, "<init>", "(D)V")))  {    NS_WARNING("Problem creating java.lang.Double globals");    goto init_error;  }  if (!(clazz = env->FindClass("java/lang/String")) ||      !(stringClass = (jclass) env->NewGlobalRef(clazz)))  {    NS_WARNING("Problem creating java.lang.String globals");    goto init_error;  }  if (!(clazz = env->FindClass("org/mozilla/xpcom/nsISupports")) ||      !(nsISupportsClass = (jclass) env->NewGlobalRef(clazz)))  {    NS_WARNING("Problem creating org.mozilla.xpcom.nsISupports globals");    goto init_error;  }  if (!(clazz = env->FindClass("org/mozilla/xpcom/XPCOMException")) ||      !(xpcomExceptionClass = (jclass) env->NewGlobalRef(clazz)))  {    NS_WARNING("Problem creating org.mozilla.xpcom.XPCOMException globals");    goto init_error;  }  if (!(clazz = env->FindClass("org/mozilla/xpcom/XPCOMJavaProxy")) ||      !(xpcomJavaProxyClass = (jclass) env->NewGlobalRef(clazz)) ||      !(createProxyMID = env->GetStaticMethodID(clazz, "createProxy",                                   "(Ljava/lang/Class;J)Ljava/lang/Object;")) ||      !(isXPCOMJavaProxyMID = env->GetStaticMethodID(clazz, "isXPCOMJavaProxy",                                                    "(Ljava/lang/Object;)Z")) ||      !(getNativeXPCOMInstMID = env->GetStaticMethodID(xpcomJavaProxyClass,                                                       "getNativeXPCOMInstance",                                                       "(Ljava/lang/Object;)J")))  {    NS_WARNING("Problem creating org.mozilla.xpcom.XPCOMJavaProxy globals");    goto init_error;  }#ifdef DEBUG_JAVAXPCOM  if (!(clazz = env->FindClass("java/lang/Class")) ||      !(getNameMID = env->GetMethodID(clazz, "getName","()Ljava/lang/String;")))  {    NS_WARNING("Problem creating java.lang.Class globals");    goto init_error;  }  if (!(proxyToStringMID = env->GetStaticMethodID(xpcomJavaProxyClass,                                                  "proxyToString",                                     "(Ljava/lang/Object;)Ljava/lang/String;")))  {    NS_WARNING("Problem creating proxyToString global");    goto init_error;  }#endif  gNativeToJavaProxyMap = new NativeToJavaProxyMap();  if (NS_FAILED(gNativeToJavaProxyMap->Init())) {    NS_WARNING("Problem creating NativeToJavaProxyMap");    goto init_error;  }  gJavaToXPTCStubMap = new JavaToXPTCStubMap();  if (NS_FAILED(gJavaToXPTCStubMap->Init())) {    NS_WARNING("Problem creating JavaToXPTCStubMap");    goto init_error;  }  gJavaXPCOMLock = PR_NewLock();  gJavaXPCOMInitialized = PR_TRUE;  return PR_TRUE;init_error:  // If we encounter an error during initialization, then free any globals that  // were allocated, and return false.  FreeJavaGlobals(env);  return PR_FALSE;}