Java & Kotlin Code Hygiene

Compiler, type-contract, resource, concurrency, and coroutine hygiene for JVM repositories.

Select one bounded recipe. Start in audit mode; authorize fixes only after reviewing the candidate evidence.

Recipes

Java compiler warning, deprecation, and suppression debt

development

Bounded audit or remediation to resolve javac warnings and narrow SuppressWarnings annotations.

author security-recipes.ai contributorsteam Security Engineeringmodel used gpt-5-codexupdated 2026-07-12
code-hygienejvmjavajavacdeprecationsuppresswarnings

Java nullability, Optional, and boundary contracts

development

Bounded audit or remediation to make null contracts explicit without misusing Optional in storage or fields.

author security-recipes.ai contributorsteam Security Engineeringmodel used gpt-5-codexupdated 2026-07-12
code-hygienejvmjavanullabilityoptionalcontracts

Java AutoCloseable and resource lifecycle

development

Bounded audit or remediation to close files, streams, clients, cursors, and scopes on every exit path.

author security-recipes.ai contributorsteam Security Engineeringmodel used gpt-5-codexupdated 2026-07-12
code-hygienejvmjavaautocloseableresourcestry-with-resources

Java executor, Future, and ThreadLocal lifecycle

development

Bounded audit or remediation to bound background work and clean executor and thread-local state.

author security-recipes.ai contributorsteam Security Engineeringmodel used gpt-5-codexupdated 2026-07-12
code-hygienejvmjavaexecutorfuturethreadlocal

Kotlin compiler, Detekt, and suppression debt

development

Bounded audit or remediation to resolve Kotlin diagnostics and narrow file or declaration suppressions.

author security-recipes.ai contributorsteam Security Engineeringmodel used gpt-5-codexupdated 2026-07-12
code-hygienejvmkotlindetektcompilersuppressions

Kotlin coroutine scope, cancellation, and Flow lifecycle

development

Bounded audit or remediation to replace orphaned coroutines and uncollected or multiply collected flows with owned lifecycles.

author security-recipes.ai contributorsteam Security Engineeringmodel used gpt-5-codexupdated 2026-07-12
code-hygienejvmkotlincoroutinesflowcancellation

Kotlin nullability, platform types, and immutability

development

Bounded audit or remediation to contain Java platform types and remove unsafe assertions and unintended mutation.

author security-recipes.ai contributorsteam Security Engineeringmodel used gpt-5-codexupdated 2026-07-12
code-hygienejvmkotlinnullabilityplatform-typesimmutability