Mark Wielaard wrote: > On Thu, 2006-03-30 at 13:09 +0200, Jeroen Frijters wrote: > > I've added a new access modifier to IKVM. By applying the > > @ikvm.lang.Internal annotation to a type or member, you can > > mark it as internal to the library it resides in. Hopefully > > Java will provide something similar with JSR 277, but I've > > decided not to wait on that. > > > > To support this access level with reflection, I've modified > > Method/Constructor/Field (of which I include my own > > versions with IKVM, so that was easy), but I also need to > > modify Class.newInstance(). > > > > Would anybody object to adding a hook for this? > > This looks OK and not too invasive. But I would like to see as little > extensions added as possible so let me propose a hack that might > prevent having to add the hook. Couldn't you override setAccessible() > so that it throws an exception when you try to set it to true on an > "internal" Constructor? That seems to have the same effect. Thanks for taking the time to respond. I don't think hacking setAccessible would help, but maybe I'm misunderstanding your suggestion. The idea is that code can benefit from the @Internal access modifier, without having to be modified (e.g. that I can use it to make the gnu.* classes private to the IKVM.GNU.Classpath.dll assembly). Regards, Jeroen