public inbox for mauve-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Raif S. Naffah" <raif@fl.net.au>
To: Stephen Crawley <crawley@dstc.edu.au>, Brian Jones <cbj@gnu.org>
Cc: Stephen Crawley <crawley@dstc.edu.au>,
	classpath@gnu.org, Mauve <mauve-discuss@sources.redhat.com>
Subject: Re: classpath ./ChangeLog ./THANKYOU ./configure.in...
Date: Mon, 07 Apr 2003 22:59:00 -0000	[thread overview]
Message-ID: <200304080852.47734.raif@fl.net.au> (raw)
In-Reply-To: <200304071608.h37G8siE021877@piglet.dstc.edu.au>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

hello Steve,

On Tue, 8 Apr 2003 02:09 am, Stephen Crawley wrote:
> > Stephen Crawley <crawley@dstc.edu.au> writes:
> > > I can confirm that there really is a problem running some of the
> > > Mauve security testlets under the latest Kissme, Classpath and
> > > Mauve.  It appears to be a Kissme class loading problem, rather
> > > than the fault of the Classpath security implementation.  I'm
> > > trying to get to the bottom of it ...
>
> The "bottom of it" is that the problem was not in Kissme or Classpath
> at all!

good catch!  mea culpa.


> The problem was that the failing test cases' constructors were not
> declared public.  On Kissme, this (correctly IMO) caused the call to
> 'Class.newInstance' to throw an InstantiationException...

shouldnt this be an IllegalAccessException?  as the docs states this 
exception is thrown "...if the class or its nullary constructor is not 
accessible."

also, is it legal for a JVM to try altering the accessibility of a 
non-public, but nullary ctor, before bailing out, and then and only 
then throw an InstantiationException?  the accessibility of a ctor can 
be altered as follows:

/** Instantiate a class with a 0-arguments ctor. */
private static Object makeNewInstance0(String className) {
   Class c = null;
   Constructor ctor = null;
   Object result = null;
   try {
      c = Class.forName(className);
      ctor = c.getConstructor(null);
      result = c.newInstance();
   } catch (IllegalAccessException x) {
      System.out.println("  * no --IllegalAccessException;"
            +"will attempt altering Accessibility...");
      boolean accessible = ctor.isAccessible();
      if (accessible)
         System.out.println("  * no --unable to, "
               +"although it's accessible...");
      else {
         try {
            ctor.setAccessible(true);
            result = ctor.newInstance(null);
         } catch (SecurityException y) {
            System.out.println("  * no --a SecurityManager "
                  +"is forbidding us to...");
         } catch (Exception y) { // should not happen
            y.printStackTrace(System.err);
         }
      }
   } catch (Exception x) {
      x.printStackTrace(System.err);
   }
   return result;
}

cheers;
rsn
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Que du magnifique

iD8DBQE+kgE++e1AKnsTRiERA6JpAKDHogUsoAjDsHjq7buP+ahhO0warQCg349t
3sxj20HEsX47Y/UPdfrJsng=
=KNJD
-----END PGP SIGNATURE-----

  reply	other threads:[~2003-04-07 22:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m3istrt1zv.fsf@lyta.haphazard.org>
2003-04-07 16:09 ` Stephen Crawley
2003-04-07 22:59   ` Raif S. Naffah [this message]
2003-04-07 23:32     ` Stephen Crawley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200304080852.47734.raif@fl.net.au \
    --to=raif@fl.net.au \
    --cc=cbj@gnu.org \
    --cc=classpath@gnu.org \
    --cc=crawley@dstc.edu.au \
    --cc=mauve-discuss@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).