Skip to content

Commit 6bf22d7

Browse files
committed
Fix Checkstyle
1 parent 2846f47 commit 6bf22d7

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

Diff for: src/main/java/com/google/firebase/cloud/FirestoreClient.java

+9-10
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@
1111
import com.google.firebase.ImplFirebaseTrampolines;
1212
import com.google.firebase.internal.FirebaseService;
1313
import com.google.firebase.internal.NonNull;
14-
import org.slf4j.Logger;
15-
import org.slf4j.LoggerFactory;
16-
1714
import java.util.Collections;
1815
import java.util.HashMap;
1916
import java.util.Map;
17+
import org.slf4j.Logger;
18+
import org.slf4j.LoggerFactory;
2019

2120
/**
2221
* {@code FirestoreClient} provides access to Google Cloud Firestore. Use this API to obtain a
@@ -57,8 +56,8 @@ private FirestoreClient(FirebaseApp app, String databaseId) {
5756
}
5857

5958
/**
60-
* Returns the default Firestore instance associated with the default Firebase app. Returns the same
61-
* instance for all invocations. The Firestore instance and all references obtained from it
59+
* Returns the default Firestore instance associated with the default Firebase app. Returns the
60+
* same instance for all invocations. The Firestore instance and all references obtained from it
6261
* becomes unusable, once the default app is deleted.
6362
*
6463
* @return A non-null <a href="https://googlecloudplatform.github.io/google-cloud-java/google-cloud-clients/apidocs/com/google/cloud/firestore/Firestore.html">{@code Firestore}</a>
@@ -70,9 +69,9 @@ public static Firestore getFirestore() {
7069
}
7170

7271
/**
73-
* Returns the default Firestore instance associated with the specified Firebase app. For a given app,
74-
* always returns the same instance. The Firestore instance and all references obtained from it
75-
* becomes unusable, once the specified app is deleted.
72+
* Returns the default Firestore instance associated with the specified Firebase app. For a given
73+
* app, always returns the same instance. The Firestore instance and all references obtained from
74+
* it becomes unusable, once the specified app is deleted.
7675
*
7776
* @param app A non-null {@link FirebaseApp}.
7877
* @return A non-null <a href="https://googlecloudplatform.github.io/google-cloud-java/google-cloud-clients/apidocs/com/google/cloud/firestore/Firestore.html">{@code Firestore}</a>
@@ -88,7 +87,7 @@ public static Firestore getFirestore(FirebaseApp app) {
8887
* always returns the same instance. The Firestore instance and all references obtained from it
8988
* becomes unusable, once the specified app is deleted.
9089
*
91-
* @param app A non-null {@link FirebaseApp}.
90+
* @param app A non-null {@link FirebaseApp}.
9291
* @param database - The name of database.
9392
* @return A non-null <a href="https://googlecloudplatform.github.io/google-cloud-java/google-cloud-clients/apidocs/com/google/cloud/firestore/Firestore.html">{@code Firestore}</a>
9493
* instance.
@@ -140,7 +139,7 @@ private static class FirestoreInstances {
140139
private final FirebaseApp app;
141140

142141
private final Map<String, FirestoreClient> clients =
143-
Collections.synchronizedMap(new HashMap<>());
142+
Collections.synchronizedMap(new HashMap<>());
144143

145144
private FirestoreInstances(FirebaseApp app) {
146145
this.app = app;

Diff for: src/test/java/com/google/firebase/cloud/FirestoreClientTest.java

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
package com.google.firebase.cloud;
22

3+
import static org.junit.Assert.assertEquals;
4+
import static org.junit.Assert.assertNotNull;
5+
import static org.junit.Assert.assertNotSame;
6+
import static org.junit.Assert.assertSame;
7+
import static org.junit.Assert.assertThrows;
8+
39
import com.google.auth.oauth2.GoogleCredentials;
410
import com.google.cloud.firestore.DocumentReference;
511
import com.google.cloud.firestore.Firestore;
@@ -14,8 +20,6 @@
1420
import org.junit.After;
1521
import org.junit.Test;
1622

17-
import static org.junit.Assert.*;
18-
1923
public class FirestoreClientTest {
2024

2125
private static final FirestoreOptions FIRESTORE_OPTIONS = FirestoreOptions.newBuilder()
@@ -32,7 +36,7 @@ public void tearDown() {
3236

3337
@Test
3438
public void testExplicitProjectId() throws IOException {
35-
String databaseId = "databaseIdInTestExplicitProjectId";
39+
final String databaseId = "databaseIdInTestExplicitProjectId";
3640
FirebaseApp app = FirebaseApp.initializeApp(FirebaseOptions.builder()
3741
.setCredentials(GoogleCredentials.fromStream(ServiceAccount.EDITOR.asStream()))
3842
.setProjectId("explicit-project-id")
@@ -55,7 +59,7 @@ public void testExplicitProjectId() throws IOException {
5559

5660
@Test
5761
public void testServiceAccountProjectId() throws IOException {
58-
String databaseId = "databaseIdInTestServiceAccountProjectId";
62+
final String databaseId = "databaseIdInTestServiceAccountProjectId";
5963
FirebaseApp app = FirebaseApp.initializeApp(FirebaseOptions.builder()
6064
.setCredentials(GoogleCredentials.fromStream(ServiceAccount.EDITOR.asStream()))
6165
.setFirestoreOptions(FIRESTORE_OPTIONS)
@@ -77,7 +81,7 @@ public void testServiceAccountProjectId() throws IOException {
7781

7882
@Test
7983
public void testFirestoreOptions() throws IOException {
80-
String databaseId = "databaseIdInTestFirestoreOptions";
84+
final String databaseId = "databaseIdInTestFirestoreOptions";
8185
FirebaseApp app = FirebaseApp.initializeApp(FirebaseOptions.builder()
8286
.setCredentials(GoogleCredentials.fromStream(ServiceAccount.EDITOR.asStream()))
8387
.setProjectId("explicit-project-id")
@@ -100,7 +104,7 @@ public void testFirestoreOptions() throws IOException {
100104

101105
@Test
102106
public void testFirestoreOptionsOverride() throws IOException {
103-
String databaseId = "databaseIdInTestFirestoreOptions";
107+
final String databaseId = "databaseIdInTestFirestoreOptions";
104108
FirebaseApp app = FirebaseApp.initializeApp(FirebaseOptions.builder()
105109
.setCredentials(GoogleCredentials.fromStream(ServiceAccount.EDITOR.asStream()))
106110
.setProjectId("explicit-project-id")
@@ -120,7 +124,7 @@ public void testFirestoreOptionsOverride() throws IOException {
120124
Firestore firestore2 = FirestoreClient.getFirestore(app, databaseId);
121125
assertEquals("explicit-project-id", firestore2.getOptions().getProjectId());
122126
assertSame(ImplFirebaseTrampolines.getCredentials(app),
123-
firestore2.getOptions().getCredentialsProvider().getCredentials());
127+
firestore2.getOptions().getCredentialsProvider().getCredentials());
124128
assertEquals(databaseId, firestore2.getOptions().getDatabaseId());
125129

126130
assertSame(firestore2, FirestoreClient.getFirestore(databaseId));
@@ -130,7 +134,7 @@ public void testFirestoreOptionsOverride() throws IOException {
130134

131135
@Test
132136
public void testAppDelete() throws IOException {
133-
String databaseId = "databaseIdInTestAppDelete";
137+
final String databaseId = "databaseIdInTestAppDelete";
134138
FirebaseApp app = FirebaseApp.initializeApp(FirebaseOptions.builder()
135139
.setCredentials(GoogleCredentials.fromStream(ServiceAccount.EDITOR.asStream()))
136140
.setProjectId("mock-project-id")

0 commit comments

Comments
 (0)