NativeDate uses getDeclaredConstructor instead of getConstructor

VERIFIED FIXED

Status

Rhino
Core
P3
normal
VERIFIED FIXED
18 years ago
18 years ago

People

(Reporter: Brian D. Carlstrom, Assigned: Norris Boyd)

Tracking

Details

(Reporter)

Description

18 years ago
We had to make the following change to NativeDate.java to get it to work in the 
browser in the applet sandbox. Note that there is no reason to call the version 
that even can access the private constructors, since it's a public constructor 
it's looking for. I believe that this affects both Netscape and IE.

use getConstructor() instead of getDeclaredConstructor(). This is because
reflective access to the native data formatter is restricted in the browser.
(Assignee)

Comment 1

18 years ago
Mike, do you see any problems with making this change?

Comment 2

18 years ago
Why does getDeclaredConstructor fail and getConstructor succeed, when the
constructor in question is public?

Looks like the methods are equivalent in this case.  This change looks fine to
me.
(Assignee)

Comment 3

18 years ago
Checking in org/mozilla/javascript/NativeDate.java;
/cvsroot/mozilla/js/rhino/org/mozilla/javascript/NativeDate.java,v  <--  NativeD
ate.java
new revision: 1.9; previous revision: 1.8
done
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Comment 4

18 years ago
Verifying -
Status: RESOLVED → VERIFIED
(Reporter)

Comment 5

18 years ago
Thanks a lot for fixing this. I agree that it is lame for getDeclaredConstuctor 
to fail if it is in fact asking for a public method, but all the getDeclared* 
work this way.
You need to log in before you can comment on or make changes to this bug.