Skip to content

Remove compatibility code for EOL dependency versions#50360

Open
SebTardif wants to merge 3 commits intospring-projects:mainfrom
SebTardif:fix/remove-eol-compat-hacks
Open

Remove compatibility code for EOL dependency versions#50360
SebTardif wants to merge 3 commits intospring-projects:mainfrom
SebTardif:fix/remove-eol-compat-hacks

Conversation

@SebTardif
Copy link
Copy Markdown
Contributor

@SebTardif SebTardif commented May 7, 2026

Spring Boot 4.x has bumped minimum dependency versions well past the versions guarded by these catch (NoSuchMethodError) blocks. The removed code paths are dead code that can never execute on supported dependency versions.

Removals:

  • Tomcat 8.5/9.0: Remove setHostHeader() guard in TomcatWebServerFactoryCustomizer. Boot 4.x uses jakarta.servlet, making deployment to Tomcat 8.5/9.0 impossible.
  • Tomcat (pre-10.1): Remove setClearReferencesThreadLocals() guard in DisableReferenceClearingContextCustomizer. Method exists in all Tomcat 10.x+ (added in 9.0.14, and 10.x forked from 9.0.45+).
  • Hazelcast 4: Remove reflective constructor fallback and RuntimeHintsRegistrar in HazelcastCacheMeterBinderProvider. Managed version is Hazelcast 5.5.0.
  • Jetty 10: Remove isJetty10() check and reflective shutdown() fallback in GracefulShutdown. Managed version is Jetty 12.1.8.

Comment updates (no code change):

  • Flyway: Updated comments on the existing migrate() and executeInTransaction() compat guards from "Flyway < 7.0" / "Flyway < 9.14" to "Flyway < 10.x/11.x compatibility", since Flyway110AutoConfigurationTests confirms these guards are still needed for Flyway 11.0 support.

Compatibility guards for still-supported versions (Tomcat < 10.1.42 for setMaxPartCount/setMaxPartHeaderSize, setReadOnly for older 10.1.x, and Flyway < 12.x) are intentionally retained.

Remove NoSuchMethodError catch blocks and reflective fallbacks for
dependency versions that are no longer supported:

- Flyway < 7.0 and < 9.14 (managed version: 12.4.0)
- Tomcat 8.5/9.0 (Boot 4.x uses Jakarta EE)
- Hazelcast 4 (managed version: 5.5.0)
- Jetty 10 (managed version: 12.1.8)

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 7, 2026
SebTardif added 2 commits May 7, 2026 09:11
The executeInTransaction method does not exist in Flyway 11.0, which
is still supported via ClassPathOverrides in tests. Restore the catch
block with an updated comment reflecting the actual version boundary.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
The migrate() method signature differs between Flyway 11.0 and 12.x.
The reflective fallback is needed when running against older Flyway
versions, as verified by Flyway110AutoConfigurationTests.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants