Skip to content

Commit a8ec412

Browse files
mziccardaozarov
authored andcommitted
Fix checkstyle issues in gcloud-java-core (#871)
* Fix checkstyle issues in gcloud-java-core
1 parent 5b4ea32 commit a8ec412

File tree

7 files changed

+17
-22
lines changed

7 files changed

+17
-22
lines changed

gcloud-java-core/src/main/java/com/google/gcloud/FieldSelector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public String apply(FieldSelector fieldSelector) {
5454
};
5555

5656
private static String selector(List<? extends FieldSelector> required, FieldSelector[] others,
57-
String... extraResourceFields) {
57+
String... extraResourceFields) {
5858
Set<String> fieldStrings = Sets.newHashSetWithExpectedSize(required.size() + others.length);
5959
fieldStrings.addAll(Lists.transform(required, FIELD_TO_STRING_FUNCTION));
6060
fieldStrings.addAll(Lists.transform(Arrays.asList(others), FIELD_TO_STRING_FUNCTION));

gcloud-java-core/src/main/java/com/google/gcloud/Page.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,16 @@
2121
/**
2222
* Interface for Google Cloud paginated results.
2323
*
24-
* <p>
25-
* Use {@code Page} to iterate through all values (also in next pages):
24+
* <p>Use {@code Page} to iterate through all values (also in next pages):
2625
* <pre> {@code
2726
* Page<T> page = ...; // get a Page<T> instance
2827
* Iterator<T> iterator = page.iterateAll();
2928
* while (iterator.hasNext()) {
3029
* T value = iterator.next();
3130
* // do something with value
3231
* }}</pre>
33-
* <p>
34-
* Or handle pagination explicitly:
32+
*
33+
* <p>Or handle pagination explicitly:
3534
* <pre> {@code
3635
* Page<T> page = ...; // get a Page<T> instance
3736
* while (page != null) {

gcloud-java-core/src/main/java/com/google/gcloud/Restorable.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@
1919
/**
2020
* Implementation of this interface can persist their state and restore from it.
2121
*
22-
* <p>
23-
* A typical capture usage:
22+
* <p>A typical capture usage:
2423
* <pre> {@code
2524
* X restorableObj; // X instanceof Restorable<X>
2625
* RestorableState<X> state = restorableObj.capture();
2726
* .. persist state
2827
* }</pre>
2928
*
30-
* A typical restore usage:
29+
* <p>A typical restore usage:
3130
* <pre> {@code
3231
* RestorableState<X> state = ... // read from persistence
3332
* X restorableObj = state.restore();

gcloud-java-core/src/main/java/com/google/gcloud/RestorableState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* A common interface for restorable states. Implementations of {@code RestorableState} are capable
2121
* of saving the state of an object to restore it for later use.
2222
*
23-
* Implementations of this class must implement {@link java.io.Serializable} to ensure that the
23+
* <p>Implementations of this class must implement {@link java.io.Serializable} to ensure that the
2424
* state of a the object can be correctly serialized.
2525
*
2626
* @param <T> the restored object's type

gcloud-java-core/src/main/java/com/google/gcloud/ServiceOptions.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ public abstract class ServiceOptions<ServiceT extends Service<OptionsT>, Service
100100
/**
101101
* A base interface for all {@link HttpTransport} factories.
102102
*
103-
* Implementation must provide a public no-arg constructor. Loading of a factory implementation is
104-
* done via {@link java.util.ServiceLoader}.
103+
* <p>Implementation must provide a public no-arg constructor. Loading of a factory implementation
104+
* is done via {@link java.util.ServiceLoader}.
105105
*/
106106
public interface HttpTransportFactory {
107107
HttpTransport create();
@@ -129,7 +129,7 @@ public HttpTransport create() {
129129
* A class providing access to the current time in milliseconds. This class is mainly used for
130130
* testing and will be replaced by Java8's {@code java.time.Clock}.
131131
*
132-
* Implementations should implement {@code Serializable} wherever possible and must document
132+
* <p>Implementations should implement {@code Serializable} wherever possible and must document
133133
* whether or not they do support serialization.
134134
*/
135135
public abstract static class Clock {
@@ -490,7 +490,7 @@ protected static String appEngineProjectId() {
490490
protected static String serviceAccountProjectId() {
491491
String project = null;
492492
String credentialsPath = System.getenv("GOOGLE_APPLICATION_CREDENTIALS");
493-
if(credentialsPath != null) {
493+
if (credentialsPath != null) {
494494
try (InputStream credentialsStream = new FileInputStream(credentialsPath)) {
495495
JSONObject json = new JSONObject(new JSONTokener(credentialsStream));
496496
project = json.getString("project_id");
@@ -518,9 +518,8 @@ public ServiceRpcT rpc() {
518518
}
519519

520520
/**
521-
* Returns the project id.
522-
*
523-
* Return value can be null (for services that don't require a project id).
521+
* Returns the project id. Return value can be null (for services that don't require a project
522+
* id).
524523
*/
525524
public String projectId() {
526525
return projectId;

gcloud-java-core/src/main/java/com/google/gcloud/spi/ServiceRpcFactory.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@
1919
import com.google.gcloud.ServiceOptions;
2020

2121
/**
22-
* A base interface for all service RPC factories.
23-
*
24-
* Implementation must provide a public no-arg constructor.
25-
* Loading of a factory implementation is done via {@link java.util.ServiceLoader}.
22+
* A base interface for all service RPC factories. Implementation must provide a public no-arg
23+
* constructor. Loading of a factory implementation is done via {@link java.util.ServiceLoader}.
2624
*/
2725
@SuppressWarnings("rawtypes")
2826
public interface ServiceRpcFactory<ServiceRpcT, OptionsT extends ServiceOptions> {

gcloud-java-core/src/test/java/com/google/gcloud/BaseWriteChannelTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected BaseState.Builder<CustomServiceOptions, Serializable> stateBuilder() {
8282
}
8383

8484
@Test
85-
public void testConstructor() throws IOException {
85+
public void testConstructor() {
8686
assertEquals(null, channel.options());
8787
assertEquals(ENTITY, channel.entity());
8888
assertEquals(0, channel.position());
@@ -108,7 +108,7 @@ public void testValidateOpen() throws IOException {
108108
}
109109

110110
@Test
111-
public void testChunkSize() throws IOException {
111+
public void testChunkSize() {
112112
channel.chunkSize(42);
113113
assertEquals(MIN_CHUNK_SIZE, channel.chunkSize());
114114
channel.chunkSize(2 * MIN_CHUNK_SIZE);

0 commit comments

Comments
 (0)