Make SchemaVersion.C a public constant
This is a small hack to make it easier for me to identify when a schema change occurs in the upstream Gerrit Code Review project. By making the constant public, the Google infrastructure glue can setup a compile-time rule against this value by saying: private static final Schema_61 C = SchemaVersion.C; javac will fail when the upstream version changes, reminding the developers at Google to check what has happened upstream and make sure the database will support those changes. The current version must now be edited in two places on the same line, as the compile-time check requires the constant's variable type to match the value. Change-Id: Ie709db179a57a9ec141db8c2e83ec019ddbb74e9
This commit is contained in:
@@ -32,7 +32,7 @@ import java.util.List;
|
||||
/** A version of the database schema. */
|
||||
public abstract class SchemaVersion {
|
||||
/** The current schema version. */
|
||||
private static final Class<? extends SchemaVersion> C = Schema_61.class;
|
||||
public static final Class<Schema_61> C = Schema_61.class;
|
||||
|
||||
public static class Module extends AbstractModule {
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user