Check builder emptiness without creating a string
ProprietaryAvoid string snapshots when testing StringBuilder or StringBuffer emptiness on Java 15+ sources. Use direct length() == 0 or != 0 checks, preserving compatibility with runtimes that do not provide CharSequence.isEmpty(). Both builder types are final, so their snapshots are empty exactly when their length is zero. Other CharSequence implementations, comments, ignored results and sources without a known Java 15+ source level are left alone.
io. moderne. staticanalysis. StringBuilderIsEmptymod run . --recipe= io. moderne. staticanalysis. StringBuilderIsEmptyInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.