Upgrade to google-java-format 1.5
Change-Id: I0c72f6c4bc0d0a93605240c2d427c80751b6ccc8
This commit is contained in:
@@ -76,8 +76,8 @@ public class StaticModule extends ServletModule {
|
||||
"/", "/c/*", "/p/*", "/q/*", "/x/*", "/admin/*", "/dashboard/*", "/settings/*");
|
||||
// TODO(dborowitz): These fragments conflict with the REST API
|
||||
// namespace, so they will need to use a different path.
|
||||
//"/groups/*",
|
||||
//"/projects/*");
|
||||
// "/groups/*",
|
||||
// "/projects/*");
|
||||
//
|
||||
|
||||
/**
|
||||
|
@@ -67,7 +67,7 @@ public class LogFileCompressor implements Runnable {
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
//compress log once and then schedule compression every day at 11:00pm
|
||||
// compress log once and then schedule compression every day at 11:00pm
|
||||
queue.getDefaultQueue().execute(compressor);
|
||||
ZoneId zone = ZoneId.systemDefault();
|
||||
LocalDateTime now = LocalDateTime.now(zone);
|
||||
|
@@ -104,7 +104,7 @@ public class ProjectConfigEntry {
|
||||
this(displayName, defaultValue, null);
|
||||
}
|
||||
|
||||
//For inheritable boolean use 'LIST' type with InheritableBoolean
|
||||
// For inheritable boolean use 'LIST' type with InheritableBoolean
|
||||
public ProjectConfigEntry(String displayName, boolean defaultValue, String description) {
|
||||
this(
|
||||
displayName,
|
||||
|
@@ -268,7 +268,7 @@ public class ChangeNotesCache {
|
||||
+ P
|
||||
+ ident // author
|
||||
+ P
|
||||
+ ident //realAuthor
|
||||
+ ident // realAuthor
|
||||
+ P
|
||||
+ T // writtenOn
|
||||
+ 2 // side
|
||||
|
@@ -132,7 +132,8 @@ public class PermissionCollection {
|
||||
// project closer to the current one come first.
|
||||
sorter.sort(ref, sections);
|
||||
|
||||
// For block permissions, we want a different order: first, we want to go from parent to child.
|
||||
// For block permissions, we want a different order: first, we want to go from parent to
|
||||
// child.
|
||||
List<Map.Entry<AccessSection, Project.NameKey>> accessDescending =
|
||||
Lists.reverse(Lists.newArrayList(sectionToProject.entrySet()));
|
||||
|
||||
|
@@ -71,7 +71,8 @@ public class BooleanProjectConfigTransformations {
|
||||
.build();
|
||||
|
||||
static {
|
||||
// Verify that each BooleanProjectConfig has to/from API mappers in BooleanProjectConfigTransformations
|
||||
// Verify that each BooleanProjectConfig has to/from API mappers in
|
||||
// BooleanProjectConfigTransformations
|
||||
if (!Sets.symmetricDifference(
|
||||
MAPPER.keySet(), new HashSet<>(Arrays.asList(BooleanProjectConfig.values())))
|
||||
.isEmpty()) {
|
||||
|
@@ -577,7 +577,8 @@ public class ListProjects implements RestReadView<TopLevelResource> {
|
||||
try {
|
||||
// Hidden projects(permitsRead = false) should only be accessible by the project owners.
|
||||
// READ_CONFIG is checked here because it's only allowed to project owners(ACCESS may also
|
||||
// be allowed for other users). Allowing project owners to access here will help them to view
|
||||
// be allowed for other users). Allowing project owners to access here will help them to
|
||||
// view
|
||||
// and update the config of hidden projects easily.
|
||||
ProjectPermission permissionToCheck =
|
||||
state.statePermitsRead() ? ProjectPermission.ACCESS : ProjectPermission.READ_CONFIG;
|
||||
|
@@ -200,7 +200,7 @@ public class PutConfig implements RestModifyView<ProjectResource, ConfigInput> {
|
||||
ProjectConfigEntry projectConfigEntry = pluginConfigEntries.get(pluginName, v.getKey());
|
||||
if (projectConfigEntry != null) {
|
||||
if (!PARAMETER_NAME_PATTERN.matcher(v.getKey()).matches()) {
|
||||
//TODO check why we have this restriction
|
||||
// TODO check why we have this restriction
|
||||
log.warn(
|
||||
"Parameter name '{}' must match '{}'",
|
||||
v.getKey(),
|
||||
|
@@ -58,7 +58,7 @@ public class StoredValue<T> {
|
||||
public T get(Prolog engine) {
|
||||
T obj = getOrNull(engine);
|
||||
if (obj == null) {
|
||||
//unless createValue() is overridden, will return null
|
||||
// unless createValue() is overridden, will return null
|
||||
obj = createValue(engine);
|
||||
if (obj == null) {
|
||||
throw new SystemException("No " + key + " available");
|
||||
|
@@ -41,7 +41,8 @@ class MySql extends BaseDataSourceType {
|
||||
b.append(port(dbs.optional("port")));
|
||||
b.append("/");
|
||||
b.append(dbs.required("database"));
|
||||
// See https://stackoverflow.com/questions/42084633/table-name-pattern-can-not-be-null-or-empty-in-java
|
||||
// See
|
||||
// https://stackoverflow.com/questions/42084633/table-name-pattern-can-not-be-null-or-empty-in-java
|
||||
b.append("?nullNamePatternMatchesAll=true");
|
||||
return b.toString();
|
||||
}
|
||||
|
@@ -66,7 +66,8 @@ public class Schema_105 extends SchemaVersion {
|
||||
private Set<String> listChangesIndexes(JdbcSchema schema) throws SQLException {
|
||||
// List of all changes indexes ever created or dropped, found with the
|
||||
// following command:
|
||||
// find g* -name \*.sql | xargs git log -i -p -S' index changes_' | grep -io ' index changes_\w*' | cut -d' ' -f3 | tr A-Z a-z | sort -u
|
||||
// find g* -name \*.sql | xargs git log -i -p -S' index changes_' | grep -io ' index
|
||||
// changes_\w*' | cut -d' ' -f3 | tr A-Z a-z | sort -u
|
||||
// Used rather than listIndexes as we're not sure whether it might include
|
||||
// primary key indexes.
|
||||
Set<String> allChanges =
|
||||
|
@@ -34,6 +34,6 @@ public interface RepoOnlyOp {
|
||||
*
|
||||
* @param ctx context
|
||||
*/
|
||||
//TODO(dborowitz): Support async operations?
|
||||
// TODO(dborowitz): Support async operations?
|
||||
default void postUpdate(Context ctx) throws Exception {}
|
||||
}
|
||||
|
@@ -66,8 +66,7 @@ public class SetLoggingLevelCommand extends SshCommand {
|
||||
reset();
|
||||
} else {
|
||||
for (Enumeration<Logger> logger = LogManager.getCurrentLoggers();
|
||||
logger.hasMoreElements();
|
||||
) {
|
||||
logger.hasMoreElements(); ) {
|
||||
Logger log = logger.nextElement();
|
||||
if (name == null || log.getName().contains(name)) {
|
||||
log.setLevel(Level.toLevel(level.name()));
|
||||
|
@@ -1588,7 +1588,7 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
String oldETag = rsrc.getETag();
|
||||
Timestamp oldTs = rsrc.getChange().getLastUpdatedOn();
|
||||
|
||||
//create a group named "ab" with one user: testUser
|
||||
// create a group named "ab" with one user: testUser
|
||||
TestAccount testUser = accountCreator.create("abcd", "abcd@test.com", "abcd");
|
||||
String testGroup = createGroupWithRealName("ab");
|
||||
GroupApi groupApi = gApi.groups().id(testGroup);
|
||||
@@ -1632,7 +1632,7 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
String oldETag = rsrc.getETag();
|
||||
Timestamp oldTs = rsrc.getChange().getLastUpdatedOn();
|
||||
|
||||
//create a group named "kobe" with one user: lee
|
||||
// create a group named "kobe" with one user: lee
|
||||
TestAccount testUser = accountCreator.create("kobebryant", "kobebryant@test.com", "kobebryant");
|
||||
TestAccount myGroupUser = accountCreator.create("lee", "lee@test.com", "lee");
|
||||
|
||||
@@ -1641,7 +1641,7 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
groupApi.description("test group");
|
||||
groupApi.addMembers(myGroupUser.fullName);
|
||||
|
||||
//ensure that user "user" is not in the group
|
||||
// ensure that user "user" is not in the group
|
||||
groupApi.removeMembers(testUser.fullName);
|
||||
|
||||
AddReviewerInput in = new AddReviewerInput();
|
||||
|
@@ -121,7 +121,8 @@ public class UploadArchiveIT extends AbstractDaemonTest {
|
||||
// Make sure the next one is not on the error channel
|
||||
packet = in.readString();
|
||||
|
||||
// 1 = DATA. It would be nicer to parse the OutputStream with SideBandInputStream from JGit, but
|
||||
// 1 = DATA. It would be nicer to parse the OutputStream with SideBandInputStream from JGit,
|
||||
// but
|
||||
// that is currently not public.
|
||||
char channel = packet.charAt(0);
|
||||
if (channel != 1) {
|
||||
|
@@ -34,7 +34,7 @@ public class DynamicSetTest {
|
||||
@Test
|
||||
public void containsWithEmpty() throws Exception {
|
||||
DynamicSet<Integer> ds = new DynamicSet<>();
|
||||
assertThat(ds.contains(2)).isFalse(); //See above comment about ds.contains
|
||||
assertThat(ds.contains(2)).isFalse(); // See above comment about ds.contains
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -42,7 +42,7 @@ public class DynamicSetTest {
|
||||
DynamicSet<Integer> ds = new DynamicSet<>();
|
||||
ds.add(2);
|
||||
|
||||
assertThat(ds.contains(2)).isTrue(); //See above comment about ds.contains
|
||||
assertThat(ds.contains(2)).isTrue(); // See above comment about ds.contains
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -50,7 +50,7 @@ public class DynamicSetTest {
|
||||
DynamicSet<Integer> ds = new DynamicSet<>();
|
||||
ds.add(2);
|
||||
|
||||
assertThat(ds.contains(3)).isFalse(); //See above comment about ds.contains
|
||||
assertThat(ds.contains(3)).isFalse(); // See above comment about ds.contains
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -59,7 +59,7 @@ public class DynamicSetTest {
|
||||
ds.add(2);
|
||||
ds.add(4);
|
||||
|
||||
assertThat(ds.contains(4)).isTrue(); //See above comment about ds.contains
|
||||
assertThat(ds.contains(4)).isTrue(); // See above comment about ds.contains
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -68,7 +68,7 @@ public class DynamicSetTest {
|
||||
ds.add(2);
|
||||
ds.add(4);
|
||||
|
||||
assertThat(ds.contains(3)).isFalse(); //See above comment about ds.contains
|
||||
assertThat(ds.contains(3)).isFalse(); // See above comment about ds.contains
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -82,12 +82,12 @@ public class DynamicSetTest {
|
||||
ds.add(6);
|
||||
|
||||
// At first, 4 is contained.
|
||||
assertThat(ds.contains(4)).isTrue(); //See above comment about ds.contains
|
||||
assertThat(ds.contains(4)).isTrue(); // See above comment about ds.contains
|
||||
|
||||
// Then we remove 4.
|
||||
handle.remove();
|
||||
|
||||
// And now 4 should no longer be contained.
|
||||
assertThat(ds.contains(4)).isFalse(); //See above comment about ds.contains
|
||||
assertThat(ds.contains(4)).isFalse(); // See above comment about ds.contains
|
||||
}
|
||||
}
|
||||
|
@@ -77,14 +77,14 @@ public class IntraLineLoaderTest {
|
||||
String b = "multi\nlinemulti\nline\n";
|
||||
assertThat(intraline(a, b)).isEqualTo(wordEdit(10, 10, 6, 16));
|
||||
// better would be:
|
||||
//assertThat(intraline(a, b)).isEqualTo(wordEdit(6, 6, 6, 16));
|
||||
// assertThat(intraline(a, b)).isEqualTo(wordEdit(6, 6, 6, 16));
|
||||
// or the equivalent:
|
||||
//assertThat(intraline(a, b)).isEqualTo(ref()
|
||||
// assertThat(intraline(a, b)).isEqualTo(ref()
|
||||
// .common("multi\n").insert("linemulti\n").common("line\n").edits
|
||||
//);
|
||||
// );
|
||||
}
|
||||
|
||||
//TODO: expected failure
|
||||
// TODO: expected failure
|
||||
// the current code does not work on the first line
|
||||
// and the insert marker is in the wrong location
|
||||
@Test(expected = AssertionError.class)
|
||||
@@ -95,7 +95,7 @@ public class IntraLineLoaderTest {
|
||||
.isEqualTo(ref().insert(" ").common(" abc\n").insert(" ").common(" def\n").edits);
|
||||
}
|
||||
|
||||
//TODO: expected failure
|
||||
// TODO: expected failure
|
||||
// the current code does not work on the first line
|
||||
@Test(expected = AssertionError.class)
|
||||
public void preferDeleteAtLineBreak() throws Exception {
|
||||
|
@@ -17,7 +17,7 @@
|
||||
set -eu
|
||||
|
||||
# Keep this version in sync with dev-contributing.txt.
|
||||
VERSION=${1:-1.3}
|
||||
VERSION=${1:-1.5}
|
||||
|
||||
case "$VERSION" in
|
||||
1.3)
|
||||
|
Reference in New Issue
Block a user