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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to