[OPENJPA-2978] Fix SchemaManagerImpl nits and unsupported-validation reporting - #155
Merged
Conversation
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.
solomax
reviewed
Aug 20, 2026
solomax
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cleans up the reported nits in
SchemaManagerImpl(stray double semicolon, redundant(Exception)cast, javadoc typo) and stopsvalidate()from wrapping anUnsupportedOperationExceptionintoSchemaValidationException("Schema could not be validated: null")— a store that does not implement validation now reports a missing capability, consistently withcreate(),drop()andtruncate(). The message-lessUnsupportedOperationExceptions inAbstractBrokerFactorygot real messages, and a newTestSchemaManagerImplcovers both the unsupported and the real-failure path.The
Strucuture/Struturetypos from the review comment are already fixed on master (commit cbb19f7, "[OPENJPA-2940] Fixes typos in BrokerFactory"), so no rename was needed.