Skip to content

Commit ab5e52f

Browse files
authored
Merge pull request #145 from ebean-orm/feature/rename-internal-methods
Refactor rename internal method names only
2 parents 83f6557 + 872192b commit ab5e52f

File tree

3 files changed

+31
-31
lines changed

3 files changed

+31
-31
lines changed

ebean-migration/src/main/java/io/ebean/migration/MigrationConfig.java

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -464,48 +464,48 @@ public void load(Properties props) {
464464
return;
465465
}
466466
this.properties = props;
467-
dbUsername = getProperty("username", dbUsername);
468-
dbPassword = getProperty("password", dbPassword);
469-
dbUrl = getProperty("url", dbUrl);
470-
dbSchema = getProperty("schema", dbSchema);
471-
skipMigrationRun = getBool("skipMigrationRun", skipMigrationRun);
472-
skipChecksum = getBool("skipChecksum", skipChecksum);
473-
earlyChecksumMode = getBool("earlyChecksumMode", earlyChecksumMode);
474-
createSchemaIfNotExists = getBool("createSchemaIfNotExists", createSchemaIfNotExists);
475-
setCurrentSchema = getBool("setCurrentSchema", setCurrentSchema);
476-
basePlatform = getProperty("basePlatform", basePlatform);
477-
platform = getProperty("platform", getProperty("platformName", platform));
478-
metaTable = getProperty("metaTable", metaTable);
479-
migrationPath = getProperty("migrationPath", migrationPath);
480-
migrationInitPath = getProperty("migrationInitPath", migrationInitPath);
481-
runPlaceholders = getProperty("placeholders", runPlaceholders);
482-
minVersion = getProperty("minVersion", minVersion);
483-
minVersionFailMessage = getProperty("minVersionFailMessage", minVersionFailMessage);
484-
485-
String patchInsertOn = getProperty("patchInsertOn");
467+
dbUsername = property("username", dbUsername);
468+
dbPassword = property("password", dbPassword);
469+
dbUrl = property("url", dbUrl);
470+
dbSchema = property("schema", dbSchema);
471+
skipMigrationRun = property("skipMigrationRun", skipMigrationRun);
472+
skipChecksum = property("skipChecksum", skipChecksum);
473+
earlyChecksumMode = property("earlyChecksumMode", earlyChecksumMode);
474+
createSchemaIfNotExists = property("createSchemaIfNotExists", createSchemaIfNotExists);
475+
setCurrentSchema = property("setCurrentSchema", setCurrentSchema);
476+
basePlatform = property("basePlatform", basePlatform);
477+
platform = property("platform", property("platformName", platform));
478+
metaTable = property("metaTable", metaTable);
479+
migrationPath = property("migrationPath", migrationPath);
480+
migrationInitPath = property("migrationInitPath", migrationInitPath);
481+
runPlaceholders = property("placeholders", runPlaceholders);
482+
minVersion = property("minVersion", minVersion);
483+
minVersionFailMessage = property("minVersionFailMessage", minVersionFailMessage);
484+
485+
String patchInsertOn = property("patchInsertOn");
486486
if (patchInsertOn != null) {
487487
setPatchInsertOn(patchInsertOn);
488488
}
489-
String patchResetChecksumOn = getProperty("patchResetChecksumOn");
489+
String patchResetChecksumOn = property("patchResetChecksumOn");
490490
if (patchResetChecksumOn != null) {
491491
setPatchResetChecksumOn(patchResetChecksumOn);
492492
}
493-
String runPlaceholders = getProperty("runPlaceholders");
493+
String runPlaceholders = property("runPlaceholders");
494494
if (runPlaceholders != null) {
495495
setRunPlaceholders(runPlaceholders);
496496
}
497497
}
498498

499-
private boolean getBool(String key, boolean value) {
500-
String val = getProperty(key);
499+
private boolean property(String key, boolean value) {
500+
String val = property(key);
501501
return val != null ? Boolean.parseBoolean(val) : value;
502502
}
503503

504-
private String getProperty(String key) {
505-
return getProperty(key, null);
504+
private String property(String key) {
505+
return property(key, null);
506506
}
507507

508-
private String getProperty(String key, String defaultVal) {
508+
private String property(String key, String defaultVal) {
509509
String val = properties.getProperty("ebean." + name + ".migration." + key);
510510
if (val != null) {
511511
return val;

ebean-migration/src/main/java/io/ebean/migration/MigrationRunner.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public List<MigrationResource> checkState() {
3434
* Return the migrations that would be applied if the migration is run.
3535
*/
3636
public List<MigrationResource> checkState(DataSource dataSource) {
37-
return checkState(getConnection(dataSource));
37+
return checkState(connection(dataSource));
3838
}
3939

4040
/**
@@ -55,7 +55,7 @@ public void run() {
5555
* Run using the connection from the DataSource.
5656
*/
5757
public void run(DataSource dataSource) {
58-
run(getConnection(dataSource));
58+
run(connection(dataSource));
5959
}
6060

6161
/**
@@ -65,7 +65,7 @@ public void run(Connection connection) {
6565
run(connection, false);
6666
}
6767

68-
private Connection getConnection(DataSource dataSource) {
68+
private Connection connection(DataSource dataSource) {
6969
String username = migrationConfig.getDbUsername();
7070
try {
7171
if (username == null) {

ebean-migration/src/main/java/io/ebean/migration/runner/MigrationEngine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private MigrationTable initialiseMigrationTable(Connection connection) {
9292
private List<MigrationResource> runMigrations(List<LocalMigrationResource> localVersions, MigrationTable table, boolean checkStateMode) throws SQLException {
9393
// get the migrations in version order
9494
if (table.isEmpty()) {
95-
LocalMigrationResource initVersion = getInitVersion();
95+
LocalMigrationResource initVersion = lastInitVersion();
9696
if (initVersion != null) {
9797
// run using a dbinit script
9898
log.log(INFO, "dbinit migration version:{0} local migrations:{1} checkState:{2}", initVersion, localVersions.size(), checkStateMode);
@@ -105,7 +105,7 @@ private List<MigrationResource> runMigrations(List<LocalMigrationResource> local
105105
/**
106106
* Return the last init migration.
107107
*/
108-
private LocalMigrationResource getInitVersion() {
108+
private LocalMigrationResource lastInitVersion() {
109109
LocalMigrationResources initResources = new LocalMigrationResources(migrationConfig);
110110
if (initResources.readInitResources()) {
111111
List<LocalMigrationResource> initVersions = initResources.versions();

0 commit comments

Comments
 (0)