Skip to content

Commit 81f4719

Browse files
committed
No change - trim whitespace
1 parent 9767322 commit 81f4719

5 files changed

Lines changed: 4 additions & 53 deletions

File tree

ebean-datasource-api/src/main/java/io/ebean/datasource/ConfigPropertiesHelper.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
/**
66
* Helper used to read Properties.
77
*/
8-
class ConfigPropertiesHelper {
8+
final class ConfigPropertiesHelper {
99

1010
private final Properties properties;
11-
1211
private final String prefix;
13-
1412
private final String poolName;
1513

1614
/**
@@ -48,7 +46,6 @@ private String read(String key) {
4846
* </p>
4947
*/
5048
String get(String key, String defaultValue) {
51-
5249
String value = null;
5350
if (poolName != null && prefix != null) {
5451
value = read(prefix + "." + poolName + "." + key);

ebean-datasource-api/src/main/java/io/ebean/datasource/DSManager.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
/**
77
* Internal helper to obtain and hold the DataSourceFactory implementation.
88
*/
9-
class DSManager {
9+
final class DSManager {
1010

11-
private static DataSourceFactory factory = init();
11+
private static final DataSourceFactory factory = init();
1212

1313
private static DataSourceFactory init() {
14-
1514
Iterator<DataSourceFactory> loader = ServiceLoader.load(DataSourceFactory.class).iterator();
1615
if (loader.hasNext()) {
1716
return loader.next();

ebean-datasource-api/src/main/java/io/ebean/datasource/DataSourceConfig.java

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -15,88 +15,53 @@ public class DataSourceConfig {
1515
private static final String POSTGRES = "postgres";
1616

1717
private InitDatabase initDatabase;
18-
1918
private String readOnlyUrl;
20-
2119
private String url;
22-
2320
private String username;
24-
2521
private String password;
26-
2722
private String schema;
28-
2923
/**
3024
* The name of the database platform (for use with ownerUsername and InitDatabase).
3125
*/
3226
private String platform;
33-
3427
/**
3528
* The optional database owner username (for running InitDatabase).
3629
*/
3730
private String ownerUsername;
38-
3931
/**
4032
* The optional database owner password (for running InitDatabase).
4133
*/
4234
private String ownerPassword;
43-
4435
private String driver;
45-
4636
private int minConnections = 2;
47-
4837
private int maxConnections = 200;
49-
5038
private int isolationLevel = Connection.TRANSACTION_READ_COMMITTED;
51-
5239
private boolean autoCommit;
53-
5440
private boolean readOnly;
55-
5641
private String heartbeatSql;
57-
5842
private int heartbeatFreqSecs = 30;
59-
6043
private int heartbeatTimeoutSeconds = 3;
61-
6244
private boolean captureStackTrace;
63-
6445
private int maxStackTraceSize = 5;
65-
6646
private int leakTimeMinutes = 30;
67-
6847
private int maxInactiveTimeSecs = 300;
69-
7048
private int maxAgeMinutes = 0;
71-
7249
private int trimPoolFreqSecs = 59;
73-
7450
private int pstmtCacheSize = 50;
75-
7651
private int cstmtCacheSize = 20;
77-
7852
private int waitTimeoutMillis = 1000;
79-
8053
private String poolListener;
81-
8254
private boolean offline;
83-
8455
private boolean failOnStart = true;
85-
8656
private Map<String, String> customProperties;
87-
8857
private List<String> initSql;
89-
90-
9158
private DataSourceAlert alert;
92-
9359
private DataSourcePoolListener listener;
9460

9561
/**
9662
* Return a copy of the DataSourceConfig.
9763
*/
9864
public DataSourceConfig copy() {
99-
10065
DataSourceConfig copy = new DataSourceConfig();
10166
copy.initDatabase = initDatabase;
10267
copy.url = url;
@@ -134,7 +99,6 @@ public DataSourceConfig copy() {
13499
copy.initSql = initSql;
135100
copy.alert = alert;
136101
copy.listener = listener;
137-
138102
return copy;
139103
}
140104

@@ -831,7 +795,6 @@ public DataSourceConfig loadSettings(Properties properties, String serverName) {
831795
* Load the settings from the PropertiesWrapper.
832796
*/
833797
private void loadSettings(ConfigPropertiesHelper properties) {
834-
835798
username = properties.get("username", username);
836799
password = properties.get("password", password);
837800
schema = properties.get("schema", schema);
@@ -841,7 +804,6 @@ private void loadSettings(ConfigPropertiesHelper properties) {
841804
if (initDatabase == null && platform != null) {
842805
setInitDatabaseForPlatform(platform);
843806
}
844-
845807
driver = properties.get("driver", properties.get("databaseDriver", driver));
846808
readOnlyUrl = properties.get("readOnlyUrl", readOnlyUrl);
847809
url = properties.get("url", properties.get("databaseUrl", url));
@@ -853,22 +815,18 @@ private void loadSettings(ConfigPropertiesHelper properties) {
853815
maxInactiveTimeSecs = properties.getInt("maxInactiveTimeSecs", maxInactiveTimeSecs);
854816
trimPoolFreqSecs = properties.getInt("trimPoolFreqSecs", trimPoolFreqSecs);
855817
maxAgeMinutes = properties.getInt("maxAgeMinutes", maxAgeMinutes);
856-
857818
minConnections = properties.getInt("minConnections", minConnections);
858819
maxConnections = properties.getInt("maxConnections", maxConnections);
859820
pstmtCacheSize = properties.getInt("pstmtCacheSize", pstmtCacheSize);
860821
cstmtCacheSize = properties.getInt("cstmtCacheSize", cstmtCacheSize);
861-
862822
waitTimeoutMillis = properties.getInt("waitTimeout", waitTimeoutMillis);
863-
864823
heartbeatSql = properties.get("heartbeatSql", heartbeatSql);
865824
heartbeatTimeoutSeconds = properties.getInt("heartbeatTimeoutSeconds", heartbeatTimeoutSeconds);
866825
poolListener = properties.get("poolListener", poolListener);
867826
offline = properties.getBoolean("offline", offline);
868827

869828
String isoLevel = properties.get("isolationLevel", getTransactionIsolationLevel(isolationLevel));
870829
this.isolationLevel = getTransactionIsolationLevel(isoLevel);
871-
872830
this.initSql = parseSql(properties.get("initSql", null));
873831
this.failOnStart = properties.getBoolean("failOnStart", failOnStart);
874832

@@ -893,7 +851,6 @@ private List<String> parseSql(String sql) {
893851
}
894852

895853
Map<String, String> parseCustom(String customProperties) {
896-
897854
Map<String, String> propertyMap = new LinkedHashMap<String, String>();
898855
String[] pairs = customProperties.split(";");
899856
for (String pair : pairs) {

ebean-datasource-api/src/main/java/io/ebean/datasource/PostgresInitDatabase.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ public class PostgresInitDatabase implements InitDatabase {
1616

1717
@Override
1818
public void run(Connection connection, DataSourceConfig config) throws SQLException {
19-
2019
String username = config.getUsername();
2120
String password = config.getPassword();
22-
2321
log.info("Creating schema and role for {}", username);
2422
execute(connection, String.format("create schema if not exists %s", username));
2523
execute(connection, String.format("create role %s with login password '%s'", username, password));

ebean-datasource/src/main/java/io/ebean/datasource/pool/ConnectionPool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public SQLException getDataSourceDownReason() {
301301
/**
302302
* Called when the pool hits the warning level.
303303
*/
304-
protected void notifyWarning(String msg) {
304+
void notifyWarning(String msg) {
305305
if (inWarningMode.compareAndSet(false, true)) {
306306
// send an Error to the event log...
307307
logger.warn(msg);

0 commit comments

Comments
 (0)