Skip to content

07 — Resources

The primary sources

Everything in this library is checkable against these. Where a page makes a claim about why, it links the JEP or the spec section rather than paraphrasing it.

Sibling libraries

Same house style, same answer-key contract:

  • Encodings — bits, bytes, code points and UTF-8 from the bottom up. Read this one first if the words "code point" are new; this library assumes them.
  • Pythonstr vs bytes, the same boundary problems in a language that solved them differently.
  • RustString / &str / char, where char really is a code point and the compiler enforces it.

The three-way comparison is the point of having all of them: Java stores UTF-16 and calls a storage unit a char, Python stores code points and calls the count a len, Rust stores UTF-8 and refuses to index by character at all. Each choice buys something and costs something.

Tools worth having

  • Error Prone and SpotBugs both catch the locale-less toLowerCase() / String.format overloads. This is the single highest-value static check for text bugs in Java.
  • hexdump -C / xxd — the only reliable way to see a BOM, a stray CR, or a U+FFFD for what it is.
  • JMH — the OpenJDK's own benchmark harness. The only honest way to get a number out of a JVM; System.nanoTime() in a loop measures the JIT's warmup schedule as much as your code.
  • javap -c -p — reads the bytecode. The only way to see what + actually compiled to.
  • java -XshowSettings:properties -version — prints every property this library talks about, without writing a program.