-
Notifications
You must be signed in to change notification settings - Fork 311
Configure Spotless to automatically remove unused imports. #9042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AlexeyKuznetsov-DD
merged 2 commits into
master
from
alexeyk/spotless-remove-unused-imports
Jun 27, 2025
Merged
Configure Spotless to automatically remove unused imports. #9042
AlexeyKuznetsov-DD
merged 2 commits into
master
from
alexeyk/spotless-remove-unused-imports
Jun 27, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 44 metrics, 9 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.51.0-SNAPSHOT~ad64a1e8f1, baseline=1.51.0-SNAPSHOT~2c8da754a3
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (997.154 ms) : 0, 997154
Total [baseline] (10.589 s) : 0, 10589184
Agent [candidate] (1.001 s) : 0, 1001235
Total [candidate] (9.858 s) : 0, 9858127
section appsec
Agent [baseline] (1.178 s) : 0, 1178053
Total [baseline] (10.8 s) : 0, 10799670
Agent [candidate] (1.189 s) : 0, 1188755
Total [candidate] (10.885 s) : 0, 10885183
section iast
Agent [baseline] (1.143 s) : 0, 1142591
Total [baseline] (10.849 s) : 0, 10848919
Agent [candidate] (1.144 s) : 0, 1144473
Total [candidate] (10.947 s) : 0, 10946940
section profiling
Agent [baseline] (1.255 s) : 0, 1254776
Total [baseline] (11.061 s) : 0, 11060967
Agent [candidate] (1.252 s) : 0, 1251835
Total [candidate] (11.048 s) : 0, 11048462
gantt
title petclinic - break down per module: candidate=1.51.0-SNAPSHOT~ad64a1e8f1, baseline=1.51.0-SNAPSHOT~2c8da754a3
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (688.383 ms) : 0, 688383
BytebuddyAgent [candidate] (691.469 ms) : 0, 691469
GlobalTracer [baseline] (242.719 ms) : 0, 242719
GlobalTracer [candidate] (243.541 ms) : 0, 243541
AppSec [baseline] (30.346 ms) : 0, 30346
AppSec [candidate] (30.337 ms) : 0, 30337
Debugger [baseline] (6.067 ms) : 0, 6067
Debugger [candidate] (6.05 ms) : 0, 6050
Remote Config [baseline] (671.885 µs) : 0, 672
Remote Config [candidate] (667.903 µs) : 0, 668
Telemetry [baseline] (8.195 ms) : 0, 8195
Telemetry [candidate] (8.231 ms) : 0, 8231
section appsec
BytebuddyAgent [baseline] (712.083 ms) : 0, 712083
BytebuddyAgent [candidate] (719.41 ms) : 0, 719410
GlobalTracer [baseline] (236.245 ms) : 0, 236245
GlobalTracer [candidate] (238.556 ms) : 0, 238556
IAST [baseline] (22.085 ms) : 0, 22085
IAST [candidate] (22.389 ms) : 0, 22389
AppSec [baseline] (172.192 ms) : 0, 172192
AppSec [candidate] (172.68 ms) : 0, 172680
Debugger [baseline] (5.856 ms) : 0, 5856
Debugger [candidate] (5.86 ms) : 0, 5860
Remote Config [baseline] (625.524 µs) : 0, 626
Remote Config [candidate] (638.254 µs) : 0, 638
Telemetry [baseline] (8.163 ms) : 0, 8163
Telemetry [candidate] (8.171 ms) : 0, 8171
section iast
BytebuddyAgent [baseline] (815.831 ms) : 0, 815831
BytebuddyAgent [candidate] (816.06 ms) : 0, 816060
GlobalTracer [baseline] (234.728 ms) : 0, 234728
GlobalTracer [candidate] (235.927 ms) : 0, 235927
IAST [baseline] (27.553 ms) : 0, 27553
IAST [candidate] (28.394 ms) : 0, 28394
AppSec [baseline] (28.79 ms) : 0, 28790
AppSec [candidate] (28.403 ms) : 0, 28403
Debugger [baseline] (5.941 ms) : 0, 5941
Debugger [candidate] (5.954 ms) : 0, 5954
Remote Config [baseline] (595.622 µs) : 0, 596
Remote Config [candidate] (595.019 µs) : 0, 595
Telemetry [baseline] (8.157 ms) : 0, 8157
Telemetry [candidate] (8.118 ms) : 0, 8118
section profiling
BytebuddyAgent [baseline] (684.203 ms) : 0, 684203
BytebuddyAgent [candidate] (681.851 ms) : 0, 681851
GlobalTracer [baseline] (363.509 ms) : 0, 363509
GlobalTracer [candidate] (363.429 ms) : 0, 363429
AppSec [baseline] (31.869 ms) : 0, 31869
AppSec [candidate] (31.161 ms) : 0, 31161
Debugger [baseline] (12.228 ms) : 0, 12228
Debugger [candidate] (13.06 ms) : 0, 13060
Remote Config [baseline] (661.576 µs) : 0, 662
Remote Config [candidate] (665.893 µs) : 0, 666
Telemetry [baseline] (8.879 ms) : 0, 8879
Telemetry [candidate] (8.897 ms) : 0, 8897
ProfilingAgent [baseline] (104.365 ms) : 0, 104365
ProfilingAgent [candidate] (103.923 ms) : 0, 103923
Profiling [baseline] (104.39 ms) : 0, 104390
Profiling [candidate] (103.947 ms) : 0, 103947
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.51.0-SNAPSHOT~ad64a1e8f1, baseline=1.51.0-SNAPSHOT~2c8da754a3
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.0 s) : 0, 1000493
Total [baseline] (8.58 s) : 0, 8579835
Agent [candidate] (999.905 ms) : 0, 999905
Total [candidate] (8.562 s) : 0, 8562452
section iast
Agent [baseline] (1.142 s) : 0, 1141803
Total [baseline] (9.316 s) : 0, 9315549
Agent [candidate] (1.132 s) : 0, 1131523
Total [candidate] (9.234 s) : 0, 9234137
gantt
title insecure-bank - break down per module: candidate=1.51.0-SNAPSHOT~ad64a1e8f1, baseline=1.51.0-SNAPSHOT~2c8da754a3
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (690.934 ms) : 0, 690934
BytebuddyAgent [candidate] (690.248 ms) : 0, 690248
GlobalTracer [baseline] (243.258 ms) : 0, 243258
GlobalTracer [candidate] (243.155 ms) : 0, 243155
AppSec [baseline] (30.388 ms) : 0, 30388
AppSec [candidate] (30.552 ms) : 0, 30552
Debugger [baseline] (6.09 ms) : 0, 6090
Debugger [candidate] (6.081 ms) : 0, 6081
Remote Config [baseline] (674.654 µs) : 0, 675
Remote Config [candidate] (665.817 µs) : 0, 666
Telemetry [baseline] (8.26 ms) : 0, 8260
Telemetry [candidate] (8.267 ms) : 0, 8267
section iast
BytebuddyAgent [baseline] (815.821 ms) : 0, 815821
BytebuddyAgent [candidate] (807.692 ms) : 0, 807692
GlobalTracer [baseline] (235.417 ms) : 0, 235417
GlobalTracer [candidate] (233.251 ms) : 0, 233251
AppSec [baseline] (28.597 ms) : 0, 28597
AppSec [candidate] (29.187 ms) : 0, 29187
Debugger [baseline] (5.845 ms) : 0, 5845
Debugger [candidate] (5.828 ms) : 0, 5828
Remote Config [baseline] (591.692 µs) : 0, 592
Remote Config [candidate] (587.794 µs) : 0, 588
Telemetry [baseline] (8.081 ms) : 0, 8081
Telemetry [candidate] (7.912 ms) : 0, 7912
IAST [baseline] (26.491 ms) : 0, 26491
IAST [candidate] (26.293 ms) : 0, 26293
LoadParameters
See matching parameters
SummaryFound 1 performance improvements and 2 performance regressions! Performance is the same for 9 metrics, 12 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.51.0-SNAPSHOT~ad64a1e8f1, baseline=1.51.0-SNAPSHOT~2c8da754a3
dateFormat X
axisFormat %s
section baseline
no_agent (4.313 ms) : 4253, 4373
. : milestone, 4313,
iast (9.129 ms) : 8980, 9277
. : milestone, 9129,
iast_FULL (13.777 ms) : 13497, 14057
. : milestone, 13777,
iast_GLOBAL (10.01 ms) : 9833, 10187
. : milestone, 10010,
profiling (8.577 ms) : 8447, 8707
. : milestone, 8577,
tracing (7.779 ms) : 7670, 7888
. : milestone, 7779,
section candidate
no_agent (4.264 ms) : 4214, 4314
. : milestone, 4264,
iast (9.535 ms) : 9367, 9703
. : milestone, 9535,
iast_FULL (13.599 ms) : 13328, 13870
. : milestone, 13599,
iast_GLOBAL (9.931 ms) : 9742, 10120
. : milestone, 9931,
profiling (8.67 ms) : 8528, 8811
. : milestone, 8670,
tracing (7.493 ms) : 7380, 7605
. : milestone, 7493,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.51.0-SNAPSHOT~ad64a1e8f1, baseline=1.51.0-SNAPSHOT~2c8da754a3
dateFormat X
axisFormat %s
section baseline
no_agent (37.298 ms) : 36994, 37601
. : milestone, 37298,
appsec (46.603 ms) : 46187, 47019
. : milestone, 46603,
code_origins (45.512 ms) : 45126, 45898
. : milestone, 45512,
iast (42.6 ms) : 42229, 42971
. : milestone, 42600,
profiling (48.818 ms) : 48376, 49259
. : milestone, 48818,
tracing (43.728 ms) : 43361, 44095
. : milestone, 43728,
section candidate
no_agent (36.707 ms) : 36418, 36996
. : milestone, 36707,
appsec (46.51 ms) : 46104, 46917
. : milestone, 46510,
code_origins (45.109 ms) : 44710, 45508
. : milestone, 45109,
iast (44.495 ms) : 44107, 44883
. : milestone, 44495,
profiling (48.622 ms) : 48167, 49076
. : milestone, 48622,
tracing (43.094 ms) : 42730, 43458
. : milestone, 43094,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.51.0-SNAPSHOT~ad64a1e8f1, baseline=1.51.0-SNAPSHOT~2c8da754a3
dateFormat X
axisFormat %s
section baseline
no_agent (1.485 ms) : 1473, 1497
. : milestone, 1485,
appsec (2.423 ms) : 2374, 2473
. : milestone, 2423,
iast (2.207 ms) : 2145, 2269
. : milestone, 2207,
iast_GLOBAL (2.232 ms) : 2170, 2293
. : milestone, 2232,
profiling (2.046 ms) : 1997, 2096
. : milestone, 2046,
tracing (2.033 ms) : 1985, 2081
. : milestone, 2033,
section candidate
no_agent (1.482 ms) : 1471, 1494
. : milestone, 1482,
appsec (2.417 ms) : 2368, 2467
. : milestone, 2417,
iast (2.206 ms) : 2144, 2268
. : milestone, 2206,
iast_GLOBAL (2.244 ms) : 2182, 2306
. : milestone, 2244,
profiling (2.043 ms) : 1994, 2093
. : milestone, 2043,
tracing (2.017 ms) : 1969, 2064
. : milestone, 2017,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.51.0-SNAPSHOT~ad64a1e8f1, baseline=1.51.0-SNAPSHOT~2c8da754a3
dateFormat X
axisFormat %s
section baseline
no_agent (15.488 s) : 15488000, 15488000
. : milestone, 15488000,
appsec (14.767 s) : 14767000, 14767000
. : milestone, 14767000,
iast (18.693 s) : 18693000, 18693000
. : milestone, 18693000,
iast_GLOBAL (18.24 s) : 18240000, 18240000
. : milestone, 18240000,
profiling (15.165 s) : 15165000, 15165000
. : milestone, 15165000,
tracing (14.743 s) : 14743000, 14743000
. : milestone, 14743000,
section candidate
no_agent (14.806 s) : 14806000, 14806000
. : milestone, 14806000,
appsec (14.785 s) : 14785000, 14785000
. : milestone, 14785000,
iast (18.188 s) : 18188000, 18188000
. : milestone, 18188000,
iast_GLOBAL (17.941 s) : 17941000, 17941000
. : milestone, 17941000,
profiling (15.266 s) : 15266000, 15266000
. : milestone, 15266000,
tracing (14.951 s) : 14951000, 14951000
. : milestone, 14951000,
|
PerfectSlayer
approved these changes
Jun 27, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
comp: core
Tracer core
tag: no release notes
Changes to exclude from release notes
type: enhancement
Enhancements and improvements
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.
What Does This Do
Configure Spotless to automatically remove unused imports.
Motivation
Clean code.
Additional Notes
After investigating, I found that Spotless does not support expanding wildcard imports when using google-java-format, which is what we're currently using. This behavior is only supported by eclipse-java-format.
Switching to the Eclipse formatter would introduce a large number of formatting changes, which we want to avoid for now.
As a compromise, this PR enables removeUnusedImports() via Spotless to help clean up unnecessary imports automatically.
For wildcard imports, we’ll handle them manually as needed and enforce their avoidance during code review to prevent them from being merged.
Contributor Checklist
type:
and (comp:
orinst:
) labels in addition to any usefull labelsclose
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]