Skip to content

Remove unused code found by dead-code analysis (all 60 source sets) - #1

Open
tomtourwe wants to merge 1 commit into
mainfrom
unused-code/all-60-source-sets
Open

tomtourwe wants to merge 1 commit into
mainfrom
unused-code/all-60-source-sets

Conversation

@tomtourwe

@tomtourwe tomtourwe commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Internal PR on the CodeLaser fork, to run hibernate-orm's CI on the removal. Not for upstream.

Removes the declarations that no entry point reaches, found by CodeLaser's dead-code analysis on hibernate-orm 0347df9 with all 60 source sets of the build parsed (main, test, JMH benchmarks, integration tests, dialect-provider fixtures, jakartaData). Generated sources (antlr, xjc, JMH) are parsed but never edited.

Types removed 120
Methods removed 1,371
Fields removed 352
Groups that only become unused together 1,143
Declarations / files 2,735 / 719
Lines -11,784 / +266

Every source set compiles after the removal (compileTestJava plus the 11 other source sets' compile tasks). Locally produced by codelaser-benchmarks bench run 20261113-140826-engine-r1-hibernate-orm; ciCheck releasePrepare -x test (CI's initial build, documentation included) passes locally. Code the documentation includes is kept.

@tomtourwe tomtourwe closed this Nov 13, 2026
@tomtourwe tomtourwe reopened this Nov 13, 2026
@tomtourwe
tomtourwe force-pushed the unused-code/all-60-source-sets branch 2 times, most recently from 32667af to f5479c4 Compare November 13, 2026 13:23
Removes the declarations that no entry point reaches, as found by CodeLaser's dead-code analysis on hibernate-orm
0347df9 with all 60 source sets of the build parsed (main, test, the JMH benchmarks, the integration tests, the
dialect-provider fixtures, jakartaData). Generated sources (antlr, xjc, JMH) are parsed but never edited; code the
documentation includes is kept. An enum constant is removed only when no kept constant follows it, so no constant
changes its ordinal.

120 types, 1,371 methods and 303 fields, in 1,094 groups that become unused only together; 2,686 declarations,
707 files. Every source set compiles after the removal, `ciCheck releasePrepare -x test` passes, and `test` passes
on H2.
@tomtourwe
tomtourwe force-pushed the unused-code/all-60-source-sets branch from f5479c4 to f73bd37 Compare November 13, 2026 15:02
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.

1 participant