GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Never package bytecode-modified class files in published JARs by andimarek · Pull Request #4343 · graphql-java/graphql-java

Conversation

@andimarek

@andimarek andimarek commented Mar 18, 2026

Copy link
Copy Markdown
Member

Summary

  • The markGeneratedEqualsHashCode task was modifying .class files in-place in build/classes/java/main and the jar task depended on it, causing every published class with equals/hashCode to contain a spurious @Generated (Lgraphql/coverage/Generated;) annotation in the bytecode
  • Fix: copy classes to a separate build/classes-jacoco/ directory before injecting annotations, prepend that directory to the test classpath (so Jacoco CRC64 checksums match the execution data), and point jacocoTestReport at the modified copy
  • The jar/shadowJar/publish tasks now only see pristine compiler output — no bytecode modifications leak into artifacts

Test plan

  • Verified original classes in build/classes/java/main remain unmodified after running markGeneratedEqualsHashCode
  • Verified classes in build/classes-jacoco/java/main contain the @Generated annotation
  • Verified the built JAR does not contain graphql.coverage.Generated annotations
  • Verified the shadow JAR does not contain graphql.coverage.Generated annotations
  • All tests pass (./gradlew test)
  • Jacoco report generates successfully with real coverage data (non-zero counters)
  • equals/hashCode methods are properly excluded from the Jacoco coverage report

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@andimarek @claude
Never package bytecode-modified class files in published JARs
cccb78b
The markGeneratedEqualsHashCode task was modifying class files in-place
in build/classes/java/main, and the jar task depended on it, causing
the @Generated-annotated bytecode to flow into published artifacts.

Fix: copy classes to a separate build/classes-jacoco/ directory before
modifying them, prepend that directory to the test classpath (so Jacoco
CRC64 checksums match), and point jacocoTestReport at the modified copy.
The jar/shadowJar tasks now only see the pristine compiler output.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@andimarek
andimarek enabled auto-merge (rebase) March 18, 2026 00:34
@andimarek
andimarek merged commit e53ab1a into master Mar 18, 2026
11 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Test Report

Test Results

Java Version Total Passed Failed Errors Skipped
Java 11 5708 (±0) 5652 (±0) 0 (±0) 0 (±0) 56 (±0)
Java 17 5708 (±0) 5651 (±0) 0 (±0) 0 (±0) 57 (±0)
Java 21 5708 (±0) 5651 (±0) 0 (±0) 0 (±0) 57 (±0)
Java 25 5708 (±0) 5651 (±0) 0 (±0) 0 (±0) 57 (±0)
jcstress 32 (±0) 32 (±0) 0 (±0) 0 (±0) 0 (±0)
Total 22864 (±0) 22637 (±0) 0 (±0) 0 (±0) 227 (±0)

Code Coverage (Java 25)

Metric Covered Missed Coverage vs Master
Lines 28775 3122 90.2% ±0.0%
Branches 8354 1508 84.7% ±0.0%
Methods 7699 1223 86.3% ±0.0%

No per-class coverage changes detected.

Full HTML report: build artifact jacoco-html-report

Updated: 2026-03-18 00:42:24 UTC

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dondonz

dondonz commented Mar 18, 2026

Copy link
Copy Markdown
Member

Thanks!!!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dondonz dondonz mentioned this pull request Mar 18, 2026
Fix coverage-modified classes being included in published artifacts #4341
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@andimarek @dondonz
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.