Files
rdkit/Code/JavaWrappers
Andrew Dirksen cbedbb7819 Hide data representation inside RDKit::Dict (#9113)
* Remove Dict::getData() for a strict abstraction boundary

Replace direct access to Dict's internal std::vector<Pair> with
encapsulated methods: size(), empty(), const iteration via
begin()/end(), appendPair(), markNonPOD(), and getRawVal().

This enables future changes to Dict's internal representation
without breaking callers.

Ref: rdkit/rdkit#9112

* Harden Dict::appendPair to take a populated Pair by move

appendPair(Pair&&) now auto-detects non-POD status via
RDValue::needsCleanup(), eliminating markNonPOD() and the
risk of dangling references or uninitialized entries.

needsCleanup() is placed next to destroy() on RDValue to
keep the POD/non-POD distinction in one place.

* Remove vestigial dictHasNonPOD param from streamReadProp

Both callers ignored the output. Non-POD detection is now handled
by Dict::appendPair via RDValue::needsCleanup().

* unbork java build

* Address PR review: bulk append, rename getRawVal, add custom data test

- Add Dict::append(vector<Pair>&&) for bulk insertion with reserve
- Use bulk append in streamReadProps to restore pre-allocation
- Rename getRawVal -> getRDValue per reviewer preference
- Add test verifying custom AnyTag data is destroyed through Dict lifecycle

* heed self-review

* don't manually implement vec.insert

* Add test: ExplicitBitVect round-trip through Dict serialization

Exercises the full streamWriteProps/streamReadProps path with an
ExplicitBitVect in an RDProps Dict, confirming the custom handler
is invoked and no memory is leaked (verified under valgrind).

* in anyTag test, assert destructors ran a specific number of times.

---------

Co-authored-by: bddap (Coding Agent) <andrew+bot@dirksen.com>
2026-03-20 06:58:36 +01:00
..
2026-02-26 08:58:36 +01:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00
2019-10-10 20:18:43 +09:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00
add
2011-04-08 02:48:25 +00:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00
2022-09-28 05:49:27 +02:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00
2019-12-31 06:43:27 +01:00
2019-12-31 06:43:27 +01:00
2015-09-10 11:34:41 -04:00
2024-11-20 09:09:56 +01:00
2011-07-01 04:43:39 +00:00
2019-10-03 18:07:26 -04:00
2023-09-15 08:59:56 +02:00
2025-02-25 16:58:19 +01:00
2011-07-01 04:43:39 +00:00
2013-10-11 18:06:09 +02:00
2019-05-27 14:29:09 +02:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00
2019-12-31 06:43:27 +01:00
2018-03-20 10:10:40 -04:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00
2019-10-17 17:45:50 +09:00
2026-02-13 14:11:10 -05:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00
2019-12-31 06:43:27 +01:00
2025-07-30 05:56:52 +02:00
2011-07-01 04:43:39 +00:00
2025-12-09 15:06:29 +01:00
2020-06-24 17:27:40 +02:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00
2019-12-31 06:43:27 +01:00
2011-07-01 04:43:39 +00:00
2011-07-01 04:43:39 +00:00