Yes, You Still Need to Specify a Character Set in Java 18+

Lately I’ve heard developers claim that it’s now OK to avoid specifying the character set when creating an InputStreamReader or String, or otherwise converting bytes into characters because Java now (JDK 18 and later) uses UTF-8 as its default character encoding regardless of platform.

Except we do still need to do it, for two independent reasons:

Read the rest of this entry »

XOM 1.4.0 Released. Now With Special LLM Sauce

I’ve released version 1.4.0 of XOM, my open source library for processing XML with Java. It’s available from the usual places including Maven Central (xom:xom:1.4.0) and https://xom.nu/. This is the first release coded with LLM assistance.

Read the rest of this entry »

Public Means Public

Often in a code review I’ll point out that public signatures are being changed, and we can’t do that in a minor release. Then the author will reply that it’s OK because it’s an internal only API, or an impl API, or both so it’s OK. No one is depending on it. And then this happens:


Error:  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.14.0:compile (default-compile) on project mvnd-daemon: Compilation failure
Error:  /Users/runner/work/maven-mvnd/maven-mvnd/daemon/src/main/java/org/mvndaemon/mvnd/syncontext/DaemonNamedLockFactoryAdapterFactoryImpl.java:[48,9] no suitable constructor found for NamedLockFactoryAdapterFactoryImpl(java.util.Map,java.lang.String,java.util.Map,java.lang.String,org.eclipse.aether.impl.RepositorySystemLifecycle)
Error:      constructor org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapterFactoryImpl.NamedLockFactoryAdapterFactoryImpl(java.util.Map,java.util.Map,java.util.Map,org.eclipse.aether.impl.RepositorySystemLifecycle) is not applicable
Error:        (actual and formal argument lists differ in length)
Error:      constructor org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapterFactoryImpl.NamedLockFactoryAdapterFactoryImpl(java.util.Map,java.lang.String,java.util.Map,java.lang.String,java.util.Map,org.eclipse.aether.impl.RepositorySystemLifecycle) is not applicable
Error:        (actual and formal argument lists differ in length)
Error:  -> [Help 1]

Hyrum’s Law applies. From JLBP-3:

Read the rest of this entry »

Proper Nouns: A Case Study in Agile LLM-assisted Development

I’ve released version 1.0.1 of the proper nouns library.

This is a new free-as-in-speech Java library that I wrote — Well I sort of wrote it. Truthfully GitHub copilot and whatever LLM model is sitting behind it wrote quite a bit of it. But anyway proper nouns is a library I wrote to scratch an itch. You feed it a word, and the library tells you if the word is very likely to be a name and very unlikely to not be a name so, for instance, it will tell you that Robert is a name and April is a name, but it will not tell you that Dawn is a name because dawn is also commonly used as a simple noun in English. It will tell you that Smith is a name because although smith is a perfectly valid common noun, it’s far more commonly seen as a name in the 21st century.

Read the rest of this entry »

A Gemini Success Story

I have found something Gemini is relatively good for. I asked it, step by step, to explain to me how to setup a Python program to run as a command line tool, and it did it. It took a little prompting to get it to explain wrapper scripts and virtual environments. Its initial answer didn’t fully answer the question, and its second answer required several steps to run the tool when I wanted one. However, with some prompting I got it to answer all my questions and show me what I needed to do. It didn’t write the code for me, but it was like having a more experienced Python developer sitting over my shoulder and answering my questions. Pretty helpful.

Read the rest of this entry »