Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!newsfeed.CARNet.hr!garrison.bnet.hr!gregory.BNet.hr!not-for-mail From: Josip Almasi Newsgroups: comp.lang.java.programmer Subject: Re: Accessibility of suBclass-fields from suPERclass (reflection) Date: Sat, 16 Aug 2014 12:31:20 +0200 Organization: B.net Hrvatska d.o.o. Lines: 19 Message-ID: References: <53eecf6a$0$300$14726298@news.sunsite.dk> NNTP-Posting-Host: 109.60.124.207 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: gregory.bnet.hr 1408185080 14618 109.60.124.207 (16 Aug 2014 10:31:20 GMT) X-Complaints-To: abuse@globalnet.hr NNTP-Posting-Date: Sat, 16 Aug 2014 10:31:20 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:29693 On 08/16/2014 10:46 AM, Andreas Leitgeb wrote: > > Consistent maybe, but why cannot Base access these fields by default? > > I'm not complaining about that extra setAccessibility(true), I just > would like to see an example of where a Base-class accessing its children > could be a security issue. I'm not talking of some arbitrary class > attempting access, but about the target class's parent (or grandparent) > class. I think it's an unintended side-effect of language design - setters/getters everywhere, variables are evil, use them only locally. Unintended like, 'protected' means visible to subclasses, noone ever mentioned superclass. So, superclass is treated just as any other class. I don't think there's any security issue specific to superclass. Regards...