Skip to content

Use Gradle's default javac source path and processor settings - #500

Open
tonygermano wants to merge 1 commit into
OpenIntegrationEngine:mainfrom
tonygermano:build/no-classpath-annotation-processing
Open

tonygermano wants to merge 1 commit into
OpenIntegrationEngine:mainfrom
tonygermano:build/no-classpath-annotation-processing

Conversation

@tonygermano

Copy link
Copy Markdown
Member

The compile tasks pointed -sourcepath at the source directories and used the compile classpath as the annotation processor path. Neither is needed, and running every processor found on the classpath becomes a liability once dependency resolution turns transitive: any newly arrived jar that ships a processor would start running.

The only processors on any classpath today are log4j-core's (PluginProcessor, GraalVmProcessor; no other resolved or vendored jar ships a META-INF/services/javax.annotation.processing.Processor), and no source uses @plugin, so they generated nothing. Drop both overrides and let Gradle pass -proc:none with its own (empty) source path. As a side benefit, log4j-core's processors are not registered as incremental, so every change forced a full recompile of the module; incremental compilation now works.

Removing -sourcepath cannot change what is compiled: every source file is passed to javac explicitly, and the only file a source-set exclude hides (generator's HL7ModelGeneratorTest under /test/) is referenced by nothing.

Effect on the distribution, checked with oie-build-parity's compare_builds.py against a build of the parent commit (both built with clean build dist -PdisableSigning=true):

  • 711 files on both sides, same file set; 699 byte-identical; 478 of 490 jars/zips have identical entry contents.
  • 34 entries differ, 24 distinct classes in 12 jars, all anonymous inner classes: client-lib/mirth-client.jar (12) ChannelPanel$GroupAssignmentDialog$1, ChannelSetup$25, CustomAttachmentDialog$2, RegexAttachmentDialog$1/$3, MessageBrowserAdvancedFilter$1/$3, MirthPropertiesTable$1, BaseEditorPane$NameEditor$1, SourceSettingsPanel$1/$2, org.fife.ui.rtextarea.RTextArea$1 {server,client,cli}-lib/mirth-client-core.jar MirthMapperWrapper$1, net.lingala.zip4j.unzip.Unzip$1/$2 server-lib/mirth-server.jar: MirthMapperWrapper$1 {client,cli}-lib/donkey-model.jar, server-lib/donkey/donkey-model.jar, server-lib/donkey/donkey-server.jar: XStreamSerializer$1 extensions/http/http-client.jar: HttpListener$1, HttpSender$5/$7 extensions/smtp/smtp-client.jar: SmtpSender$1/$3 extensions/tcp/tcp-server.jar: TcpDispatcher$1/$2, TcpReceiver$1 compare_builds.py reports these as real differences (exit 1) because it treats any class content change as real.
  • For all 34 entries, javap -c -p -s output (bytecode, signatures, flags) is identical. The javap -v diff contains only Utf8 constants and LocalVariableTable rows: the anonymous class constructor's parameters, which javac copies from the superclass constructor (data, columnNames, name, wrapped, ...) while annotation processing is enabled, are now named arg0..N.

The LocalVariableTable is debug information only. No -parameters flag is used, so no MethodParameters attribute is emitted either way and reflection (Parameter.getName) is unaffected; the default serialVersionUID computation does not include it. The only visible change is debugger variable names in those constructors.

Also drop CONTRIBUTING.md's parenthetical claiming the parity tooling reproduces a byte-identical comparison, which no longer holds.

Assisted-by: Claude:claude-opus-5-5

The compile tasks pointed -sourcepath at the source directories and
used the compile classpath as the annotation processor path. Neither
is needed, and running every processor found on the classpath becomes
a liability once dependency resolution turns transitive: any newly
arrived jar that ships a processor would start running.

The only processors on any classpath today are log4j-core's
(PluginProcessor, GraalVmProcessor; no other resolved or vendored jar
ships a META-INF/services/javax.annotation.processing.Processor), and
no source uses @plugin, so they generated nothing. Drop both overrides
and let Gradle pass -proc:none with its own (empty) source path. As a
side benefit, log4j-core's processors are not registered as
incremental, so every change forced a full recompile of the module;
incremental compilation now works.

Removing -sourcepath cannot change what is compiled: every source file
is passed to javac explicitly, and the only file a source-set exclude
hides (generator's HL7ModelGeneratorTest under **/test/**) is
referenced by nothing.

Effect on the distribution, checked with oie-build-parity's
compare_builds.py against a build of the parent commit (both built
with clean build dist -PdisableSigning=true):

- 711 files on both sides, same file set; 699 byte-identical; 478 of
  490 jars/zips have identical entry contents.
- 34 entries differ, 24 distinct classes in 12 jars, all anonymous
  inner classes:
    client-lib/mirth-client.jar (12)
      ChannelPanel$GroupAssignmentDialog$1, ChannelSetup$25,
      CustomAttachmentDialog$2, RegexAttachmentDialog$1/$3,
      MessageBrowserAdvancedFilter$1/$3, MirthPropertiesTable$1,
      BaseEditorPane$NameEditor$1, SourceSettingsPanel$1/$2,
      org.fife.ui.rtextarea.RTextArea$1
    {server,client,cli}-lib/mirth-client-core.jar
      MirthMapperWrapper$1, net.lingala.zip4j.unzip.Unzip$1/$2
    server-lib/mirth-server.jar: MirthMapperWrapper$1
    {client,cli}-lib/donkey-model.jar, server-lib/donkey/donkey-model.jar,
    server-lib/donkey/donkey-server.jar: XStreamSerializer$1
    extensions/http/http-client.jar: HttpListener$1, HttpSender$5/$7
    extensions/smtp/smtp-client.jar: SmtpSender$1/$3
    extensions/tcp/tcp-server.jar: TcpDispatcher$1/$2, TcpReceiver$1
  compare_builds.py reports these as real differences (exit 1)
  because it treats any class content change as real.
- For all 34 entries, javap -c -p -s output (bytecode, signatures,
  flags) is identical. The javap -v diff contains only Utf8 constants
  and LocalVariableTable rows: the anonymous class constructor's
  parameters, which javac copies from the superclass constructor
  (data, columnNames, name, wrapped, ...) while annotation processing
  is enabled, are now named arg0..N.

The LocalVariableTable is debug information only. No -parameters flag
is used, so no MethodParameters attribute is emitted either way and
reflection (Parameter.getName) is unaffected; the default
serialVersionUID computation does not include it. The only visible
change is debugger variable names in those constructors.

Also drop CONTRIBUTING.md's parenthetical claiming the parity tooling
reproduces a byte-identical comparison, which no longer holds.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Tony Germano <tony@germano.name>
@github-actions

Copy link
Copy Markdown

Test Results

128 files  ±0  128 suites  ±0   3m 10s ⏱️ +32s
729 tests ±0  729 ✅ ±0  0 💤 ±0  0 ❌ ±0 
819 runs  ±0  813 ✅ ±0  6 💤 ±0  0 ❌ ±0 

Results for commit 8d4232c. ± Comparison against base commit f9ba73e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants