Java Reference
In-Depth Information
hide One class field hides a field in a superclass if they have the same identifier. The hid-
den field is not accessible from the class. Likewise, a class method hides a method in a
superclass if they have the same identifier, but incompatible signatures. The hidden meth-
od is not accessible from the class. See the JLS, §8.4.8.2, “Hiding (by Class Methods)”
[JLS 2013] for the formal definition. Contrast with override.
immutable When applied to an object, immutable means that its state cannot be changed
after being initialized. An object is immutable if
Its state cannot be modified after construction;
All its fields are final; and
It is properly constructed (the this reference does not escape during construction)
[Goetz 2006].
It is technically possible to have an immutable object without all fields being final .
String is such a class but this relies on delicate reasoning about benign data races that
requires a deep understanding of the Java Memory Model.
liveness Every operation or method invocation executes to completion without interrup-
tions, even if it goes against safety.
memory model “The rules that determine how memory accesses are ordered and when
they are guaranteed to be visible are known as the memory model of the Java program-
ming language” [Arnold 2006]. “A memory model describes, given a program and an ex-
ecution trace of that program, whether the execution trace is a legal execution of the pro-
gram” [JLS 2013, §17.4, “Memory Model”].
normalization Lossyconversion ofthe data toits simplest known(andanticipated) form.
“When implementations keep strings in a normalized form, they can be assured that equi-
valent strings have a unique binary representation” [Davis 2008].
obscure One scoped identifier obscures another identifier in a containing scope if the two
identifiers are the same but the obscuring identifier does not shadow the obscured identi-
fier. This can happen if the obscuring identifier is a variable and the obscured identifier is
a type, for example. See the JLS, §6.4.2, “Obscuring” [JLS 2013], for more information.
override Oneclassmethodoverridesamethodinasuperclassiftheyhavecompatiblesig-
natures. The overridden method is still accessible from the class via the super keyword.
See the JLS, §8.4.8.1, “Overriding (by Instance Methods)” [JLS 2013], for the formal
definition. Contrast with hide.
publishing objects “Publishing an object means making it available to code outside of its
current scope, such as by storing a reference to it where other code can find it, returning it
from a nonprivate method, or passing it to a method in another class” [Goetz 2006].
Search WWH ::




Custom Search