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 Change MOZILLA_HOME to MOZILLA_FIVE_HOME so that we dont fight Communicator 1999-03-11 20:00:57 +00:00
jsj Deleting obsolete contents of jsj directory 1998-09-24 00:32:24 +00:00
macbuild added files: mozilla/js/src/xpconnect/idl/xpctest2.idl 1999-07-16 20:35:58 +00:00
ref The files in this directory are all obsolete. JavaScript development 1998-10-16 22:18:00 +00:00
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 Tweaks 1999-04-27 05:08:14 +00:00
Makefile.in Adding libxpt and xpconnect to the build. 1999-03-25 07:50:11 +00:00
makefile.win removed jsj for MOZ_JAVA 1998-08-01 00:03:31 +00:00