cassandra/test
Jeremiah Jordan c7df560a79 Verify extension type before initializing reflectively-loaded classes
Cassandra resolves pluggable extensions by class name from configuration, schema, and tooling
inputs. These names were loaded with an initializing Class.forName(name) and type-checked only
afterward, so the named class ran its static initializer before its type was confirmed. After this
change such classes will be loaded without initialization, verified against the expected interface or
base class, and initialized only through normal use after validation.

A shared FBUtilities.classForNameWithoutInitialization helper and typed
instanceOrConstruct/construct overloads apply this to the configurable extension points loaded by
class name: the authentication, authorization, role-management, network and
internode-authenticator backends, the partitioner, audit logger, configuration loader, seed provider,
snitch, abstract types, secondary and custom indexes, compaction strategy, compressor, replication
strategy, SASI analyzers, key and cache providers, query handler, storage and stream hooks, tracing,
the JMX authorization proxy, MBeans, the monotonic clock, nodetool Sjk, triggers, the
sstableloader and stress class options, and diagnostic event classes (loaded without initialization
and checked against DiagnosticEvent, preserving the InvalidClassException contract and the existing
package restriction).

Regression tests confirm that an invalid-type load is rejected without initializing the target
class, and that valid implementations still resolve.

Hadoop client integration and hard-coded JDK and internal class probes are left unchanged.

patch by Jeremiah Jordan; reviewed by <reviewer> for CASSANDRA-21525
2026-07-15 19:48:28 -05:00
..
anttasks/org/apache/cassandra/anttasks JMH improvements - faster build and async profiler 2023-09-25 12:39:36 +02:00
bin JMH improvements - faster build and async profiler 2023-09-25 12:39:36 +02:00
burn/org/apache/cassandra Fix BTree.FastBuilder.reset() and test 2024-09-16 12:24:32 -05:00
conf Use default commitlog settings in test YAMLs 2024-08-15 10:12:39 -05:00
data Fix IndexOutOfBoundsException in sstablemetadata tool when a range tombstone is a max clustering value 2025-08-27 18:54:10 +02:00
distributed/org/apache/cassandra BTree.FastBuilder.reset() fails to clear savedBuffer and savedNextKey, causing ClassCastException and SSTable header corruption during schema disagreement 2026-06-02 10:14:26 +01:00
long/org/apache/cassandra Merge branch 'cassandra-3.11' into cassandra-4.0 2023-01-28 16:54:39 +01:00
memory/org/apache/cassandra/db/compaction Remove OrderedJUnit4ClassRunner 2021-09-20 13:37:32 +02:00
microbench/org/apache/cassandra/test/microbench JMH improvements - faster build and async profiler 2023-09-25 12:39:36 +02:00
resources Remove byteman-related files from production sources 2023-10-10 09:51:11 +02:00
unit/org Verify extension type before initializing reflectively-loaded classes 2026-07-15 19:48:28 -05:00