gecko-dev/js
norris%netscape.com d055865e6d Fix problem found by Andrew Wason <aw@softcom.com>:
Subject:
        reflection and illegal package access
   Date:
        Wed, 04 Aug 1999 21:56:20 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com (Norris Boyd)
    CC:
        Howard Lin <howard@softcom.com>




If you run Rhino under JDK1.2 with a security manager:

java -Djava.security.manager=java.lang.SecurityManager
org.mozilla.javascript.tools.shell.Main

Then reflection fails for objects that are in a restricted access package
(e.g. sun.*).  Rhino is reflecting based on the dynamic type of the object
instead of the declared static return type.

In this example, createImage is declared to return java.awt.Image, but it
returns sun.awt.image.OffScreenImage.  Attempting to reflect this class
results in a java.security.AccessControlException for
java.lang.RuntimePermission accessClassInPackage.sun.awt.image.

Here is the script.  You will need to type it in because you won't be able
to load it from a file due to the security manager.

var f = new java.awt.Frame();
f.setVisible(true);
var i = f.createImage(10,10);
1999-08-05 16:49:20 +00:00
..
benchmarks Add benchmarks. 1999-06-04 18:44:17 +00:00
js2/java Changes to get traditional functions with args. working 1999-06-15 00:57:05 +00:00
jsd updating readme 1999-06-01 02:31:13 +00:00
jsdj
jsj
macbuild added files: mozilla/js/src/xpconnect/idl/xpctest2.idl 1999-07-16 20:35:58 +00:00
ref
rhino Fix problem found by Andrew Wason <aw@softcom.com>: 1999-08-05 16:49:20 +00:00
semantics Updated for recent semantic engine changes. Changed the meaning of (?= to match Perl. 1999-07-27 01:05:59 +00:00
src Added Linux/sparc component 1999-08-04 20:46:58 +00:00
tests Fixed tests for back-reference case 1999-08-04 23:40:13 +00:00
.cvsignore more anal tricks. 1999-06-26 05:01:40 +00:00
landbranch.pl
Makefile.in
makefile.win