Skip to content

Commit 0a154ba

Browse files
authored
internal: fix linting problems (#403)
1 parent 8b59272 commit 0a154ba

File tree

4 files changed

+19
-21
lines changed

4 files changed

+19
-21
lines changed

google-http-client/src/main/java/com/google/api/client/util/OpenCensusUtils.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
/**
3939
* Utilities for Census monitoring and tracing.
4040
*
41-
* @since 1.24
4241
* @author Hailong Wen
42+
* @since 1.24
4343
*/
4444
public class OpenCensusUtils {
4545

@@ -52,8 +52,8 @@ public class OpenCensusUtils {
5252
"Sent." + HttpRequest.class.getName() + ".execute";
5353

5454
/**
55-
* OpenCensus tracing component.
56-
* When no OpenCensus implementation is provided, it will return a no-op tracer.
55+
* OpenCensus tracing component. When no OpenCensus implementation is provided, it will return a
56+
* no-op tracer.
5757
*/
5858
private static Tracer tracer = Tracing.getTracer();
5959

@@ -189,8 +189,8 @@ public static EndSpanOptions getEndSpanOptions(@Nullable Integer statusCode) {
189189
}
190190

191191
/**
192-
* Records a new message event which contains the size of the request content.
193-
* Note that the size represents the message size in application layer, i.e., content-length.
192+
* Records a new message event which contains the size of the request content. Note that the size
193+
* represents the message size in application layer, i.e., content-length.
194194
*
195195
* @param span The {@code span} in which the send event occurs.
196196
* @param id The id for the message, It is unique within an {@link HttpRequest}.
@@ -201,8 +201,8 @@ public static void recordSentMessageEvent(Span span, long id, long size) {
201201
}
202202

203203
/**
204-
* Records a new message event which contains the size of the response content.
205-
* Note that the size represents the message size in application layer, i.e., content-length.
204+
* Records a new message event which contains the size of the response content. Note that the size
205+
* represents the message size in application layer, i.e., content-length.
206206
*
207207
* @param span The {@code span} in which the receive event occurs.
208208
* @param id The id for the message. It is unique within an {@link HttpRequest}.
@@ -213,9 +213,8 @@ public static void recordReceivedMessageEvent(Span span, long id, long size) {
213213
}
214214

215215
/**
216-
* Records a message event of a certain {@link NetowrkEvent.Type}.
217-
* This method is package protected since {@link NetworkEvent} might be deprecated in future
218-
* releases.
216+
* Records a message event of a certain {@link NetowrkEvent.Type}. This method is package
217+
* protected since {@link NetworkEvent} might be deprecated in future releases.
219218
*
220219
* @param span The {@code span} in which the event occurs.
221220
* @param id The id for the message.
@@ -225,7 +224,9 @@ public static void recordReceivedMessageEvent(Span span, long id, long size) {
225224
@VisibleForTesting
226225
static void recordMessageEvent(Span span, long id, long size, Type eventType) {
227226
Preconditions.checkArgument(span != null, "span should not be null.");
228-
if (size < 0) size = 0;
227+
if (size < 0) {
228+
size = 0;
229+
}
229230
NetworkEvent event = NetworkEvent
230231
.builder(eventType, id)
231232
.setUncompressedMessageSize(size)

google-http-client/src/test/java/com/google/api/client/http/apache/ApacheHttpTransportTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@
1414

1515
package com.google.api.client.http.apache;
1616

17+
import static org.mockito.Matchers.any;
18+
import static org.mockito.Mockito.mock;
19+
import static org.mockito.Mockito.when;
20+
1721
import com.google.api.client.util.ByteArrayStreamingContent;
1822
import com.google.api.client.util.StringUtils;
19-
2023
import junit.framework.TestCase;
2124
import org.apache.http.HttpResponse;
2225
import org.apache.http.HttpVersion;
@@ -30,10 +33,6 @@
3033
import org.apache.http.params.HttpParams;
3134
import org.apache.http.params.HttpProtocolParams;
3235

33-
import static org.mockito.Matchers.any;
34-
import static org.mockito.Mockito.mock;
35-
import static org.mockito.Mockito.when;
36-
3736
/**
3837
* Tests {@link ApacheHttpTransport}.
3938
*

google-http-client/src/test/java/com/google/api/client/util/Base64Test.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
import junit.framework.TestCase;
1717

18-
import java.util.Arrays;
19-
2018
/**
2119
* Tests {@link Base64}.
2220
*

google-http-client/src/test/java/com/google/api/client/util/OpenCensusUtilsTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@
2121
import static org.mockito.Mockito.verify;
2222

2323
import com.google.api.client.http.HttpHeaders;
24-
2524
import io.opencensus.trace.EndSpanOptions;
2625
import io.opencensus.trace.NetworkEvent;
2726
import io.opencensus.trace.Span;
28-
import io.opencensus.trace.SpanId;
2927
import io.opencensus.trace.SpanContext;
28+
import io.opencensus.trace.SpanId;
3029
import io.opencensus.trace.Status;
3130
import io.opencensus.trace.TraceId;
3231
import io.opencensus.trace.TraceOptions;
@@ -171,7 +170,8 @@ public void testGetEndSpanOptionsNotFound() {
171170

172171
@Test
173172
public void testGetEndSpanOptionsPreconditionFailed() {
174-
EndSpanOptions expected = EndSpanOptions.builder().setStatus(Status.FAILED_PRECONDITION).build();
173+
EndSpanOptions expected = EndSpanOptions.builder().setStatus(Status.FAILED_PRECONDITION)
174+
.build();
175175
assertEquals(expected, OpenCensusUtils.getEndSpanOptions(412));
176176
}
177177

0 commit comments

Comments
 (0)