ProxyJNI::GetField implementation is wrong

RESOLVED WORKSFORME

Status

Core Graveyard
Java: OJI
RESOLVED WORKSFORME
15 years ago
8 years ago

People

(Reporter: Xiaobin Lu, Assigned: Kyle Yuan)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
Build Identifier: 

static jvalue GetField(JNIEnv* env, jobject obj, JNIField* field)
    {
        jvalue outValue;
        ProxyJNIEnv& proxyEnv = GetProxyEnv(env);
        nsISecureEnv* secureEnv = GetSecureEnv(env);
        nsISecurityContext* securityContext = proxyEnv.getContext();
        nsresult rv = secureEnv->GetField(field->mFieldType, obj, field-
>mFieldID, &outValue, securityContext);
        NS_IF_RELEASE(securityContext);
        return NS_SUCCEEDED(rv) ? outValue : kErrorValue;
    }

#define IMPLEMENT_GET_FIELD(methodName, returnType, 
jvalueField)                            \
    static returnType JNICALL methodName(JNIEnv *env, jobject obj, jfieldID 
fieldID)        \
    
{                                                                               
        \
        return GetField(env, obj, (JNIField*)
fieldID).jvalueField;                          \
    }                                                                           
            \

The GetField is called from Liveconnect module and the last parameter pointer 
passed from liveconect is jfieldID, but OJI casted it into JNIField which is 
totally wrong

Reproducible: Always

Steps to Reproduce:
1. Access http://javaweb.sfbay/~xl116366/LCTest/JavaArray/TavaArrayTest.html
2. Click the button
3. The pop up box displays nothing



Expected Results:  
It should print out the value

Comment 2

15 years ago
I test on Mozilla 1.4b
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b) Gecko/20030417
+
jre1.4.2

a dialog popup

Comment 3

15 years ago
Created attachment 127991 [details]
dialog screenshot

Comment 4

15 years ago
*** Bug 213029 has been marked as a duplicate of this bug. ***

Comment 5

15 years ago
Xiaobin:

is this bug invalid?

Thanks!

Comment 6

15 years ago
->kyle
Assignee: joshua.xia → kyle.yuan
Status: ASSIGNED → NEW
(Assignee)

Comment 7

15 years ago
mark WFM.
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → WORKSFORME

Updated

8 years ago
Component: Java: OJI → Java: OJI
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.