Whitespace-only code formatting changes.

This commit is contained in:
akwizgran
2015-11-30 09:38:25 +00:00
parent 1950c13ffb
commit 027ae8340f
202 changed files with 2993 additions and 2993 deletions

View File

@@ -35,19 +35,19 @@ class DatabaseCleanerImpl extends TimerTask implements DatabaseCleaner {
}
public void run() {
if(callback == null) throw new IllegalStateException();
if (callback == null) throw new IllegalStateException();
try {
if(callback.shouldCheckFreeSpace()) {
if (callback.shouldCheckFreeSpace()) {
LOG.info("Checking free space");
callback.checkFreeSpaceAndClean();
}
} catch(DbClosedException e) {
} catch (DbClosedException e) {
LOG.info("Database closed, exiting");
} catch(DbException e) {
if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
} catch (DbException e) {
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
throw new Error(e); // Kill the application
} catch(RuntimeException e) {
if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
} catch (RuntimeException e) {
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
throw new Error(e); // Kill the application
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -12,15 +12,15 @@ class ExponentialBackoff {
* be greater than Long.MAX_VALUE, Long.MAX_VALUE is returned.
*/
static long calculateExpiry(long now, int maxLatency, int txCount) {
if(now < 0) throw new IllegalArgumentException();
if(maxLatency <= 0) throw new IllegalArgumentException();
if(txCount < 0) throw new IllegalArgumentException();
if (now < 0) throw new IllegalArgumentException();
if (maxLatency <= 0) throw new IllegalArgumentException();
if (txCount < 0) throw new IllegalArgumentException();
// The maximum round-trip time is twice the maximum latency
long roundTrip = maxLatency * 2L;
// The interval between transmissions is roundTrip * 2 ^ txCount
for(int i = 0; i < txCount; i++) {
for (int i = 0; i < txCount; i++) {
roundTrip <<= 1;
if(roundTrip < 0) return Long.MAX_VALUE;
if (roundTrip < 0) return Long.MAX_VALUE;
}
// The expiry time is the current time plus the interval
long expiry = now + roundTrip;

View File

@@ -41,7 +41,7 @@ class H2Database extends JdbcDatabase {
public boolean open() throws DbException, IOException {
boolean reopen = config.databaseExists();
if(!reopen) config.getDatabaseDirectory().mkdirs();
if (!reopen) config.getDatabaseDirectory().mkdirs();
super.open("org.h2.Driver", reopen);
return reopen;
}
@@ -50,7 +50,7 @@ class H2Database extends JdbcDatabase {
// H2 will close the database when the last connection closes
try {
super.closeAllConnections();
} catch(SQLException e) {
} catch (SQLException e) {
throw new DbException(e);
}
}
@@ -64,17 +64,17 @@ class H2Database extends JdbcDatabase {
long quota = maxSize - used;
long min = Math.min(free, quota);
return min;
} catch(IOException e) {
} catch (IOException e) {
throw new DbException(e);
}
}
private long getDiskSpace(File f) {
if(f.isDirectory()) {
if (f.isDirectory()) {
long total = 0;
for(File child : f.listFiles()) total += getDiskSpace(child);
for (File child : f.listFiles()) total += getDiskSpace(child);
return total;
} else if(f.isFile()) {
} else if (f.isFile()) {
return f.length();
} else {
return 0;
@@ -84,7 +84,7 @@ class H2Database extends JdbcDatabase {
@Override
protected Connection createConnection() throws SQLException {
byte[] key = config.getEncryptionKey().getBytes();
if(key == null) throw new IllegalStateException();
if (key == null) throw new IllegalStateException();
Properties props = new Properties();
props.setProperty("user", "user");
// Separate the file password from the user password with a space

File diff suppressed because it is too large Load Diff