Skip to content

[OPENJPA-2978] Fix SchemaManagerImpl nits and unsupported-validation reporting - #155

Merged
cristof merged 2 commits into
masterfrom
OPENJPA-2978
Aug 22, 2026
Merged

[OPENJPA-2978] Fix SchemaManagerImpl nits and unsupported-validation reporting#155
cristof merged 2 commits into
masterfrom
OPENJPA-2978

Conversation

@rzo1

@rzo1 rzo1 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Cleans up the reported nits in SchemaManagerImpl (stray double semicolon, redundant (Exception) cast, javadoc typo) and stops validate() from wrapping an UnsupportedOperationException into SchemaValidationException("Schema could not be validated: null") — a store that does not implement validation now reports a missing capability, consistently with create(), drop() and truncate(). The message-less UnsupportedOperationExceptions in AbstractBrokerFactory got real messages, and a new TestSchemaManagerImpl covers both the unsupported and the real-failure path.

The Strucuture/Struture typos from the review comment are already fixed on master (commit cbb19f7, "[OPENJPA-2940] Fixes typos in BrokerFactory"), so no rename was needed.

rzo1 added 2 commits August 20, 2026 12:36
Removes the stray second semicolon in truncate(), drops the redundant
(Exception) cast when constructing SchemaValidationException, and corrects
the 'concretelly' javadoc typo. The Strucuture/Struture method name typos
reported in review were already corrected on master and need no change.
…ation failure

SchemaManagerImpl.validate() caught every Exception and rewrapped it into a
SchemaValidationException. A store which does not implement schema validation
throws UnsupportedOperationException from AbstractBrokerFactory, so a missing
capability was reported to the caller as
SchemaValidationException("Schema could not be validated: null") - which per
the jakarta.persistence 3.2 javadoc asserts that a database object is missing
or has an unexpected definition, although nothing was ever inspected.

validate() now lets UnsupportedOperationException reach the caller unchanged,
the same way create(), drop() and truncate() already do, and keeps wrapping
every other failure (MetaDataException / IllegalStateException from the JDBC
path) in SchemaValidationException. The wrapped message falls back to the
exception class name when the exception carries no message, so it can never
read "...: null" again.

For consistency the four unsupported operations in AbstractBrokerFactory now
carry a message instead of being thrown bare, which improves the create, drop
and truncate paths as well.

Adds TestSchemaManagerImpl, covering the unsupported case for all four
operations, the wrapping of a real validation failure and the message
fallback.
@rzo1 rzo1 self-assigned this Aug 20, 2026
@rzo1
rzo1 requested a review from solomax August 20, 2026 10:45
@cristof
cristof merged commit 9b0a5fe into master Aug 22, 2026
7 of 8 checks passed
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.

3 participants