Format Java files with google-java-format

Change-Id: Ia2b41a46e16289e9bfee32aff17e919f822a23c8
This commit is contained in:
David Pursehouse
2017-03-30 17:29:11 +09:00
parent e3fca207cb
commit 0c9be87fc8
2 changed files with 9 additions and 21 deletions

View File

@@ -504,8 +504,8 @@ public class H2CacheImpl<K, V> extends AbstractLoadingCache<K, V> implements Per
try {
c = acquire();
if (c.put == null) {
c.put = c.conn.prepareStatement(
"MERGE INTO data (k, v, created, accessed) VALUES(?,?,?,?)");
c.put =
c.conn.prepareStatement("MERGE INTO data (k, v, created, accessed) VALUES(?,?,?,?)");
}
try {
keyType.set(c.put, 1, key);
@@ -572,8 +572,7 @@ public class H2CacheImpl<K, V> extends AbstractLoadingCache<K, V> implements Per
c = acquire();
try (Statement s = c.conn.createStatement()) {
long used = 0;
try (ResultSet r =
s.executeQuery("SELECT SUM(space) FROM data")) {
try (ResultSet r = s.executeQuery("SELECT SUM(space) FROM data")) {
used = r.next() ? r.getLong(1) : 0;
}
if (used <= maxSize) {
@@ -582,12 +581,7 @@ public class H2CacheImpl<K, V> extends AbstractLoadingCache<K, V> implements Per
try (ResultSet r =
s.executeQuery(
"SELECT"
+ " k"
+ ",space"
+ ",created"
+ " FROM data"
+ " ORDER BY accessed")) {
"SELECT" + " k" + ",space" + ",created" + " FROM data" + " ORDER BY accessed")) {
while (maxSize < used && r.next()) {
K key = keyType.get(r, 1);
Timestamp created = r.getTimestamp(3);
@@ -615,12 +609,7 @@ public class H2CacheImpl<K, V> extends AbstractLoadingCache<K, V> implements Per
try {
c = acquire();
try (Statement s = c.conn.createStatement();
ResultSet r =
s.executeQuery(
"SELECT"
+ " COUNT(*)"
+ ",SUM(space)"
+ " FROM data")) {
ResultSet r = s.executeQuery("SELECT" + " COUNT(*)" + ",SUM(space)" + " FROM data")) {
if (r.next()) {
size = r.getLong(1);
space = r.getLong(2);

View File

@@ -14,17 +14,16 @@
package com.google.gerrit.pgm.init;
import java.io.IOException;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import com.google.common.base.Strings;
import com.google.gerrit.common.Die;
import com.google.gerrit.pgm.init.api.ConsoleUI;
import com.google.gerrit.server.config.SitePaths;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.io.IOException;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
@Singleton
public class StaleLibraryRemover {