Skip to content

[TDB-19854/3.11] - Refactor the Demos to remove vulnerable dependencies (backport of master)#3315

Open
aurbroszniowski wants to merge 1 commit intoehcache:release/3.11from
aurbroszniowski:TDB-19853-upgrade-dependencies-3.11
Open

[TDB-19854/3.11] - Refactor the Demos to remove vulnerable dependencies (backport of master)#3315
aurbroszniowski wants to merge 1 commit intoehcache:release/3.11from
aurbroszniowski:TDB-19853-upgrade-dependencies-3.11

Conversation

@aurbroszniowski
Copy link
Contributor

  • Backport of TDB-19854/master (commit d532bbc)
    This was a dependency upgrade commit applied to master. Since this branch targets the same dependency upgrade goal for 3.11, those changes (SpotBugs, AssertJ, Mockito, ByteBuddy version bumps; demos rewrite; SPI test refactoring; API usage fixes) needed to be replicated here.

  • Upgrade slf4j-api 1.7.36 to 2.0.17
    Logback was upgraded to 1.5.26, which requires SLF4J 2.x.

  • Add slf4j exclusions on Terracotta dependencies statistics (and other Terracotta libs) that declare SLF4J with the range [1.7.32,1.7.9999), which excludes 2.0.17.

  • Replace Class.newInstance() with getDeclaredConstructor().newInstance()
    Class.newInstance() is deprecated. The project compiles with -Werror -Xlint:all, which promotes deprecation warnings to errors, so the build fails.

  • Suppress finalize() deprecation
    Same -Werror issue.

  • Suppress Proxy.getProxyClass() deprecation
    Also deprecated, same -Werror issue.

  • Add jaxb-api to xjcToolJakarta configuration
    The XJC code generator needs the JAXB API jar. This dependency was present in master but missing in the 3.11 branch, causing a ClassNotFoundException at generation time.

  • Add javadocAdd/jakartaJavadocAdd classpath configurations
    The source code references types from spotbugs-annotations (e.g. @checkfornull, @nonnull) and jaxb-api, which the javadoc tool needs on its classpath. These configurations existed in master but were absent in the 3.11 branch. They are required (not optional) because javadocJar is a dependency in the assemble task.

  • OSGi + SLF4J 2.x (osgi-test/build.gradle, clustered/osgi-test/build.gradle, OsgiTestUtils.java): SLF4J 2.x uses ServiceLoader and requires the osgi.serviceloader.processor extender capability, provided by Apache Aries SPIFly. SPIFly requires ASM 9.x (pulled in transitively). Added SPIFly to osgiModule configurations;

  • Deprecated wrapper constructors (StateRepositoryWhitelistingTest.java, ClusteredStoreTest.java, IntegrationConfigurationTest.java, OverSizeMappingTest.java): new Integer(x), new Long(x) constructors are deprecated for removal. Replaced with Integer.valueOf(), Long.valueOf().hashCode(), or primitive literals as appropriate.

  • @jdk.internal.vm.annotation.Contended removal (ConcurrentHashMap.java): matches master

  • AccessController.doPrivileged() suppression (ClassLoading.java): -Werror failure

  • ByteBuffer.flip() cast suppression: -Werror failure

  • BOB review pass to validate the changes.

@aurbroszniowski aurbroszniowski changed the title - Upgrade slf4j-api from 1.7.36 to 2.0.17 (required by logback 1.5.26… [TDB-19854/3.11] - Refactor the Demos to remove vulnerable dependencies (backport of master) Feb 26, 2026
…) and add slf4j exclusions on Terracotta dependencies (statistics, offheap-store, sizeof, terracotta-utilities-tools) that declare the conflicting 1.7 range

- Fix Java deprecation/removal warnings treated as errors by -Werror
- Add missing javax.xml.bind:jaxb-api to xjcToolJakarta configuration to fix ClassNotFoundException during Jakarta XJC code generation
- Add javadocAdd/jakartaJavadocAdd classpath configurations in ehcache/build.gradle (spotbugs-annotations, jaxb-api) and clustered/ehcache-clustered/build.gradle (ehcache-common-api, ehcache-common) required for javadocJar tasks in the assemble chain
- Backport of TDB-19854 (master/3.12): upgrade SpotBugs to 4.9.8, AssertJ to 3.27.7, Mockito to 5.12.0, ByteBuddy to 1.18.3; rewrite demos to use embedded Jetty 12 instead of Gretty; refactor SPI tests to use JUnit 4 rules; update Mockito 5 API usage (MockitoAnnotations, ArgumentMatchers); fix SpotBugs annotation usages
- Address compilation errors and test failures introduced by upgrading slf4j from 1.7.x to 2.0.17
- PR build with java 17
@aurbroszniowski aurbroszniowski force-pushed the TDB-19853-upgrade-dependencies-3.11 branch from 9635006 to 547c334 Compare February 26, 2026 15:45
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