Community
Participate
Working Groups
Source based, v_824. Suggested by bug 2008001. Quoting JLS 3, 'The default access is that a member can be accessed anywhere within the package that contains its declaration; other possibilities are public, protected, and private.'. This tells us that by default access to a method is granted to all places in the same package, and that non-default access is specified by public, protected or private. It falls short of defining what a 'Package-Default Method' or 'A package default method' could be. I could not find the definition of that concept anywhere else in the spec.. Accordingly, unless someone else can exhibit a satisfying definition, I'd support our editing the matching lines in JavaCore#getDefaultOptions' javadoc. Note that the name of the constant does not absolutely need to change though, since it can be seen as an acceptable contraction for 'package or default' (or even, 'default hence package').
Suggested by bug 208001 indeed.
Created attachment 83638 [details] Suggested fix (doc only)
Kent, would you please let me know what you think?
I would suggest a minor change: A package visible method, which is any method that is not explicitly declared as public, protected or private, is not visible from other packages, and thus cannot be overridden from another package. Attempting to override a package visible method from a another package introduces a new method that is unrelated to the original one. When enabling this option, the compiler will signal such situations as an error or a warning.
Released for 3.4 M4. (Adopted your suggestion, further fixing a 'a another' that came from my initial proposal.)
Verified for 3.4M4 using build I20071210-1800.