Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need an annotation for access widening #12

Open
GoogleCodeExporter opened this issue Oct 9, 2015 · 0 comments
Open

Need an annotation for access widening #12

GoogleCodeExporter opened this issue Oct 9, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

Accidental method access widening is a big problem.  Often the consequence 
is that the API is cluttered with additional (and unnecessary) public 
methods, but in some cases widening could lead to unexpected 
interactions.  JCompoent.paintComponent method is frequently overridden 
and widened to no useful effect.  Such an annotation would provide the 
user with a clear warning that he has done something unexpected.

Conversely, there is the case where we expect that the access is widened 
(to public).  The ever-problematic Object.clone is such a method.  Users 
should be warned if they override Object.clone, but do not widen access to 
the method.

I am proposing the addition of two annotations:
AccessWideningProhibited
AccessWideningRequired

Theorectically, we could also include the middle ground, but that seems 
overwrought to me:
AccessWideningPermitted

Thanks,

Karl Schaefer

Original issue reported on code.google.com by [email protected] on 4 Feb 2009 at 2:27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant