~/talk

How «final» is final?

Talkat Joker 2015 · 2015-10-16..10-17· [java, compilers-and-language-design]
links:none on file
slides:none on file

Shows that Java's "final" differs between the language and the JVM: the compiler enforces single assignment while bytecode/JVM allows multiple assigns inside constructors and static initializers, and JIT can replace field reads with constants (demo: warmup loop of 20,000 iterations yields stale 42 vs updated 99). Demonstrates concrete hacks that mutate finals: JNI, reflection (setAccessible + clearing the FINAL modifier), Unsafe/MethodHandles, notes Java 8 ASM availability and a JDK9 module/startup bug, and shows these tricks can crash or silently break optimizations.

AI-written summary · about

  1. 0:00Introduction to final in Java
  2. 1:51Final variable initialization rules
  3. 6:48Final field escape during construction
  4. 10:05Changing final values with JNI
  5. 11:52Changing final values with reflection
  6. 19:38Final fields as compile-time constants
  7. 23:54JIT compiler optimizations on final fields
  8. 33:59Solutions to prevent final field issues
  9. 48:19Performance impact of final
  10. 58:09Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.