Beans/frank.
I should probably add a test for this. Ha!
This commit is contained in:
@@ -267,7 +267,7 @@ public class PersistenceContext
|
||||
Class<T> type, SchemaMigration migration)
|
||||
{
|
||||
DepotMarshaller<T> marshaller = getRawMarshaller(type);
|
||||
marshaller.requireInitialized(
|
||||
marshaller.requireNotInitialized(
|
||||
"Migrations must be registered before initializeRepositories() is called.");
|
||||
marshaller.registerMigration(migration);
|
||||
}
|
||||
|
||||
@@ -456,10 +456,11 @@ public class DepotMarshaller<T extends PersistentRecord> implements QueryMarshal
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws {@link IllegalStateException} with {@code msg} if this marshaller is not initialized.
|
||||
* Throws {@link IllegalStateException} with {@code msg} if this marshaller is already
|
||||
* initialized.
|
||||
*/
|
||||
public synchronized void requireInitialized (String msg) {
|
||||
if (_meta == null) throw new IllegalStateException(msg);
|
||||
public synchronized void requireNotInitialized (String msg) {
|
||||
if (_meta != null) throw new IllegalStateException(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user