Java Strings And Text

Text in Java as encoded data rather than a universal type: UTF-16 code units versus code points versus graphemes, charsets and why the platform default is not a policy, locale-sensitive case and formatting including the Turkish-I bug, concatenation cost in loops versus single expressions, text blocks, regex compilation and catastrophic backtracking on untrusted input, interning, and injection through SQL, shells, paths and logs. Use when a String stands in for a type or compound key, when text is truncated by length(), when toLowerCase() or String.format() omits a Locale, when getBytes() omits a charset, when a Pattern is compiled in a loop or applied to user input, or when user text reaches SQL, a command or a log line. Numeric formatting is java-numeric-types, String standing in for a domain type as a smell is java-code-smells, and wire-format throughput is serialization-performance.

robsonkades 5a48975 4 files · 29.8 KB Updated

File contents

robsonkades/agent-skills/tree/main/skills/java-strings-and-text commit 5a48975fbc

Frequently asked questions

npx skillmds@latest add robsonkades/java-strings-and-text