Hush recent javac annotation-processor warnings #490
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recent versions of
javac
warn that annotation processing might not happen in the future unless--processor
,--processor-path
,--processor-module-path
, or some-proc
option is explicitly given. Nothing was going to break, because the POMs where annotation processing needs to happen already set--processor-module-path
. But that doesn't silence the warning. Only an explicit-proc:full
or-processor org.postgresql.pljava.annotation.processing.DDRProcessor
accomplishes that. Because-proc:full
is unrecognized before Java 21, but the longwinded-processor
spec works in all supported versions, the longwinded form is used here (even though it seems a complete waste of the elegance of the original processor discovery scheme).Warnings were also appearing in a couple of compilations where no annotation processing was needed or expected. When compiling the PGXS plugin, the warning appeared because an unexpected and unneeded processor
org.eclipse.sisu.space.SisuIndexAPT6
was being found in one of the 70 classpath elements glommed together to build a Maven plugin. When building thepljava-packaging
classes, the POM names the other PL/Java modules as dependencies (because they must exist before they can be packaged), with the side effect of adding them to the classpath, so PL/Java's processor is found, though not needed for the packaging code. In both of those modules, add-proc:none
(which is recognized in all supported versions; only-proc:full
was newer).The longwinded approach of naming an exact processor class might be hygienically preferable to the broad
-proc:full
, as less prone to surprises when another processor likeSisuIndexAPT6
happens to exist on the classpath. (Assuming the other processor is nonmalicious, and is looking for annotations the code being compiled doesn't use, the processor wouldn't be expected to do anything, yielding surprise of the mildest possible kind. Still, anyone very averse to surprise might prefer to name the expected processor explicitly.)