Jvm Pitfalls

Use when Java is written or reviewed and the risk is a silent wrong answer rather than a crash: comparing BigDecimal or boxed numbers, using an enum ordinal as a stored value, int arithmetic assigned to a long, String.split, java.util.Date or a week-year date pattern, the default charset, a public array constant, a method returning a list that is mutable on one path and immutable on another, an unclosed Files stream; locks, volatile counters, double-checked locking, wait loops, ThreadLocal fields; swallowed InterruptedException, ignored Future or CompletableFuture failures, a finally block that returns or throws; and null checking enforced in the build with NullAway.

techmefr Updated

File contents

techmefr/mentis commit a607fab2b8

Frequently asked questions

npx get-skill add techmefr/jvm-pitfalls