I am learning Java Language Specification, and I have a problem about the meaning of "Observability of a Package" in JLS §7.4.3 - Observability of a Package:
A package is observable if and only if either:
- A compilation unit containing a declaration of the package is observable (§7.3).
- A subpackage of the package is observable.
My questions are
A subpackage of the package is observableThere are four concepts in JLS which it would be nice to precise:
1) A Compilation unit is observable 2) A Compilation unit is always observable 3) A Package is observable 4) A Package is always observable
1) Lets assume that Compilation unit "A" is observable. This means that Java compiler can somehow find this Compilation unit and parse/compile its content.
2) A Compilation unit is always observable if any compilation process independently of its properties can find and parse/compile this compilation unit. Usually Compilation units which are always observable are provided by Java implementors.
3) A package is observable if and only if there exist at least one compilation unit of this package that is observable or there exist at least one subpackage that is observable. Also I want to note that package still can contain compilation units or subpackages which are not observable.
4) A package is always observable if and only if there exist at least one compilation unit of this package that is always observable or there exist at least one subpackage that is always observable. Usually subpackages which are always observable are provided by Java implementors. Also I want to note that package still can contain compilation units or subpackages which are not observable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With