Changed all occurances of nsVector to use nsVoidArray in the OJI module.

This fixes part of bug #11666. r=ed.burns@eng.sun.com.

Contact me at mark.lin@eng.sun.com or (408) 517-5365 if there are problems.


git-svn-id: svn://10.0.0.236/trunk@54818 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mark.lin%eng.sun.com 1999-11-30 23:58:28 +00:00
parent eb56ef0b80
commit 2f9153f71a
4 changed files with 17 additions and 17 deletions

View File

@ -28,7 +28,7 @@
#include "nsISecureEnv.h"
#include "nsIJVMPlugin.h"
#include "nsHashtable.h"
#include "nsVector.h"
#include "nsVoidArray.h"
#include "plstr.h"
#include "ProxyJNI.h"
@ -67,7 +67,7 @@ static PRBool get_method_type(const char* sig, PRUint32& arg_count, jni_type*& a
{
arg_count = 0;
if (sig[0] == '(') {
nsVector vec(0, 10);
nsVoidArray vec;
++sig;
while (*sig != ')' && *sig) {
char arg_sig = *sig;
@ -83,12 +83,12 @@ static PRBool get_method_type(const char* sig, PRUint32& arg_count, jni_type*& a
}
// skip over scalar or ';'.
++sig;
vec.Add((void*)arg_type);
vec.AppendElement((void *) arg_type);
}
arg_count = vec.GetSize();
arg_count = vec.Count();
arg_types = new jni_type[arg_count];
for (int index = arg_count - 1; index >= 0; --index)
arg_types[index] = jni_type((jint)vec.Get(index));
arg_types[index] = jni_type((jint)vec.ElementAt(index));
if (*sig == ')') {
char return_sig = *++sig;
return_type = get_jni_type(return_sig);

View File

@ -27,7 +27,7 @@
#include "jni.h"
#include "nsISecureJNI2.h"
#include "nsHashtable.h"
#include "nsVector.h"
#include "nsVoidArray.h"
#include "plstr.h"
// Method Signature Processing.
@ -64,7 +64,7 @@ static PRBool get_method_type(const char* sig, PRUint32& arg_count, jni_type*& a
{
arg_count = 0;
if (sig[0] == '(') {
nsVector vec(10);
nsVoidArray vec;
++sig;
while (*sig != ')' && *sig) {
char arg_sig = *sig++;
@ -80,12 +80,12 @@ static PRBool get_method_type(const char* sig, PRUint32& arg_count, jni_type*& a
// skip over scalar or ';'.
++sig;
}
vec.Add((void*)arg_type);
vec.AppendElement((void*)arg_type);
}
arg_count = vec.GetSize();
arg_count = vec.Count();
arg_types = new jni_type[arg_count];
for (int index = arg_count - 1; index >= 0; --index)
arg_types[index] = jni_type(vec.Get(index));
arg_types[index] = jni_type(vec.ElementAt(index));
if (*sig == ')') {
char return_sig = *++sig;
return_type = get_jni_type(return_sig);

View File

@ -289,14 +289,14 @@ nsJVMManager::Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr)
nsJVMManager::nsJVMManager(nsISupports* outer)
: fJVM(NULL), fStatus(nsJVMStatus_Enabled),
fRegisteredJavaPrefChanged(PR_FALSE), fDebugManager(NULL), fJSJavaVM(NULL),
fClassPathAdditions(new nsVector()), fClassPathAdditionsString(NULL)
fClassPathAdditions(new nsVoidArray()), fClassPathAdditionsString(NULL)
{
NS_INIT_AGGREGATED(outer);
}
nsJVMManager::~nsJVMManager()
{
int count = fClassPathAdditions->GetSize();
int count = fClassPathAdditions->Count();
for (int i = 0; i < count; i++) {
PR_Free((*fClassPathAdditions)[i]);
}
@ -377,7 +377,7 @@ nsJVMManager::GetClasspathAdditions(const char* *result)
{
if (fClassPathAdditionsString != NULL)
PR_Free(fClassPathAdditionsString);
int count = fClassPathAdditions->GetSize();
int count = fClassPathAdditions->Count();
char* classpathAdditions = NULL;
for (int i = 0; i < count; i++) {
const char* path = (const char*)(*fClassPathAdditions)[i];
@ -776,7 +776,7 @@ nsJVMManager::AddToClassPath(const char* dirPath)
if ((len > 4) &&
((PL_strcasecmp(path+len-4, ".zip") == 0) ||
(PL_strcasecmp(path+len-4, ".jar") == 0))) {
fClassPathAdditions->Add((void*)path);
fClassPathAdditions->AppendElement((void*)path);
if (jvm) {
/* Add this path to the classpath: */
jvm->AddToClassPath(path);
@ -794,7 +794,7 @@ nsJVMManager::AddToClassPath(const char* dirPath)
}
/* Also add the directory to the classpath: */
fClassPathAdditions->Add((void*)dirPath);
fClassPathAdditions->AppendElement((void*)dirPath);
if (jvm) {
jvm->AddToClassPath(dirPath);
// jvm->Release(); // GetJVMPlugin no longer calls AddRef

View File

@ -35,7 +35,7 @@
#include "nsjvm.h"
#include "nsAgg.h"
#include "jsjava.h"
#include "nsVector.h"
#include "nsVoidArray.h"
#include "nsILiveConnectManager.h"
class nsSymantecDebugManager;
@ -204,7 +204,7 @@ protected:
PRBool fRegisteredJavaPrefChanged;
nsISupports* fDebugManager;
JSJavaVM * fJSJavaVM;
nsVector* fClassPathAdditions;
nsVoidArray* fClassPathAdditions;
char* fClassPathAdditionsString;
};