You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "rzo1 (via GitHub)" <gi...@apache.org> on 2026/08/20 10:45:53 UTC

[PR] [OPENJPA-2978] Fix SchemaManagerImpl nits and unsupported-validation reporting [openjpa]

rzo1 opened a new pull request, #155:
URL: https://github.com/apache/openjpa/pull/155

   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 `UnsupportedOperationException`s 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 cbb19f777, "[OPENJPA-2940] Fixes typos in BrokerFactory"), so no rename was needed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@openjpa.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [OPENJPA-2978] Fix SchemaManagerImpl nits and unsupported-validation reporting [openjpa]

Posted by "solomax (via GitHub)" <gi...@apache.org>.
solomax commented on code in PR #155:
URL: https://github.com/apache/openjpa/pull/155#discussion_r3822767312


##########
openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java:
##########
@@ -475,22 +475,22 @@ public void unlock() {
     
     @Override
     public void createPersistenceStructure(boolean createSchemas) {
-    	throw new UnsupportedOperationException();
+    	throw new UnsupportedOperationException("This BrokerFactory does not implement schema creation.");

Review Comment:
   this class is `abstract` waybe these methods need to be just removed? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@openjpa.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [OPENJPA-2978] Fix SchemaManagerImpl nits and unsupported-validation reporting [openjpa]

Posted by "solomax (via GitHub)" <gi...@apache.org>.
solomax commented on code in PR #155:
URL: https://github.com/apache/openjpa/pull/155#discussion_r3826755914


##########
openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java:
##########
@@ -475,22 +475,22 @@ public void unlock() {
     
     @Override
     public void createPersistenceStructure(boolean createSchemas) {
-    	throw new UnsupportedOperationException();
+    	throw new UnsupportedOperationException("This BrokerFactory does not implement schema creation.");

Review Comment:
   Understood, thanks for clarifications :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@openjpa.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [OPENJPA-2978] Fix SchemaManagerImpl nits and unsupported-validation reporting [openjpa]

Posted by "rzo1 (via GitHub)" <gi...@apache.org>.
rzo1 commented on code in PR #155:
URL: https://github.com/apache/openjpa/pull/155#discussion_r3823066712


##########
openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java:
##########
@@ -475,22 +475,22 @@ public void unlock() {
     
     @Override
     public void createPersistenceStructure(boolean createSchemas) {
-    	throw new UnsupportedOperationException();
+    	throw new UnsupportedOperationException("This BrokerFactory does not implement schema creation.");

Review Comment:
   These can't just be removed: `AbstractStoreBrokerFactory` (openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreBrokerFactory.java:51) is a concrete main-code subclass that implements none of the four, as is the `BrokerFactory` stub in `TestPersistenceManagerFactoryImpl`, so both would stop compiling and we'd end up pasting the same four throws into `AbstractStoreBrokerFactory` rather than deleting them. The methods are also new on the interface (@since 4.2.0, unreleased), so any out-of-tree factory extending `AbstractBrokerFactory` compiles today only because these defaults exist - dropping them turns a clear `UnsupportedOperationException` into an `AbstractMethodError` at `getSchemaManager()` time. I'd rather keep one default here than duplicate it per subclass; this commit only makes the exception say which operation is missing. If you'd still prefer compile-time enforcement, that's a separate change that also has to decide what `AbstractStoreBrokerFactory
 ` does for schema operations.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@openjpa.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [OPENJPA-2978] Fix SchemaManagerImpl nits and unsupported-validation reporting [openjpa]

Posted by "solomax (via GitHub)" <gi...@apache.org>.
solomax commented on code in PR #155:
URL: https://github.com/apache/openjpa/pull/155#discussion_r3822767312


##########
openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java:
##########
@@ -475,22 +475,22 @@ public void unlock() {
     
     @Override
     public void createPersistenceStructure(boolean createSchemas) {
-    	throw new UnsupportedOperationException();
+    	throw new UnsupportedOperationException("This BrokerFactory does not implement schema creation.");

Review Comment:
   this class is `abstract` maybe these methods need to be just removed? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@openjpa.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [OPENJPA-2978] Fix SchemaManagerImpl nits and unsupported-validation reporting [openjpa]

Posted by "cristof (via GitHub)" <gi...@apache.org>.
cristof merged PR #155:
URL: https://github.com/apache/openjpa/pull/155


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@openjpa.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org