Closed Bug 45928 Opened 24 years ago Closed 24 years ago

NativeDate uses getDeclaredConstructor instead of getConstructor

Categories

(Rhino Graveyard :: Core, defect, P3)

x86
Other
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: bdc, Assigned: norrisboyd)

Details

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.
Mike, do you see any problems with making this change?
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.
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
Closed: 24 years ago
Resolution: --- → FIXED
Verifying -
Status: RESOLVED → VERIFIED
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.