*not part of the build*

fix for 57781, 57790


git-svn-id: svn://10.0.0.236/trunk@94968 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
idk%eng.sun.com
2001-05-15 06:47:45 +00:00
parent d0db178e2a
commit 24e28c7407
6 changed files with 47 additions and 29 deletions

View File

@@ -521,20 +521,24 @@ bcJavaMarshalToolkit::UnMarshalElement(jobject *value, uint8 ind, bcIUnMarshaler
size_t size;
jstring data = NULL;
if (um) {
um->ReadString(&data,&size,allocator);
{
for (int i = 0; i < size && type == bc_T_WCHAR_STR; i++) {
char c = ((char*)data)[i];
PR_LOG(log, PR_LOG_DEBUG,("--[c++] bcJavaMarshalToolkit::UnMarshalElement T_WCHAR_STR [%d] = %d %c\n",i,c,c));
char *str;
um->ReadString(&str,&size,allocator);
if (str != NULL) {
{
for (int i = 0; i < size && type == bc_T_WCHAR_STR; i++) {
char c = ((char*)data)[i];
PR_LOG(log, PR_LOG_DEBUG,("--[c++] bcJavaMarshalToolkit::UnMarshalElement T_WCHAR_STR [%d] = %d %c\n",i,c,c));
}
}
if (type == bc_T_CHAR_STR) {
data = env->NewStringUTF((const char*)str);
} else {
size-=2; size/=2;
data = env->NewString((const jchar*)str,size);
}
allocator->Free(str);
EXCEPTION_CHECKING(env);
}
if (type == bc_T_CHAR_STR) {
data = env->NewStringUTF((const char*)data);
} else {
size-=2; size/=2;
data = env->NewString((const jchar*)data,size);
}
EXCEPTION_CHECKING(env);
}
if ( ! isOut
&& (modifier == none) ) {

View File

@@ -146,7 +146,7 @@ void test() {
}
//sigsend(P_PID, getpid(),SIGINT);
//test->Test1(2000);
#if 1
#if 0
test->Test1(1000);
bcIJavaSample *test1;
if (NS_FAILED(r)) {
@@ -157,6 +157,7 @@ void test() {
test->QueryInterface(NS_GET_IID(bcIJavaSample),(void**)&test1);
int intArray[] = {1,2,3};
test->Test3(3, intArray);
#endif
{
char ** valueArray = (char **)malloc(sizeof(char*)*4);
valueArray[0] = "hi";
@@ -169,6 +170,7 @@ void test() {
printf("valueArray2[%d]=%s\n",i,(*valueArray2)[i]);
}
}
#if 0
{
nsIComponentManager* cm;
@@ -183,14 +185,18 @@ void test() {
}
printf("--[c++] bcJavaSample after test->Test5(cm)\n");
}
{
const char ** valueArray = (const char **)malloc(sizeof(char*)*4);
valueArray[0] = "hi";
valueArray[1] = "there";
valueArray[2] = "a";
valueArray[3] = "b";
//valueArray[3] = "b";
valueArray[3] = NULL;
test->Test6(4,valueArray);
}
{
printf("--[c++]about to test7\n");
PRUint32 count;
@@ -201,7 +207,7 @@ void test() {
}
printf("--[c++]end of test7\n");
}
#endif
{
printf("--[c++]about to test8\n");
@@ -215,6 +221,7 @@ void test() {
test->Test9(&cidParam);
printf("--[c++]end of test9\n");
}
#endif
printf("--BlackConnect test end\n");
}

View File

@@ -97,7 +97,7 @@ public class bcJavaSample implements bcIJavaSample {
for (int i = 0; i < array.length; i++) {
System.out.println("--[java]bcJavaSample.test4 valueArray["+i+"] = "+array[i]);
}
String[] returnArray = {"4","3","2","1"};
String[] returnArray = {"4","3","2",null};
valueArray[0] = returnArray;
}
/* void test5 (in nsIComponentManager cm); */