This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Illegal Package-Private Accesses in 3.4


Hi,

On Mon, 2003-08-11 at 01:27, Bryce McKinlay wrote:
> On Monday, Aug 11, 2003, at 09:23 Pacific/Auckland, Mark Wielaard wrote:
> >
> > It seems to me that the best thing to do is to move StackTrace to the
> > java.lang package and make it package private to prevent any 'illegal'
> > access to this class by user code.
> 
> Lets have a look at where stackTraceAddrs() is being used in 
> VMThrowable:
> 
> 	NameFinder nameFinder = new NameFinder();
> 	result = nameFinder.lookup(t, trace.stackTraceAddrs(),
> 				   trace.length());
> 
> Since NameFinder and StackTrace are both in the same package, wouldn't 
> a simpler solution be to pass "trace" itself and have NameFinder call 
> the stackTraceAddrs?

But for not just this, but also for the public access reason (and
because StackTrace does have some nice methods that will be useful for
implementing some of the SecurityManger things) StackTrace and
NameFinder are no longer in the same package (with my patch).

> It would be cleaner to keep these things in the same package wherever 
> possible. If we're worried about user code calling NameFinder being a 
> security risk, we could add a security check to its constructor.

Then I would vote for moving NameFinder also inside java.lang as package
private. Although I am not worried about user code calling it directly.
(As I am with StackTrace.)

Cheers,

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]