JavaXPCOMInstance* inst = nsnull;
nsCOMPtr<nsIInterfaceInfoManager> iim = XPTI_GetInterfaceInfoManager(); NS_ASSERTION(iim != nsnull, "Failed to get InterfaceInfoManager"); if (!iim) return NS_ERROR_FAILURE;
CreateJavaXPCOMInstance(nsISupports* aXPCOMObject, const nsIID* aIID){  JavaXPCOMInstance* inst = nsnull;  // Get interface info for class  nsCOMPtr<nsIInterfaceInfoManager> iim = XPTI_GetInterfaceInfoManager();  NS_ASSERTION(iim != nsnull, "Failed to get InterfaceInfoManager");  if (iim) {    nsCOMPtr<nsIInterfaceInfo> info;    iim->GetInfoForIID(aIID, getter_AddRefs(info));    // Wrap XPCOM object    inst = new JavaXPCOMInstance(aXPCOMObject, info);  }  return inst;}