Bug 210353 - Improve documentation for overridingPackageDefaultMethod option in JavaCore#getDefaultOptions' javadoc
Summary: Improve documentation for overridingPackageDefaultMethod option in JavaCore#g...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Maxime Daniel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-20 03:26 EST by Maxime Daniel CLA
Modified: 2007-12-11 07:05 EST (History)
1 user (show)

See Also:
kent_johnson: review+


Attachments
Suggested fix (doc only) (1.62 KB, patch)
2007-11-23 09:11 EST, Maxime Daniel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maxime Daniel CLA 2007-11-20 03:26:00 EST
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').
Comment 1 Maxime Daniel CLA 2007-11-20 03:43:13 EST
Suggested by bug 208001 indeed.
Comment 2 Maxime Daniel CLA 2007-11-23 09:11:47 EST
Created attachment 83638 [details]
Suggested fix (doc only)
Comment 3 Maxime Daniel CLA 2007-11-23 09:12:24 EST
Kent, would you please let me know what you think?
Comment 4 Kent Johnson CLA 2007-11-23 10:15:24 EST
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.
Comment 5 Maxime Daniel CLA 2007-11-23 11:55:26 EST
Released for 3.4 M4.
(Adopted your suggestion, further fixing a 'a another' that came from my initial proposal.)
Comment 6 David Audel CLA 2007-12-11 07:05:42 EST
Verified for 3.4M4 using build I20071210-1800.